kysely-org / kysely

A type-safe typescript SQL query builder
https://kysely.dev
MIT License
10.22k stars 259 forks source link

Unable to create timetz with precision columns #910

Closed dunkelbraun closed 5 months ago

dunkelbraun commented 5 months ago

When creating a timetz(p) column with the schema builder:

await db.schema
  .createTable("test")
  .addColumn("t", "timetz(4)")
  .execute();

parseDataTypeExpressionthrows an Error:

Error: invalid column data type "timetz(4)" ❯ Module.parseDataTypeExpression node_modules/kysely/dist/esm/parser/data-type-parser.js:14:11

koskimas commented 5 months ago
.addColumn("t", sql`timetz(4)`)
koskimas commented 5 months ago

Oh, that's actually a supported type. Needs fixing.

dunkelbraun commented 5 months ago

I forgot to mention that it was for the PostgreSQL dialect.