We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Awesome package! Really happy with its functionality! I do have some optimisation requests.
I have a setup where we use kysely-ctl and a kysely-config like so:
import { defineConfig } from "kysely-ctl"; import { db } from "./src/lib/database/index"; export default defineConfig({ kysely: db, }
The db is setup using Postgres dialect that is not connecting via a connection string but via credentials.
export const db = new Kysely<DB>({ log: ["error"], dialect: new PostgresDialect({ pool: new pg.Pool({ host: ENVIRONMENT.DB_HOST, port: ENVIRONMENT.DB_PORT, user: ENVIRONMENT.DB_USERNAME, password: ENVIRONMENT.DB_PASSWORD, database: ENVIRONMENT.DB_NAME, }), }),, plugins, });
I now have to maintain both DB_... variables as a DATABASE_URL in my env file.
DB_...
DATABASE_URL
It would be very lovely if codegen works by using the Kysely config as well by introspecting the DB defined in that config
The text was updated successfully, but these errors were encountered:
you could execute via code, building the url.
i run migrations and then codegen in one shot.
import { Config } from "@mono/core/config" import { Cli } from "kysely-codegen" import { migrate } from "../src/db/migrate" console.log("Running database migrations...") await migrate() console.log("Migrations complete") console.log("Generating database schema...") const codegenCli = new Cli() const schemaPath = "./src/db/schema.ts" await codegenCli.generate({ camelCase: true, outFile: schemaPath, dialectName: "mssql", excludePattern: "*.(spt|kysely|MSreplication)_*", url: `Server=${Config.db.host},${Config.db.port};Database=${Config.db.name};User Id=${Config.db.username};Password=${Config.db.password};TrustServerCertificate=true;`, }) console.log(`Generated ${schemaPath}`) console.log("Done.")
Sorry, something went wrong.
No branches or pull requests
Awesome package! Really happy with its functionality! I do have some optimisation requests.
I have a setup where we use kysely-ctl and a kysely-config like so:
The db is setup using Postgres dialect that is not connecting via a connection string but via credentials.
I now have to maintain both
DB_...
variables as aDATABASE_URL
in my env file.It would be very lovely if codegen works by using the Kysely config as well by introspecting the DB defined in that config
The text was updated successfully, but these errors were encountered: