K
Kysely10mo ago
hash0

smallint support (Postgres)

Type dataType does not contain smallint?
addColumn<CN extends string>(columnName: CN, dataType: DataTypeExpression, build?: ColumnBuilderCallback): CreateTableBuilder<TB, C | CN>;
addColumn<CN extends string>(columnName: CN, dataType: DataTypeExpression, build?: ColumnBuilderCallback): CreateTableBuilder<TB, C | CN>;
export type DataTypeExpression = ColumnDataType | Expression<any>;
export type DataTypeExpression = ColumnDataType | Expression<any>;
export type ColumnDataType = 'varchar' | `varchar(${number})` | 'char' | `char(${number})` | 'text' | 'integer' | 'int2' | 'int4' | 'int8' | 'bigint' | 'boolean' | 'real' | 'double precision' | 'float4' | 'float8' | 'decimal' | `decimal(${number}, ${number})` | 'numeric' | `numeric(${number}, ${number})` | 'binary' | `binary(${number})` | 'bytea' | 'date' | 'datetime' | `datetime(${number})` | 'time' | `time(${number})` | 'timetz' | `timetz(${number})` | 'timestamp' | `timestamp(${number})` | 'timestamptz' | `timestamptz(${number})` | 'serial' | 'bigserial' | 'uuid' | 'json' | 'jsonb' | 'blob';
export type ColumnDataType = 'varchar' | `varchar(${number})` | 'char' | `char(${number})` | 'text' | 'integer' | 'int2' | 'int4' | 'int8' | 'bigint' | 'boolean' | 'real' | 'double precision' | 'float4' | 'float8' | 'decimal' | `decimal(${number}, ${number})` | 'numeric' | `numeric(${number}, ${number})` | 'binary' | `binary(${number})` | 'bytea' | 'date' | 'datetime' | `datetime(${number})` | 'time' | `time(${number})` | 'timetz' | `timetz(${number})` | 'timestamp' | `timestamp(${number})` | 'timestamptz' | `timestamptz(${number})` | 'serial' | 'bigserial' | 'uuid' | 'json' | 'jsonb' | 'blob';
Solution:
Yep, seems to be missing. You can use
addColumn("foo", sql`smallint`)
addColumn("foo", sql`smallint`)
...
Jump to solution
5 Replies
hash0
hash0OP10mo ago
No description
Solution
koskimas
koskimas10mo ago
Yep, seems to be missing. You can use
addColumn("foo", sql`smallint`)
addColumn("foo", sql`smallint`)
hash0
hash0OP10mo ago
ok. Thx!
hash0
hash0OP10mo ago
Created a small PR with a type update. https://github.com/kysely-org/kysely/pull/860
GitHub
Add missing smallint support for addColumn() by hash0000 · Pull Req...
Add missing smallint type support for addColumn()
koskimas
koskimas10mo ago
Thanks! Merged
Want results from more Discord servers?
Add your server