Skip to content

Allow to configure schema in postgres driver #71

@frederikheld

Description

@frederikheld

Thanks for this great piece of software!

I'd like to propose an improvement:

I'm using the same Postgres database (in Supabase) for sidequest and the rest of my application. While sidequest takes care of its tables automatically, my application's tables are managed with Drizzle ORM. This leads to a collision whenever I deploy a new schema, because I don't have schemas defined for the sidequest tables, therefore Drizzle wants to delete them.

It would be great if I could tell sidequest to use its own schema for its tables.

I know that some Postgres drives support selecting the schema by appending ?currentSchema=sidequest to the connection url. This would be a simple solution, but this does not work with Supabase.

Therefore it would be great if I could configure the schema in the sidequest config:

  Sidequest.configure({
    backend: {
      driver: '@sidequest/postgres-backend',
      config: process.env.DATABASE_URL,
      schema: 'sidequest' // proposed new entry. Optional, defaults to 'public'
    }
  })

I couldn't find any config entry like this, so I propose to add it.

Let me know what you think about this or if there already is a solution that I'm not aware of.

Cheers
Fred

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions