@mrnafisia/type-query 1.0.4 → 1.0.7

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.
@@ -1,20 +1,19 @@
1
- import { Param } from './entity';
2
- import type { Result } from 'never-catch';
3
- import type { Pool as PgPool, PoolClient, ClientBase } from 'pg';
4
- declare type TransactionIsolationLevel = 'read-uncommitted' | 'read-committed' | 'repeatable-read' | 'serializable';
5
- declare type Pool = {
6
- $: PgPool;
7
- transaction: (callback: (client: PoolClient) => Promise<Result<any, any>>, isolationLevel?: TransactionIsolationLevel) => Promise<void>;
8
- };
9
- declare type OnSendQueryHook = (query: string, params: Param[]) => void;
10
- declare type AddHook = (hookAndEvent: {
11
- event: 'on-send-query';
12
- hook: OnSendQueryHook;
13
- }) => void;
14
- declare type RemoveHook = (hookAndEvent: {
15
- event: 'on-send-query';
16
- hook: OnSendQueryHook;
17
- }) => void;
18
- export type { TransactionIsolationLevel, Pool, OnSendQueryHook, AddHook, RemoveHook };
19
- export type { PoolClient, ClientBase };
1
+ import { Param } from './entity';
2
+ import type { Result } from 'never-catch';
3
+ import type { Pool as PgPool, PoolClient } from 'pg';
4
+ declare type TransactionIsolationLevel = 'read-uncommitted' | 'read-committed' | 'repeatable-read' | 'serializable';
5
+ declare type Pool = {
6
+ $: PgPool;
7
+ transaction: (callback: (client: PoolClient) => Promise<Result<any, any>>, isolationLevel?: TransactionIsolationLevel) => Promise<void>;
8
+ };
9
+ declare type OnSendQueryHook = (query: string, params: Param[]) => void;
10
+ declare type AddHook = (hookAndEvent: {
11
+ event: 'on-send-query';
12
+ hook: OnSendQueryHook;
13
+ }) => void;
14
+ declare type RemoveHook = (hookAndEvent: {
15
+ event: 'on-send-query';
16
+ hook: OnSendQueryHook;
17
+ }) => void;
18
+ export type { TransactionIsolationLevel, Pool, OnSendQueryHook, AddHook, RemoveHook };
20
19
  //# sourceMappingURL=pool.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pool.d.ts","sourceRoot":"","sources":["../../src/types/pool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,UAAU,CAAC;AAC/B,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AACxC,OAAO,KAAK,EAAC,IAAI,IAAI,MAAM,EAAE,UAAU,EAAE,UAAU,EAAC,MAAM,IAAI,CAAC;AAE/D,aAAK,yBAAyB,GAAG,kBAAkB,GAAG,gBAAgB,GAAG,iBAAiB,GAAG,cAAc,CAAC;AAE5G,aAAK,IAAI,GAAG;IACR,CAAC,EAAE,MAAM,CAAC;IACV,WAAW,EAAE,CACT,QAAQ,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,EAC3D,cAAc,CAAC,EAAE,yBAAyB,KACzC,OAAO,CAAC,IAAI,CAAC,CAAC;CACtB,CAAC;AAEF,aAAK,eAAe,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,IAAI,CAAC;AAChE,aAAK,OAAO,GAAG,CAAC,YAAY,EAAE;IAAE,KAAK,EAAE,eAAe,CAAC;IAAC,IAAI,EAAE,eAAe,CAAA;CAAE,KAAK,IAAI,CAAC;AACzF,aAAK,UAAU,GAAG,CAAC,YAAY,EAAE;IAAE,KAAK,EAAE,eAAe,CAAC;IAAC,IAAI,EAAE,eAAe,CAAA;CAAE,KAAK,IAAI,CAAC;AAE5F,YAAY,EACR,yBAAyB,EACzB,IAAI,EACJ,eAAe,EACf,OAAO,EACP,UAAU,EACb,CAAC;AACF,YAAW,EACP,UAAU,EACV,UAAU,EACb,CAAC"}
1
+ {"version":3,"file":"pool.d.ts","sourceRoot":"","sources":["../../src/types/pool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,UAAU,CAAC;AAC/B,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AACxC,OAAO,KAAK,EAAC,IAAI,IAAI,MAAM,EAAE,UAAU,EAAC,MAAM,IAAI,CAAC;AAEnD,aAAK,yBAAyB,GAAG,kBAAkB,GAAG,gBAAgB,GAAG,iBAAiB,GAAG,cAAc,CAAC;AAE5G,aAAK,IAAI,GAAG;IACR,CAAC,EAAE,MAAM,CAAC;IACV,WAAW,EAAE,CACT,QAAQ,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,EAC3D,cAAc,CAAC,EAAE,yBAAyB,KACzC,OAAO,CAAC,IAAI,CAAC,CAAC;CACtB,CAAC;AAEF,aAAK,eAAe,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,IAAI,CAAC;AAChE,aAAK,OAAO,GAAG,CAAC,YAAY,EAAE;IAAE,KAAK,EAAE,eAAe,CAAC;IAAC,IAAI,EAAE,eAAe,CAAA;CAAE,KAAK,IAAI,CAAC;AACzF,aAAK,UAAU,GAAG,CAAC,YAAY,EAAE;IAAE,KAAK,EAAE,eAAe,CAAC;IAAC,IAAI,EAAE,eAAe,CAAA;CAAE,KAAK,IAAI,CAAC;AAE5F,YAAY,EACR,yBAAyB,EACzB,IAAI,EACJ,eAAe,EACf,OAAO,EACP,UAAU,EACb,CAAC"}
@@ -1,3 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //# sourceMappingURL=pool.js.map
@@ -1,10 +1,10 @@
1
- import Decimal from 'decimal.js';
2
- import type Table from './table';
3
- import type { JSON } from './json';
4
- declare type OrderDirection = 'asc' | 'desc';
5
- declare type PostgresType = 'boolean' | 'smallint' | 'integer' | 'bigint' | 'real' | 'double precision' | 'numeric' | 'character' | 'character varying' | 'text' | 'uuid' | 'time without time zone' | 'time with time zone' | 'date' | 'timestamp without time zone' | 'timestamp with time zone' | 'json' | 'jsonb';
6
- declare type PostgresTypeMapper<Type extends PostgresType, Nullable extends boolean> = Type extends 'boolean' ? (true extends Nullable ? null : never) | boolean : Type extends ('smallint' | 'integer' | 'real' | 'double precision') ? (true extends Nullable ? null : never) | number : Type extends 'bigint' ? (true extends Nullable ? null : never) | bigint : Type extends 'numeric' ? (true extends Nullable ? null : never) | Decimal : Type extends ('character' | 'character varying' | 'text' | 'uuid') ? (true extends Nullable ? null : never) | string : Type extends ('time without time zone' | 'time with time zone' | 'date' | 'timestamp without time zone' | 'timestamp with time zone') ? (true extends Nullable ? null : never) | Date : Type extends ('json' | 'jsonb') ? (true extends Nullable ? null : never) | JSON : never;
7
- declare type ColumnTypeByColumns<Columns extends Table['columns'], columnKey extends keyof Columns> = PostgresTypeMapper<Columns[columnKey]['type'], Columns[columnKey]['nullable']>;
8
- declare type ColumnTypeByTable<T extends Table, columnKey extends keyof T['columns']> = PostgresTypeMapper<T['columns'][columnKey]['type'], T['columns'][columnKey]['nullable']>;
9
- export type { OrderDirection, PostgresType, PostgresTypeMapper, ColumnTypeByColumns, ColumnTypeByTable };
1
+ import Decimal from 'decimal.js';
2
+ import type Table from './table';
3
+ import type { JSON } from './json';
4
+ declare type OrderDirection = 'asc' | 'desc';
5
+ declare type PostgresType = 'boolean' | 'smallint' | 'integer' | 'bigint' | 'real' | 'double precision' | 'numeric' | 'character' | 'character varying' | 'text' | 'uuid' | 'time without time zone' | 'time with time zone' | 'date' | 'timestamp without time zone' | 'timestamp with time zone' | 'json' | 'jsonb';
6
+ declare type PostgresTypeMapper<Type extends PostgresType, Nullable extends boolean> = Type extends 'boolean' ? (true extends Nullable ? null : never) | boolean : Type extends ('smallint' | 'integer' | 'real' | 'double precision') ? (true extends Nullable ? null : never) | number : Type extends 'bigint' ? (true extends Nullable ? null : never) | bigint : Type extends 'numeric' ? (true extends Nullable ? null : never) | Decimal : Type extends ('character' | 'character varying' | 'text' | 'uuid') ? (true extends Nullable ? null : never) | string : Type extends ('time without time zone' | 'time with time zone' | 'date' | 'timestamp without time zone' | 'timestamp with time zone') ? (true extends Nullable ? null : never) | Date : Type extends ('json' | 'jsonb') ? (true extends Nullable ? null : never) | JSON : never;
7
+ declare type ColumnTypeByColumns<Columns extends Table['columns'], columnKey extends keyof Columns> = PostgresTypeMapper<Columns[columnKey]['type'], Columns[columnKey]['nullable']>;
8
+ declare type ColumnTypeByTable<T extends Table, columnKey extends keyof T['columns']> = PostgresTypeMapper<T['columns'][columnKey]['type'], T['columns'][columnKey]['nullable']>;
9
+ export type { OrderDirection, PostgresType, PostgresTypeMapper, ColumnTypeByColumns, ColumnTypeByTable };
10
10
  //# sourceMappingURL=postgres.d.ts.map
@@ -1,3 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //# sourceMappingURL=postgres.js.map
@@ -1,238 +1,238 @@
1
- import Decimal from 'decimal.js';
2
- import type { JSON } from './json';
3
- import { PostgresType } from './postgres';
4
- declare type ReferenceActions = 'no-action' | 'restrict' | 'set-null' | 'set-Default' | 'cascade';
5
- declare type Base = {
6
- type: PostgresType;
7
- default: boolean | 'value' | 'auto-increment' | 'created-at' | 'updated-at';
8
- nullable: boolean;
9
- title?: string;
10
- reference?: {
11
- table: Table;
12
- onUpdate?: ReferenceActions;
13
- onDelete?: ReferenceActions;
14
- column: string;
15
- };
16
- };
17
- declare type Primary = {
18
- primary?: true;
19
- nullable: false;
20
- } | {
21
- nullable: true;
22
- };
23
- declare type Types = {
24
- type: 'boolean' | 'smallint' | 'integer' | 'bigint' | 'real' | 'double precision' | 'text' | 'uuid' | 'date' | 'json' | 'jsonb';
25
- } | {
26
- type: 'numeric';
27
- precision: number;
28
- scale: number;
29
- } | {
30
- type: 'character' | 'character varying';
31
- length?: number;
32
- } | {
33
- type: 'time without time zone' | 'time with time zone' | 'timestamp without time zone' | 'timestamp with time zone';
34
- length?: number;
35
- };
36
- declare type ReferenceCheck<T extends Table, C extends keyof T['columns']> = {
37
- type: 'boolean';
38
- reference?: {
39
- table: T;
40
- onUpdate?: ReferenceActions;
41
- onDelete?: ReferenceActions;
42
- column: T['columns'][C]['type'] extends 'boolean' ? C : never;
43
- };
44
- } | {
45
- type: 'smallint';
46
- reference?: {
47
- table: T;
48
- onUpdate?: ReferenceActions;
49
- onDelete?: ReferenceActions;
50
- column: T['columns'][C]['type'] extends 'smallint' ? C : never;
51
- };
52
- } | {
53
- type: 'integer';
54
- reference?: {
55
- table: T;
56
- onUpdate?: ReferenceActions;
57
- onDelete?: ReferenceActions;
58
- column: T['columns'][C]['type'] extends 'smallint' | 'integer' ? C : never;
59
- };
60
- } | {
61
- type: 'bigint';
62
- reference?: {
63
- table: T;
64
- onUpdate?: ReferenceActions;
65
- onDelete?: ReferenceActions;
66
- column: T['columns'][C]['type'] extends 'smallint' | 'integer' | 'bigint' ? C : never;
67
- };
68
- } | {
69
- type: 'real';
70
- reference?: {
71
- table: T;
72
- onUpdate?: ReferenceActions;
73
- onDelete?: ReferenceActions;
74
- column: T['columns'][C]['type'] extends 'real' ? C : never;
75
- };
76
- } | {
77
- type: 'double precision';
78
- reference?: {
79
- table: T;
80
- onUpdate?: ReferenceActions;
81
- onDelete?: ReferenceActions;
82
- column: T['columns'][C]['type'] extends 'double precision' ? C : never;
83
- };
84
- } | {
85
- type: 'text';
86
- reference?: {
87
- table: T;
88
- onUpdate?: ReferenceActions;
89
- onDelete?: ReferenceActions;
90
- column: T['columns'][C]['type'] extends 'text' ? C : never;
91
- };
92
- } | {
93
- type: 'uuid';
94
- reference?: {
95
- table: T;
96
- onUpdate?: ReferenceActions;
97
- onDelete?: ReferenceActions;
98
- column: T['columns'][C]['type'] extends 'uuid' ? C : never;
99
- };
100
- } | {
101
- type: 'date';
102
- reference?: {
103
- table: T;
104
- onUpdate?: ReferenceActions;
105
- onDelete?: ReferenceActions;
106
- column: T['columns'][C]['type'] extends 'date' ? C : never;
107
- };
108
- } | {
109
- type: 'json';
110
- reference?: {
111
- table: T;
112
- onUpdate?: ReferenceActions;
113
- onDelete?: ReferenceActions;
114
- column: T['columns'][C]['type'] extends 'json' ? C : never;
115
- };
116
- } | {
117
- type: 'jsonb';
118
- reference?: {
119
- table: T;
120
- onUpdate?: ReferenceActions;
121
- onDelete?: ReferenceActions;
122
- column: T['columns'][C]['type'] extends 'jsonb' ? C : never;
123
- };
124
- } | {
125
- type: 'numeric';
126
- reference?: {
127
- table: T;
128
- onUpdate?: ReferenceActions;
129
- onDelete?: ReferenceActions;
130
- column: T['columns'][C]['type'] extends 'numeric' ? C : never;
131
- };
132
- } | {
133
- type: 'character';
134
- reference?: {
135
- table: T;
136
- onUpdate?: ReferenceActions;
137
- onDelete?: ReferenceActions;
138
- column: T['columns'][C]['type'] extends 'character' ? C : never;
139
- };
140
- } | {
141
- type: 'character varying';
142
- reference?: {
143
- table: T;
144
- onUpdate?: ReferenceActions;
145
- onDelete?: ReferenceActions;
146
- column: T['columns'][C]['type'] extends 'character varying' ? C : never;
147
- };
148
- } | {
149
- type: 'time without time zone';
150
- reference?: {
151
- table: T;
152
- onUpdate?: ReferenceActions;
153
- onDelete?: ReferenceActions;
154
- column: T['columns'][C]['type'] extends 'time without time zone' ? C : never;
155
- };
156
- } | {
157
- type: 'time with time zone';
158
- reference?: {
159
- table: T;
160
- onUpdate?: ReferenceActions;
161
- onDelete?: ReferenceActions;
162
- column: T['columns'][C]['type'] extends 'time with time zone' ? C : never;
163
- };
164
- } | {
165
- type: 'timestamp without time zone';
166
- reference?: {
167
- table: T;
168
- onUpdate?: ReferenceActions;
169
- onDelete?: ReferenceActions;
170
- column: T['columns'][C]['type'] extends 'timestamp without time zone' ? C : never;
171
- };
172
- } | {
173
- type: 'timestamp with time zone';
174
- reference?: {
175
- table: T;
176
- onUpdate?: ReferenceActions;
177
- onDelete?: ReferenceActions;
178
- column: T['columns'][C]['type'] extends 'timestamp with time zone' ? C : never;
179
- };
180
- };
181
- declare type Default = {
182
- default: false;
183
- } | {
184
- default: true;
185
- value: string;
186
- } | {
187
- default: 'auto-increment';
188
- type: 'smallint' | 'integer' | 'bigint';
189
- seqTitle?: string;
190
- } | {
191
- default: 'created-at' | 'updated-at';
192
- type: 'time without time zone' | 'time with time zone' | 'timestamp without time zone' | 'timestamp with time zone';
193
- } | ({
194
- default: 'value';
195
- type: 'boolean';
196
- value: boolean;
197
- } | {
198
- default: 'value';
199
- type: 'smallint' | 'integer' | 'real' | 'double precision';
200
- value: number;
201
- } | {
202
- default: 'value';
203
- type: 'bigint';
204
- value: bigint;
205
- } | {
206
- default: 'value';
207
- type: 'numeric';
208
- value: Decimal;
209
- } | {
210
- default: 'value';
211
- type: 'character' | 'character varying' | 'text' | 'uuid';
212
- value: string;
213
- } | {
214
- default: 'value';
215
- type: 'time without time zone' | 'time with time zone' | 'date' | 'timestamp without time zone' | 'timestamp with time zone';
216
- value: Date;
217
- } | {
218
- default: 'value';
219
- type: 'json' | 'jsonb';
220
- value: JSON;
221
- });
222
- declare type Table = {
223
- schema: string;
224
- title: string;
225
- columns: {
226
- [key: string]: Base & Primary & Types & Default;
227
- };
228
- };
229
- declare type TableCheck = {
230
- schema: string;
231
- title: string;
232
- columns: {
233
- [key: string]: Base & Primary & Types & Default & ReferenceCheck<Table, keyof Table['columns']>;
234
- };
235
- };
236
- export default Table;
237
- export type { ReferenceActions, TableCheck };
1
+ import Decimal from 'decimal.js';
2
+ import type { JSON } from './json';
3
+ import { PostgresType } from './postgres';
4
+ declare type ReferenceActions = 'no-action' | 'restrict' | 'set-null' | 'set-Default' | 'cascade';
5
+ declare type Base = {
6
+ type: PostgresType;
7
+ default: boolean | 'value' | 'auto-increment' | 'created-at' | 'updated-at';
8
+ nullable: boolean;
9
+ title?: string;
10
+ reference?: {
11
+ table: Table;
12
+ onUpdate?: ReferenceActions;
13
+ onDelete?: ReferenceActions;
14
+ column: string;
15
+ };
16
+ };
17
+ declare type Primary = {
18
+ primary?: true;
19
+ nullable: false;
20
+ } | {
21
+ nullable: true;
22
+ };
23
+ declare type Types = {
24
+ type: 'boolean' | 'smallint' | 'integer' | 'bigint' | 'real' | 'double precision' | 'text' | 'uuid' | 'date' | 'json' | 'jsonb';
25
+ } | {
26
+ type: 'numeric';
27
+ precision: number;
28
+ scale: number;
29
+ } | {
30
+ type: 'character' | 'character varying';
31
+ length?: number;
32
+ } | {
33
+ type: 'time without time zone' | 'time with time zone' | 'timestamp without time zone' | 'timestamp with time zone';
34
+ length?: number;
35
+ };
36
+ declare type ReferenceCheck<T extends Table, C extends keyof T['columns']> = {
37
+ type: 'boolean';
38
+ reference?: {
39
+ table: T;
40
+ onUpdate?: ReferenceActions;
41
+ onDelete?: ReferenceActions;
42
+ column: T['columns'][C]['type'] extends 'boolean' ? C : never;
43
+ };
44
+ } | {
45
+ type: 'smallint';
46
+ reference?: {
47
+ table: T;
48
+ onUpdate?: ReferenceActions;
49
+ onDelete?: ReferenceActions;
50
+ column: T['columns'][C]['type'] extends 'smallint' ? C : never;
51
+ };
52
+ } | {
53
+ type: 'integer';
54
+ reference?: {
55
+ table: T;
56
+ onUpdate?: ReferenceActions;
57
+ onDelete?: ReferenceActions;
58
+ column: T['columns'][C]['type'] extends 'smallint' | 'integer' ? C : never;
59
+ };
60
+ } | {
61
+ type: 'bigint';
62
+ reference?: {
63
+ table: T;
64
+ onUpdate?: ReferenceActions;
65
+ onDelete?: ReferenceActions;
66
+ column: T['columns'][C]['type'] extends 'smallint' | 'integer' | 'bigint' ? C : never;
67
+ };
68
+ } | {
69
+ type: 'real';
70
+ reference?: {
71
+ table: T;
72
+ onUpdate?: ReferenceActions;
73
+ onDelete?: ReferenceActions;
74
+ column: T['columns'][C]['type'] extends 'real' ? C : never;
75
+ };
76
+ } | {
77
+ type: 'double precision';
78
+ reference?: {
79
+ table: T;
80
+ onUpdate?: ReferenceActions;
81
+ onDelete?: ReferenceActions;
82
+ column: T['columns'][C]['type'] extends 'double precision' ? C : never;
83
+ };
84
+ } | {
85
+ type: 'text';
86
+ reference?: {
87
+ table: T;
88
+ onUpdate?: ReferenceActions;
89
+ onDelete?: ReferenceActions;
90
+ column: T['columns'][C]['type'] extends 'text' ? C : never;
91
+ };
92
+ } | {
93
+ type: 'uuid';
94
+ reference?: {
95
+ table: T;
96
+ onUpdate?: ReferenceActions;
97
+ onDelete?: ReferenceActions;
98
+ column: T['columns'][C]['type'] extends 'uuid' ? C : never;
99
+ };
100
+ } | {
101
+ type: 'date';
102
+ reference?: {
103
+ table: T;
104
+ onUpdate?: ReferenceActions;
105
+ onDelete?: ReferenceActions;
106
+ column: T['columns'][C]['type'] extends 'date' ? C : never;
107
+ };
108
+ } | {
109
+ type: 'json';
110
+ reference?: {
111
+ table: T;
112
+ onUpdate?: ReferenceActions;
113
+ onDelete?: ReferenceActions;
114
+ column: T['columns'][C]['type'] extends 'json' ? C : never;
115
+ };
116
+ } | {
117
+ type: 'jsonb';
118
+ reference?: {
119
+ table: T;
120
+ onUpdate?: ReferenceActions;
121
+ onDelete?: ReferenceActions;
122
+ column: T['columns'][C]['type'] extends 'jsonb' ? C : never;
123
+ };
124
+ } | {
125
+ type: 'numeric';
126
+ reference?: {
127
+ table: T;
128
+ onUpdate?: ReferenceActions;
129
+ onDelete?: ReferenceActions;
130
+ column: T['columns'][C]['type'] extends 'numeric' ? C : never;
131
+ };
132
+ } | {
133
+ type: 'character';
134
+ reference?: {
135
+ table: T;
136
+ onUpdate?: ReferenceActions;
137
+ onDelete?: ReferenceActions;
138
+ column: T['columns'][C]['type'] extends 'character' ? C : never;
139
+ };
140
+ } | {
141
+ type: 'character varying';
142
+ reference?: {
143
+ table: T;
144
+ onUpdate?: ReferenceActions;
145
+ onDelete?: ReferenceActions;
146
+ column: T['columns'][C]['type'] extends 'character varying' ? C : never;
147
+ };
148
+ } | {
149
+ type: 'time without time zone';
150
+ reference?: {
151
+ table: T;
152
+ onUpdate?: ReferenceActions;
153
+ onDelete?: ReferenceActions;
154
+ column: T['columns'][C]['type'] extends 'time without time zone' ? C : never;
155
+ };
156
+ } | {
157
+ type: 'time with time zone';
158
+ reference?: {
159
+ table: T;
160
+ onUpdate?: ReferenceActions;
161
+ onDelete?: ReferenceActions;
162
+ column: T['columns'][C]['type'] extends 'time with time zone' ? C : never;
163
+ };
164
+ } | {
165
+ type: 'timestamp without time zone';
166
+ reference?: {
167
+ table: T;
168
+ onUpdate?: ReferenceActions;
169
+ onDelete?: ReferenceActions;
170
+ column: T['columns'][C]['type'] extends 'timestamp without time zone' ? C : never;
171
+ };
172
+ } | {
173
+ type: 'timestamp with time zone';
174
+ reference?: {
175
+ table: T;
176
+ onUpdate?: ReferenceActions;
177
+ onDelete?: ReferenceActions;
178
+ column: T['columns'][C]['type'] extends 'timestamp with time zone' ? C : never;
179
+ };
180
+ };
181
+ declare type Default = {
182
+ default: false;
183
+ } | {
184
+ default: true;
185
+ value: string;
186
+ } | {
187
+ default: 'auto-increment';
188
+ type: 'smallint' | 'integer' | 'bigint';
189
+ seqTitle?: string;
190
+ } | {
191
+ default: 'created-at' | 'updated-at';
192
+ type: 'time without time zone' | 'time with time zone' | 'timestamp without time zone' | 'timestamp with time zone';
193
+ } | ({
194
+ default: 'value';
195
+ type: 'boolean';
196
+ value: boolean;
197
+ } | {
198
+ default: 'value';
199
+ type: 'smallint' | 'integer' | 'real' | 'double precision';
200
+ value: number;
201
+ } | {
202
+ default: 'value';
203
+ type: 'bigint';
204
+ value: bigint;
205
+ } | {
206
+ default: 'value';
207
+ type: 'numeric';
208
+ value: Decimal;
209
+ } | {
210
+ default: 'value';
211
+ type: 'character' | 'character varying' | 'text' | 'uuid';
212
+ value: string;
213
+ } | {
214
+ default: 'value';
215
+ type: 'time without time zone' | 'time with time zone' | 'date' | 'timestamp without time zone' | 'timestamp with time zone';
216
+ value: Date;
217
+ } | {
218
+ default: 'value';
219
+ type: 'json' | 'jsonb';
220
+ value: JSON;
221
+ });
222
+ declare type Table = {
223
+ schema: string;
224
+ title: string;
225
+ columns: {
226
+ [key: string]: Base & Primary & Types & Default;
227
+ };
228
+ };
229
+ declare type TableCheck = {
230
+ schema: string;
231
+ title: string;
232
+ columns: {
233
+ [key: string]: Base & Primary & Types & Default & ReferenceCheck<Table, keyof Table['columns']>;
234
+ };
235
+ };
236
+ export default Table;
237
+ export type { ReferenceActions, TableCheck };
238
238
  //# sourceMappingURL=table.d.ts.map
@@ -1,3 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //# sourceMappingURL=table.js.map