Currently I am getting a type error because it tells me that my postgresConnection = postgres(...) is not allowed:
import { PostgresJSDialect, PostgresJSDialectConfig } from "kysely-postgres-js";
const databaseConfig: PostgresJSDialectConfig = {
postgres: postgresConnection, // gives me TS error
};
You can see here that it is getting the TYPE from the NPMJS registry for POSTGRES, instead of using POSGRESJS driver
Type 'import("https://deno.land/x/postgresjs@v3.4.3/types/index").Sql<{}>' is not assignable to type 'import("file:///Users/jose/Library/Caches/deno/npm/registry.npmjs.org/postgres/3.4.4/types/index").Sql<{}>'. Types of property 'types' are incompatible. Type '(<T>(value: T, oid: number) => import("https://deno.land/x/postgresjs@v3.4.3/types/index").Parameter<T>) & {}' is not assignable to type '(<T>(value: T, oid: number) => import("file:///Users/jose/Library/Caches/deno/npm/registry.npmjs.org/postgres/3.4.4/types/index").Parameter<T>) & {}'. Type '(<T>(value: T, oid: number) => Parameter<T>) & {}' is not assignable to type '<T>(value: T, oid: number) => Parameter<T>'. Property '[PRIVATE]' is missing in type 'import("https://deno.land/x/postgresjs@v3.4.3/types/index").Parameter<T>' but required in type 'import("file:///Users/jose/Library/Caches/deno/npm/registry.npmjs.org/postgres/3.4.4/types/index").Parameter<T>'.
https://github.com/kysely-org/kysely-postgres-js/blob/30fd3443ebfb47b9dcbf9abb8a81addfea121f9e/src/types.ts#L3
this is using
Sql
from the npm postgres package: https://github.com/kysely-org/kysely-postgres-js/blob/main/package.json#L39it should instead use
Sql
from the postgresJS package: https://github.com/porsager/postgres/blob/master/types/index.d.ts#L660C19-L660C56Currently I am getting a type error because it tells me that my
postgresConnection = postgres(...)
is not allowed:You can see here that it is getting the TYPE from the NPMJS registry for POSTGRES, instead of using POSGRESJS driver