Closed will-weiss closed 11 months ago
Hello! If I have a real column in Postgres like so
real
CREATE TABLE foo ( bar real ); INSERT INTO foo (bar) VALUES (1), (4.56), (7.89);
await db.selectFrom('foo').selectAll().execute()
I get back
[ { bar: "1" }, { bar: "4.56" }, { bar: "7.89" } ]
I would expect to get back Javascript numbers, like so
[ { bar: 1 }, { bar: 4.56 }, { bar: 7.89 } ]
Might someone know why these are being cast as strings?
I'm running on Deno. My db.ts file looks like so
db.ts
import { Kysely, PostgresAdapter, PostgresIntrospector, PostgresQueryCompiler, } from 'kysely' import { DatabaseSchema } from '../types.ts' import { PostgreSQLDriver } from 'kysely-deno-postgres' const DATABASE_URL = Deno.env.get('DATABASE_URL') const db = new Kysely<DatabaseSchema>({ dialect: { createAdapter() { return new PostgresAdapter() }, createDriver() { // deno-lint-ignore no-explicit-any return new PostgreSQLDriver(uri) as any }, createIntrospector(db: Kysely<unknown>) { return new PostgresIntrospector(db) }, createQueryCompiler() { return new PostgresQueryCompiler() }, }, }) export default db
While in my imports_map.json those imports are pointing to
imports_map.json
"kysely": "https://cdn.jsdelivr.net/npm/kysely/dist/esm/index.js", "kysely/": "https://cdn.jsdelivr.net/npm/kysely/dist/esm/", "kysely-deno-postgres": "https://deno.land/x/kysely_deno_postgres@v0.4.0/mod.ts",
Thanks in advance!
Duplicate of a duplicate of a duplicate of a duplicate of a duplicate of a duplicate of a duplicate of a duplicate
Hello! If I have a
real
column in Postgres like soI get back
I would expect to get back Javascript numbers, like so
Might someone know why these are being cast as strings?
I'm running on Deno. My
db.ts
file looks like soWhile in my
imports_map.json
those imports are pointing toThanks in advance!