kysely-org / kysely

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

Adding the column 'timestamp with time zone' gives an error with the new version 0.27.3 #919

Closed dsmits32 closed 5 months ago

dsmits32 commented 5 months ago

The following code will generate an error (invalid column data type "timestamp with time zone") when using the latest version, 0.27.3.

const { Kysely, sql, PostgresAdapter, DummyDriver, PostgresIntrospector, PostgresQueryCompiler } = require('kysely');
const db = new Kysely({
    dialect: {
        createAdapter: () => new PostgresAdapter(),
        createDriver: () => new DummyDriver(),
        createIntrospector: (db) => new PostgresIntrospector(db),
        createQueryCompiler: () => new PostgresQueryCompiler(),
    }})
const query = db.schema.alterTable('users').addColumn('registerDate', 'timestamp with time zone');
console.log(query.compile().sql);

When using the previous version (0.27.2), this code will work.

igalklebanov commented 5 months ago

Hey 👋

If the data type is not in the list, you should use sql template tag.

image

image

igalklebanov commented 5 months ago

duplicate of #908.

dsmits32 commented 5 months ago

Thank you very much for your prompt and clear reply. It is greatly appreciated.