Skip to content

encore db conn-uri command fails when using the --test flag #2030

@carson-strella

Description

@carson-strella

Steps to Reproduce

  1. define a new DB via Encore, for example:
export const DB = new SQLDatabase("myDb", {
  migrations: {
    path: "./migrations",
  },
});
  1. Call encore run, which creates the DB
  2. Call encore db conn-uri myDb to get a valid connection string (this works!)
  3. Call encore db conn-uri myDb --test to try and get the test connection string, instead get:
error: could not connect to the database for service myDb: rename db myDb to myDb_template: ERROR: database "myDb_template" already exists (SQLSTATE 42P04)

Additional Context

I'm using Prisma to manage my DB migrations, though I didn't need to use Prisma to get the minimum repro here.

Let me know if there's anything else I can add!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions