kysely-org / kysely-postgres-js

Kysely dialect for PostgreSQL using the Postgres.js client.
MIT License
58 stars 3 forks source link

chore: fix wrong postgres.js deno url @ readme. #4

Closed thorwebdev closed 1 year ago

thorwebdev commented 1 year ago

I assume this is meant to import the postgresjs package rather than deno postgres (https://deno.land/x/postgres@v0.17.0) ?

thorwebdev commented 1 year ago

Hmm, actually looks like there is some mismatch because kysely-postgres-js is imported via esm.sh whereas postgres(js) is imported via deno.land...

image
thorwebdev commented 1 year ago

It works, but as it stands today you need to ignore the TS error

const db = new Kysely<Database>({
  dialect: new PostgresJSDialect({
    connectionString: Deno.env.get("DATABASE_URL")!,
    options: {
      ssl: false,
      max: 10,
    },
    // @ts-ignore
    postgres,
  }),
}

Not sure if you're able to resolve that wen you're mixing esm and deno.land imports.