Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix smallserial type #1836

Merged
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 19 additions & 9 deletions drizzle-orm/src/pg-core/columns/smallserial.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts';
import type {
ColumnBuilderBaseConfig,
ColumnBuilderRuntimeConfig,
HasDefault,
MakeColumnConfig,
NotNull,
} from '~/column-builder.ts';
import type { ColumnBaseConfig } from '~/column.ts';
import { entityKind } from '~/entity.ts';
import type { AnyPgTable } from '~/pg-core/table.ts';
import { PgColumn, PgColumnBuilder } from './common.ts';

export type PgSmallSerialBuilderInitial<TName extends string> = PgSmallSerialBuilder<{
name: TName;
dataType: 'number';
columnType: 'PgSmallSerial';
data: number;
driverParam: number;
enumValues: undefined;
}>;
export type PgSmallSerialBuilderInitial<TName extends string> = NotNull<
HasDefault<
PgSmallSerialBuilder<{
name: TName;
dataType: 'number';
columnType: 'PgSmallSerial';
data: number;
driverParam: number;
enumValues: undefined;
}>
>
>;

export class PgSmallSerialBuilder<T extends ColumnBuilderBaseConfig<'number', 'PgSmallSerial'>>
extends PgColumnBuilder<T>
Expand Down
Loading