Skip to content
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

cannot pass an existing pool to PostgresDialect #81

Closed
DanielFGray opened this issue Apr 18, 2022 · 3 comments
Closed

cannot pass an existing pool to PostgresDialect #81

DanielFGray opened this issue Apr 18, 2022 · 3 comments
Labels
api Related to library's API built-in dialect Related to a built-in dialect enhancement New feature or request postgres Related to PostgreSQL

Comments

@DanielFGray
Copy link

for example in my app I use express-session and connect-pg-simple, the latter requires passing a pg pool

ideally I would like to re-use that pool when creating a kysely instance rather than creating a new pool

@koskimas
Copy link
Member

koskimas commented Apr 18, 2022

This issue is formatted like a bug report 😄

As a new feature this is a good idea though. I'll make this possible soon.

@koskimas koskimas added the enhancement New feature or request label Apr 18, 2022
@koskimas
Copy link
Member

koskimas commented Apr 18, 2022

Once the next version is released, you can do this:

import { Pool } from 'pg'

const pool = new Pool(config)

const db = new Kysely<DB>({
  dialect: new PostgresDialect(pool)
})

@koskimas
Copy link
Member

Released in 0.18.1

@igalklebanov igalklebanov added api Related to library's API built-in dialect Related to a built-in dialect postgres Related to PostgreSQL labels Oct 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Related to library's API built-in dialect Related to a built-in dialect enhancement New feature or request postgres Related to PostgreSQL
Projects
None yet
Development

No branches or pull requests

3 participants