Setup: should allow to set DB host and port ( remote DB / pgbouncers / ... ) #89

Closed
opened 2018-06-27 18:03:02 +00:00 by gled-rs · 2 comments
gled-rs commented 2018-06-27 18:03:02 +00:00 (Migrated from github.com)

I may be wrong but setup currently tries to setup pgsql on the local server.

If pg is on a different box, or you need to use pgbouncer on the non standard port, it fails.

We could have the option of creating the user by hand and set the DB_URL ourselves.

I may be wrong but setup currently tries to setup pgsql on the local server. If pg is on a different box, or you need to use pgbouncer on the non standard port, it fails. We could have the option of creating the user by hand and set the DB_URL ourselves.
gled-rs commented 2018-06-28 00:41:45 +00:00 (Migrated from github.com)

For now if someone needs to do it:

  • create your user and db out of plume
  • patch src/setup.rs ( or maybe just run the diesel migrations instead, it should work better than patching ):
pub fn check() -> PgPool {
    if let Some(pool) = init_pool() {
        match pool.get() {
            Ok(conn) => {
                let db_conn = DbConn(conn);
//              if Instance::get_local(&*db_conn).is_none() {
                    migrate();
                    run_setup(Some(db_conn));
//              }
            }
  • DB_URL=postgres://user:pass@server/db cargo run
  • remove the patch on src/setup.rs and rerun.
For now if someone needs to do it: - create your user and db out of plume - patch src/setup.rs ( or maybe just run the diesel migrations instead, it should work better than patching ): ```rust pub fn check() -> PgPool { if let Some(pool) = init_pool() { match pool.get() { Ok(conn) => { let db_conn = DbConn(conn); // if Instance::get_local(&*db_conn).is_none() { migrate(); run_setup(Some(db_conn)); // } } ``` - DB_URL=postgres://user:pass@server/db cargo run - remove the patch on src/setup.rs and rerun.
gled-rs commented 2018-06-28 23:42:52 +00:00 (Migrated from github.com)

workaround in #99 :)

workaround in #99 :)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Plume/Plume#89
No description provided.