-
-
Notifications
You must be signed in to change notification settings - Fork 54
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
Specifying schema for DB connection #45
Comments
It should be doable with |
Try it out in |
Just tried with Created a schema named CREATE TABLE demo.test_foo (
id bigserial NOT NULL,
"name" varchar(64) NULL,
is_enabled bool NOT NULL DEFAULT true,
CONSTRAINT test_foo_pk PRIMARY KEY (id)
); Generated without export interface DemoTestFoo {
id: Generated<Int8>;
name: string | null;
isEnabled: Generated<Boolean>;
}
export interface TestFoo {
id: Generated<Int8>;
name: string | null;
isEnabled: Generated<Boolean>;
}
export interface DB {
"demo.testFoo": DemoTestFoo;
testFoo: TestFoo;
} Generated with export interface DemoTestFoo {
id: Generated<Int8>;
name: string | null;
isEnabled: Generated<Boolean>;
}
export interface DB {
"demo.testFoo": DemoTestFoo;
} In my use case, there will be multiple schemas with the same structure. I don't want the |
Right now filtering by schema and removing schema prefixes is possible due to #56 like that: kysely-codegen --schema auth --include-pattern 'auth.*' But passing schema name like this is a bit awkward and inconsistent with Maybe we could support another |
Our project has several schemas in a single postgres database. Is there an option to target only specific schema? I already tried to set schema in database url like below,
DATABASE_URL=postgres://username:password@yourdomain.com/database?schema=my_schema
and
DATABASE_URL=postgres://username:password@yourdomain.com/database?search_path=my_schema
but neither worked. Is there any idea?
Upvote & Fund
The text was updated successfully, but these errors were encountered: