drizzle-typebox 1.0.0-beta.6-9514357 → 1.0.0-beta.6-051f3cd
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs +355 -445
- package/index.cjs.map +1 -1
- package/index.d.cts +122 -6
- package/index.d.mts +122 -6
- package/index.d.ts +122 -6
- package/index.mjs +348 -436
- package/index.mjs.map +1 -1
- package/package.json +2 -3
- package/column.d.cts +0 -10
- package/column.d.mts +0 -10
- package/column.d.ts +0 -10
- package/column.types.d.cts +0 -31
- package/column.types.d.mts +0 -31
- package/column.types.d.ts +0 -31
- package/constants.d.cts +0 -20
- package/constants.d.mts +0 -20
- package/constants.d.ts +0 -20
- package/schema.d.cts +0 -18
- package/schema.d.mts +0 -18
- package/schema.d.ts +0 -18
- package/schema.types.d.cts +0 -24
- package/schema.types.d.mts +0 -24
- package/schema.types.d.ts +0 -24
- package/schema.types.internal.d.cts +0 -22
- package/schema.types.internal.d.mts +0 -22
- package/schema.types.internal.d.ts +0 -22
- package/utils.d.cts +0 -39
- package/utils.d.mts +0 -39
- package/utils.d.ts +0 -39
package/utils.d.mts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import type { Kind, Static, TSchema } from '@sinclair/typebox';
|
|
2
|
-
import type { Column, SelectedFieldsFlat, Table, View } from 'drizzle-orm';
|
|
3
|
-
import type { PgEnum } from 'drizzle-orm/pg-core';
|
|
4
|
-
import type { literalSchema } from "./column.mjs";
|
|
5
|
-
export declare function isColumnType<T extends Column>(column: Column, columnTypes: string[]): column is T;
|
|
6
|
-
export declare function isWithEnum(column: Column): column is typeof column & {
|
|
7
|
-
enumValues: [string, ...string[]];
|
|
8
|
-
};
|
|
9
|
-
export declare const isPgEnum: (entity: any) => entity is PgEnum<[string, ...string[]]>;
|
|
10
|
-
type Literal = Static<typeof literalSchema>;
|
|
11
|
-
export type Json = Literal | {
|
|
12
|
-
[key: string]: any;
|
|
13
|
-
} | any[];
|
|
14
|
-
export interface JsonSchema extends TSchema {
|
|
15
|
-
[Kind]: 'Union';
|
|
16
|
-
static: Json;
|
|
17
|
-
anyOf: Json;
|
|
18
|
-
}
|
|
19
|
-
export interface BufferSchema extends TSchema {
|
|
20
|
-
[Kind]: 'Buffer';
|
|
21
|
-
static: Buffer;
|
|
22
|
-
type: 'buffer';
|
|
23
|
-
}
|
|
24
|
-
export interface BigIntStringModeSchema extends TSchema {
|
|
25
|
-
[Kind]: 'BigIntStringMode';
|
|
26
|
-
static: string;
|
|
27
|
-
type: 'string';
|
|
28
|
-
}
|
|
29
|
-
export type IsNever<T> = [T] extends [never] ? true : false;
|
|
30
|
-
export type IsEnumDefined<TEnum extends string[] | undefined> = [string, ...string[]] extends TEnum ? false : undefined extends TEnum ? false : true;
|
|
31
|
-
export type ColumnIsGeneratedAlwaysAs<TColumn> = TColumn extends Column ? TColumn['_']['identity'] extends 'always' ? true : TColumn['_'] extends {
|
|
32
|
-
generated: undefined;
|
|
33
|
-
} ? false : TColumn['_'] extends {
|
|
34
|
-
generated: {
|
|
35
|
-
type: 'byDefault';
|
|
36
|
-
};
|
|
37
|
-
} ? false : true : false;
|
|
38
|
-
export type GetSelection<T extends SelectedFieldsFlat<Column> | Table | View> = T extends Table ? T['_']['columns'] : T extends View ? T['_']['selectedFields'] : T;
|
|
39
|
-
export {};
|
package/utils.d.ts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import type { Kind, Static, TSchema } from '@sinclair/typebox';
|
|
2
|
-
import type { Column, SelectedFieldsFlat, Table, View } from 'drizzle-orm';
|
|
3
|
-
import type { PgEnum } from 'drizzle-orm/pg-core';
|
|
4
|
-
import type { literalSchema } from './column.js';
|
|
5
|
-
export declare function isColumnType<T extends Column>(column: Column, columnTypes: string[]): column is T;
|
|
6
|
-
export declare function isWithEnum(column: Column): column is typeof column & {
|
|
7
|
-
enumValues: [string, ...string[]];
|
|
8
|
-
};
|
|
9
|
-
export declare const isPgEnum: (entity: any) => entity is PgEnum<[string, ...string[]]>;
|
|
10
|
-
type Literal = Static<typeof literalSchema>;
|
|
11
|
-
export type Json = Literal | {
|
|
12
|
-
[key: string]: any;
|
|
13
|
-
} | any[];
|
|
14
|
-
export interface JsonSchema extends TSchema {
|
|
15
|
-
[Kind]: 'Union';
|
|
16
|
-
static: Json;
|
|
17
|
-
anyOf: Json;
|
|
18
|
-
}
|
|
19
|
-
export interface BufferSchema extends TSchema {
|
|
20
|
-
[Kind]: 'Buffer';
|
|
21
|
-
static: Buffer;
|
|
22
|
-
type: 'buffer';
|
|
23
|
-
}
|
|
24
|
-
export interface BigIntStringModeSchema extends TSchema {
|
|
25
|
-
[Kind]: 'BigIntStringMode';
|
|
26
|
-
static: string;
|
|
27
|
-
type: 'string';
|
|
28
|
-
}
|
|
29
|
-
export type IsNever<T> = [T] extends [never] ? true : false;
|
|
30
|
-
export type IsEnumDefined<TEnum extends string[] | undefined> = [string, ...string[]] extends TEnum ? false : undefined extends TEnum ? false : true;
|
|
31
|
-
export type ColumnIsGeneratedAlwaysAs<TColumn> = TColumn extends Column ? TColumn['_']['identity'] extends 'always' ? true : TColumn['_'] extends {
|
|
32
|
-
generated: undefined;
|
|
33
|
-
} ? false : TColumn['_'] extends {
|
|
34
|
-
generated: {
|
|
35
|
-
type: 'byDefault';
|
|
36
|
-
};
|
|
37
|
-
} ? false : true : false;
|
|
38
|
-
export type GetSelection<T extends SelectedFieldsFlat<Column> | Table | View> = T extends Table ? T['_']['columns'] : T extends View ? T['_']['selectedFields'] : T;
|
|
39
|
-
export {};
|