-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add options object where you can specify a schema #11344
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
@jlvdh is attempting to deploy a commit to the authjs Team on Vercel. A member of the Team first needs to authorize it. |
Yeah so in general we do something similar in most other adapters. Ideally we wouldn't have an implicit link between what you name something in your DB schema manually adn the name we expect in the kysely adapter code.. I'm not familiar with Kysely, but can you explicitly define the schemas and pass them to the Kysely instance? Like we do in the Drizzle adapter |
@ndom91 Thanks for the reply. Kysely doesn't seem to use models like Drizzle. In Kysely you write your own migrations. So passing the schema and table names would be in string format.
Could simply be added using withSchema For further customisation of the table names we could do something like:
|
5c63d75
to
350de45
Compare
97806ac
to
aa0a51d
Compare
aa0a51d
to
8e13850
Compare
Added tests and docs now too |
feat: configure a schema for the tables add docs
8e13850
to
2027b5c
Compare
It looks like this issue did not receive any activity for 60 days. It will be closed in 7 days if no further activity occurs. If you think your issue is still relevant, commenting will keep it open. Thanks! |
☕️ Reasoning
The @auth/kysely-adapter currently depends on the tables to be configured in postgres. But it's good practice to add the tables in their own schema (eg auth.User, auth.Session, etc.) This PR would enable the configuration of a schema that is used for all the necessary tables by using:
KyselyAdapter(db, {schemaName: "auth"})
Interested to hear if this type of feature would be eligible to merge in the project?
🧢 Checklist