Gaspero
Gaspero
KKysely
Created by bombillazo on 9/7/2023 in #help
Deno usage
Hey! I was also searching for any examples of postgres-js usage in deno. Didn't find any but managed to set it up using https://github.com/igalklebanov/kysely-postgres-js adapter // import_map.json { "imports": { "kysely": "https://cdn.jsdelivr.net/npm/[email protected]/dist/esm/index.js", "postgres": "https://deno.land/x/[email protected]/mod.js", "kysely-postgres-js": "https://cdn.jsdelivr.net/npm/kysely-postgres-js/dist/esm/index.js" } } // index.ts import { PostgresJSDialect } from "kysely-postgres-js" import { GeneratedAlways, Kysely, } from 'kysely' import postgres from 'postgres' // ... const db = new Kysely<Database>({ dialect: new PostgresJSDialect({ postgres: postgres(DATABASE_URL), }), })
4 replies
KKysely
Created by Gaspero on 5/21/2023 in #help
What is the suggested way of adding/removing methods to expression builders?
12 replies
KKysely
Created by Gaspero on 5/21/2023 in #help
What is the suggested way of adding/removing methods to expression builders?
Ok. I will submit two issues and I am ready to contribute if this issues will get ‘greenlit’ label
12 replies
KKysely
Created by Gaspero on 5/21/2023 in #help
What is the suggested way of adding/removing methods to expression builders?
Got it. Thank you!
12 replies
KKysely
Created by ohmi on 5/19/2023 in #help
Running database agnostic queries (MySQL)
Ah. I'm sorry, I thought the question was about create/drop table. If database connection has sufficient permissions may be you could solve this by running raw sql? https://kysely-org.github.io/kysely/interfaces/Sql.html E.g.
const result = await sql<void>`create database db_name'.execute(db)
const result = await sql<void>`create database db_name'.execute(db)
8 replies
KKysely
Created by ohmi on 5/19/2023 in #help
Running database agnostic queries (MySQL)
Take a look at migration section of docs https://kysely.dev/docs/migrations Seems like you could use such approach as a workaround to write database structure agnostic queries . async function functionName(db: Kysely<any>): Promise<void> { // database agnostic query } But you would still need to initialize driver for each specific database connection.
8 replies
KKysely
Created by Gaspero on 4/27/2023 in #help
Advice on building plugin for working with parameters
Thanks a lot!
10 replies