@mrnafisia/type-query 1.0.5 → 1.0.8

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.
@@ -0,0 +1,11 @@
1
+ import { Pool } from './types/pool';
2
+ import { Result } from 'never-catch';
3
+ declare type UserID = number;
4
+ declare const setTestDBInfo: (connectionUrl: string, name?: string) => void;
5
+ declare const getTestPool: () => Promise<Result<{
6
+ id: UserID;
7
+ pool: Pool;
8
+ }, any>>;
9
+ declare const releaseTestPool: (id: number, rollback?: boolean) => Promise<void>;
10
+ export { setTestDBInfo, getTestPool, releaseTestPool };
11
+ //# sourceMappingURL=testPool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testPool.d.ts","sourceRoot":"","sources":["../src/testPool.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,IAAI,EAAC,MAAM,cAAc,CAAC;AAGlC,OAAO,EAAU,MAAM,EAAC,MAAM,aAAa,CAAC;AAE5C,aAAK,MAAM,GAAG,MAAM,CAAC;AAUrB,QAAA,MAAM,aAAa,kBAAmB,MAAM,SAAS,MAAM,SAU1D,CAAC;AAEF,QAAA,MAAM,WAAW,QAAa,QAAQ,OAAO;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAAE,EAAE,GAAG,CAAC,CAqB5E,CAAC;AAEF,QAAA,MAAM,eAAe,OAAc,MAAM,aAAY,OAAO,kBAsC3D,CAAC;AAsDF,OAAO,EACH,aAAa,EACb,WAAW,EACX,eAAe,EAClB,CAAC"}
@@ -0,0 +1,249 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
+ return new (P || (P = Promise))(function (resolve, reject) {
16
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
17
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
18
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
19
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
20
+ });
21
+ };
22
+ var __generator = (this && this.__generator) || function (thisArg, body) {
23
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
24
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
+ function verb(n) { return function (v) { return step([n, v]); }; }
26
+ function step(op) {
27
+ if (f) throw new TypeError("Generator is already executing.");
28
+ while (_) try {
29
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
+ if (y = 0, t) op = [op[0] & 2, t.value];
31
+ switch (op[0]) {
32
+ case 0: case 1: t = op; break;
33
+ case 4: _.label++; return { value: op[1], done: false };
34
+ case 5: _.label++; y = op[1]; op = [0]; continue;
35
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
36
+ default:
37
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
38
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
39
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
40
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
41
+ if (t[2]) _.ops.pop();
42
+ _.trys.pop(); continue;
43
+ }
44
+ op = body.call(thisArg, _);
45
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
46
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
47
+ }
48
+ };
49
+ var __importDefault = (this && this.__importDefault) || function (mod) {
50
+ return (mod && mod.__esModule) ? mod : { "default": mod };
51
+ };
52
+ Object.defineProperty(exports, "__esModule", { value: true });
53
+ exports.releaseTestPool = exports.getTestPool = exports.setTestDBInfo = void 0;
54
+ var pg_1 = require("pg");
55
+ var error_1 = __importDefault(require("./error"));
56
+ var pool_1 = require("./pool");
57
+ var never_catch_1 = require("never-catch");
58
+ var testDBInfo;
59
+ var db = { state: 'uninitialized' };
60
+ var usersIndex = 0;
61
+ var keepDb = false;
62
+ var setTestDBInfo = function (connectionUrl, name) {
63
+ testDBInfo = { connectionUrl: connectionUrl, name: name };
64
+ keepDb = evalKeepDb();
65
+ (0, pool_1.addHook)({
66
+ event: 'on-send-query',
67
+ hook: function (query, params) {
68
+ console.log('\x1b[36m' + "Query: ".concat(query));
69
+ console.log("Parameters: ".concat(JSON.stringify(params)) + '\x1b[0m' + '\n');
70
+ }
71
+ });
72
+ };
73
+ exports.setTestDBInfo = setTestDBInfo;
74
+ var getTestPool = function () { return __awaiter(void 0, void 0, void 0, function () {
75
+ var constructResult;
76
+ return __generator(this, function (_a) {
77
+ switch (_a.label) {
78
+ case 0:
79
+ if (testDBInfo === undefined) {
80
+ throw 'test db info did not set!';
81
+ }
82
+ if (!(db.state === 'uninitialized')) return [3 /*break*/, 2];
83
+ db = { state: 'constructing' };
84
+ return [4 /*yield*/, constructTestPool()];
85
+ case 1:
86
+ constructResult = _a.sent();
87
+ if (!constructResult.ok) {
88
+ return [2 /*return*/, constructResult];
89
+ }
90
+ db = __assign(__assign({}, constructResult.value), { state: 'ready', userIDs: [] });
91
+ _a.label = 2;
92
+ case 2:
93
+ if (db.state === 'ready') {
94
+ db.userIDs.push(++usersIndex);
95
+ return [2 /*return*/, (0, never_catch_1.ok)({ id: usersIndex, pool: db.pool })];
96
+ }
97
+ return [2 /*return*/, new Promise(function (resolve) {
98
+ setTimeout(function () {
99
+ resolve(getTestPool());
100
+ }, 3000);
101
+ })];
102
+ }
103
+ });
104
+ }); };
105
+ exports.getTestPool = getTestPool;
106
+ var releaseTestPool = function (id, rollback) {
107
+ if (rollback === void 0) { rollback = true; }
108
+ return __awaiter(void 0, void 0, void 0, function () {
109
+ return __generator(this, function (_a) {
110
+ switch (_a.label) {
111
+ case 0:
112
+ if (testDBInfo === undefined) {
113
+ throw 'test db info did not set!';
114
+ }
115
+ if (db.state !== 'ready') {
116
+ throw 'db is not ready!';
117
+ }
118
+ if (!rollback) {
119
+ keepDb = true;
120
+ }
121
+ db.userIDs.splice(db.userIDs.indexOf(id), 1);
122
+ if (db.userIDs.length !== 0) {
123
+ return [2 /*return*/];
124
+ }
125
+ return [4 /*yield*/, (new Promise(function (resolve, reject) {
126
+ if (!(db.state === 'ready' && db.userIDs.length === 0)) {
127
+ resolve(undefined);
128
+ return;
129
+ }
130
+ setTimeout(function () { return __awaiter(void 0, void 0, void 0, function () {
131
+ var dbName, pool, destructingSucceed;
132
+ return __generator(this, function (_a) {
133
+ switch (_a.label) {
134
+ case 0:
135
+ if (!(db.state === 'ready' && db.userIDs.length === 0)) return [3 /*break*/, 4];
136
+ dbName = db.dbName;
137
+ pool = db.pool;
138
+ db = { state: 'destructing' };
139
+ return [4 /*yield*/, pool.$.end()];
140
+ case 1:
141
+ _a.sent();
142
+ if (!!keepDb) return [3 /*break*/, 3];
143
+ return [4 /*yield*/, dropDb(dbName)];
144
+ case 2:
145
+ destructingSucceed = _a.sent();
146
+ if (!destructingSucceed.ok) {
147
+ reject(destructingSucceed.error);
148
+ return [2 /*return*/];
149
+ }
150
+ _a.label = 3;
151
+ case 3:
152
+ db = { state: 'uninitialized' };
153
+ keepDb = evalKeepDb();
154
+ _a.label = 4;
155
+ case 4:
156
+ resolve(undefined);
157
+ return [2 /*return*/];
158
+ }
159
+ });
160
+ }); }, 5000);
161
+ }))];
162
+ case 1:
163
+ _a.sent();
164
+ return [2 /*return*/];
165
+ }
166
+ });
167
+ });
168
+ };
169
+ exports.releaseTestPool = releaseTestPool;
170
+ var constructTestPool = function () { return __awaiter(void 0, void 0, void 0, function () {
171
+ var dbName, tempClient, createDbResult, pool;
172
+ return __generator(this, function (_a) {
173
+ switch (_a.label) {
174
+ case 0:
175
+ if (!(testDBInfo.name === undefined)) return [3 /*break*/, 4];
176
+ tempClient = new pg_1.Client({
177
+ connectionString: testDBInfo.connectionUrl
178
+ });
179
+ return [4 /*yield*/, tempClient.connect()];
180
+ case 1:
181
+ _a.sent();
182
+ return [4 /*yield*/, createRandomNameDb(tempClient)];
183
+ case 2:
184
+ createDbResult = _a.sent();
185
+ return [4 /*yield*/, tempClient.end()];
186
+ case 3:
187
+ _a.sent();
188
+ if (!createDbResult.ok) {
189
+ return [2 /*return*/, createDbResult];
190
+ }
191
+ dbName = createDbResult.value;
192
+ return [3 /*break*/, 5];
193
+ case 4:
194
+ dbName = testDBInfo.name;
195
+ _a.label = 5;
196
+ case 5:
197
+ pool = (0, pool_1.createPool)(testDBInfo.connectionUrl + '/' + dbName);
198
+ return [2 /*return*/, (0, never_catch_1.ok)({ pool: pool, dbName: dbName })];
199
+ }
200
+ });
201
+ }); };
202
+ var createRandomNameDb = function (client) { return __awaiter(void 0, void 0, void 0, function () {
203
+ var dbName, result;
204
+ return __generator(this, function (_a) {
205
+ switch (_a.label) {
206
+ case 0:
207
+ dbName = 'test_db_' + new Date().toISOString().replace('T', '_').replaceAll(':', '-').substring(0, 19);
208
+ return [4 /*yield*/, client.query("CREATE DATABASE ".concat(dbName, ";"))
209
+ .then(function () { return (0, never_catch_1.ok)(dbName); })
210
+ .catch(function (error) { return (0, never_catch_1.err)(error); })];
211
+ case 1:
212
+ result = _a.sent();
213
+ if (!result.ok) {
214
+ switch (result.error.code) {
215
+ case error_1.default.DATABASE_ALREADY_EXISTS:
216
+ return [2 /*return*/, createRandomNameDb(client)];
217
+ default:
218
+ return [2 /*return*/, result];
219
+ }
220
+ }
221
+ return [2 /*return*/, result];
222
+ }
223
+ });
224
+ }); };
225
+ var dropDb = function (dbName) { return __awaiter(void 0, void 0, void 0, function () {
226
+ var tempClient, result;
227
+ return __generator(this, function (_a) {
228
+ switch (_a.label) {
229
+ case 0:
230
+ tempClient = new pg_1.Client({
231
+ connectionString: testDBInfo.connectionUrl
232
+ });
233
+ return [4 /*yield*/, tempClient.connect()];
234
+ case 1:
235
+ _a.sent();
236
+ return [4 /*yield*/, tempClient.query("DROP DATABASE ".concat(dbName, ";")).then(function () { return (0, never_catch_1.ok)(undefined); }).catch(function (error) { return (0, never_catch_1.err)(error); })];
237
+ case 2:
238
+ result = _a.sent();
239
+ return [4 /*yield*/, tempClient.end()];
240
+ case 3:
241
+ _a.sent();
242
+ return [2 /*return*/, result];
243
+ }
244
+ });
245
+ }); };
246
+ function evalKeepDb() {
247
+ return testDBInfo.name !== undefined;
248
+ }
249
+ //# sourceMappingURL=testPool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testPool.js","sourceRoot":"","sources":["../src/testPool.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yBAA0B;AAE1B,kDAAqC;AACrC,+BAA2C;AAC3C,2CAA4C;AAI5C,IAAI,UAA+D,CAAC;AACpE,IAAI,EAAE,GAG4B,EAAC,KAAK,EAAE,eAAe,EAAC,CAAC;AAC3D,IAAI,UAAU,GAAG,CAAC,CAAC;AACnB,IAAI,MAAM,GAAG,KAAK,CAAC;AAEnB,IAAM,aAAa,GAAG,UAAC,aAAqB,EAAE,IAAa;IACvD,UAAU,GAAG,EAAC,aAAa,eAAA,EAAE,IAAI,MAAA,EAAC,CAAC;IACnC,MAAM,GAAG,UAAU,EAAE,CAAC;IACtB,IAAA,cAAO,EAAC;QACJ,KAAK,EAAE,eAAe;QACtB,IAAI,EAAE,UAAC,K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AC,IAAI,KAAK,SAAS,CAAC;AACzC,CAAC"}
@@ -1,56 +1,56 @@
1
- import Decimal from 'decimal.js';
2
- import type Table from './table';
3
- import type { JSON } from './json';
4
- import type { ColumnTypeByColumns } from './postgres';
5
- import type { Expression, ValueExpression } from './entity';
6
- declare type Context<Columns extends Table['columns']> = {
7
- col: <columnKey extends keyof Columns & string>(column: columnKey, alias?: string) => ValueExpression<ColumnTypeByColumns<Columns, columnKey>>;
8
- colNull: <columnKey extends keyof Columns & string>(column: columnKey, op: null extends ColumnTypeByColumns<Columns, columnKey> ? NullOperator : never, alias?: string) => ValueExpression<boolean>;
9
- colBool: <columnKey extends keyof Columns & string>(column: columnKey, op: boolean extends ColumnTypeByColumns<Columns, columnKey> ? BooleanOperator : never, alias?: string) => ValueExpression<boolean>;
10
- colCmp: <columnKey extends keyof Columns & string>(column: columnKey, op: CompareOperatorCompatible<ColumnTypeByColumns<Columns, columnKey>, CompareOperator, never>, v: Expression<ColumnTypeByColumns<Columns, columnKey>>, alias?: string) => ValueExpression<boolean>;
11
- colList: <columnKey extends keyof Columns & string>(column: columnKey, op: ListOperatorCompatible<ColumnTypeByColumns<Columns, columnKey>, ListOperator, never>, v: Expression<ColumnTypeByColumns<Columns, columnKey>>[] | undefined, alias?: string) => ValueExpression<boolean>;
12
- colLike: <columnKey extends keyof Columns & string, Op extends (string extends ColumnTypeByColumns<Columns, columnKey> ? LikeOperator : never)>(column: columnKey, op: Op, v: Op extends 'like' ? Expression<ColumnTypeByColumns<Columns, columnKey>> : Expression<ColumnTypeByColumns<Columns, columnKey>>[] | undefined, alias?: string) => ValueExpression<boolean>;
13
- colJson: <columnKey extends keyof Columns & string, Op extends (JSON extends ColumnTypeByColumns<Columns, columnKey> ? JsonOperator : never)>(column: columnKey, op: Op, v: Op extends '@>' | '<@' ? Expression<ColumnTypeByColumns<Columns, columnKey>> : Op extends '?' ? Expression<string> : Op extends '?&' | '?|' ? Expression<string>[] | undefined : never, alias?: string) => ValueExpression<boolean>;
14
- colsAnd: ContextScope<Columns>;
15
- colsOr: ContextScope<Columns>;
16
- };
17
- declare type ContextScope<Columns extends Table['columns']> = (rules: {
18
- [columnKey in keyof Columns]?: [
19
- op: null extends ColumnTypeByColumns<Columns, columnKey> ? NullOperator : never
20
- ] | [
21
- op: ColumnTypeByColumns<Columns, columnKey> extends boolean ? BooleanOperator : never
22
- ] | [
23
- op: CompareOperatorCompatible<ColumnTypeByColumns<Columns, columnKey>, CompareOperator, never>,
24
- v: Expression<ColumnTypeByColumns<Columns, columnKey>>
25
- ] | [
26
- op: ListOperatorCompatible<ColumnTypeByColumns<Columns, columnKey>, ListOperator, never>,
27
- v: Expression<ColumnTypeByColumns<Columns, columnKey>>[] | undefined
28
- ] | [
29
- op: Extract<LikeOperator, 'like'>,
30
- v: ColumnTypeByColumns<Columns, columnKey> extends string ? Expression<ColumnTypeByColumns<Columns, columnKey>> : never
31
- ] | [
32
- op: Extract<LikeOperator, 'like some' | 'like all'>,
33
- v: ColumnTypeByColumns<Columns, columnKey> extends string ? Expression<ColumnTypeByColumns<Columns, columnKey>>[] | undefined : never
34
- ] | [
35
- op: Extract<JsonOperator, '@>' | '<@'>,
36
- v: ColumnTypeByColumns<Columns, columnKey> extends JSON ? Expression<ColumnTypeByColumns<Columns, columnKey>> : never
37
- ] | [
38
- op: Extract<JsonOperator, '?'>,
39
- v: ColumnTypeByColumns<Columns, columnKey> extends JSON ? Expression<string> : never
40
- ] | [
41
- op: Extract<JsonOperator, '?&' | '?|'>,
42
- v: ColumnTypeByColumns<Columns, columnKey> extends JSON ? Expression<string>[] | undefined : never
43
- ];
44
- }, alias?: string) => ValueExpression<boolean>;
45
- declare type CompareOperatorCompatible<T, True, False> = number extends T ? True : bigint extends T ? True : Decimal extends T ? True : string extends T ? True : Date extends T ? True : False;
46
- declare type ListOperatorCompatible<T, True, False> = number extends T ? True : bigint extends T ? True : Decimal extends T ? True : string extends T ? True : Date extends T ? True : False;
47
- declare type ArithmeticOperator = '+' | '-' | '*' | '/' | '**';
48
- declare type NullOperator = '= null' | '!= null';
49
- declare type BooleanOperator = '= true' | '= false';
50
- declare type CompareOperator = '=' | '!=' | '>' | '>=' | '<' | '<=';
51
- declare type ListOperator = 'in' | 'not in';
52
- declare type LikeOperator = 'like' | 'like all' | 'like some';
53
- declare type JsonOperator = '?' | '@>' | '<@' | '?|' | '?&';
54
- export type { Context, CompareOperatorCompatible, ListOperatorCompatible, ContextScope };
55
- export type { ArithmeticOperator, NullOperator, BooleanOperator, CompareOperator, ListOperator, LikeOperator, JsonOperator };
1
+ import Decimal from 'decimal.js';
2
+ import type Table from './table';
3
+ import type { JSON } from './json';
4
+ import type { ColumnTypeByColumns } from './postgres';
5
+ import type { Expression, ValueExpression } from './entity';
6
+ declare type Context<Columns extends Table['columns']> = {
7
+ col: <columnKey extends keyof Columns & string>(column: columnKey, alias?: string) => ValueExpression<ColumnTypeByColumns<Columns, columnKey>>;
8
+ colNull: <columnKey extends keyof Columns & string>(column: columnKey, op: null extends ColumnTypeByColumns<Columns, columnKey> ? NullOperator : never, alias?: string) => ValueExpression<boolean>;
9
+ colBool: <columnKey extends keyof Columns & string>(column: columnKey, op: boolean extends ColumnTypeByColumns<Columns, columnKey> ? BooleanOperator : never, alias?: string) => ValueExpression<boolean>;
10
+ colCmp: <columnKey extends keyof Columns & string>(column: columnKey, op: CompareOperatorCompatible<ColumnTypeByColumns<Columns, columnKey>, CompareOperator, never>, v: Expression<ColumnTypeByColumns<Columns, columnKey>>, alias?: string) => ValueExpression<boolean>;
11
+ colList: <columnKey extends keyof Columns & string>(column: columnKey, op: ListOperatorCompatible<ColumnTypeByColumns<Columns, columnKey>, ListOperator, never>, v: Expression<ColumnTypeByColumns<Columns, columnKey>>[] | undefined, alias?: string) => ValueExpression<boolean>;
12
+ colLike: <columnKey extends keyof Columns & string, Op extends (string extends ColumnTypeByColumns<Columns, columnKey> ? LikeOperator : never)>(column: columnKey, op: Op, v: Op extends 'like' ? Expression<ColumnTypeByColumns<Columns, columnKey>> : Expression<ColumnTypeByColumns<Columns, columnKey>>[] | undefined, alias?: string) => ValueExpression<boolean>;
13
+ colJson: <columnKey extends keyof Columns & string, Op extends (JSON extends ColumnTypeByColumns<Columns, columnKey> ? JsonOperator : never)>(column: columnKey, op: Op, v: Op extends '@>' | '<@' ? Expression<ColumnTypeByColumns<Columns, columnKey>> : Op extends '?' ? Expression<string> : Op extends '?&' | '?|' ? Expression<string>[] | undefined : never, alias?: string) => ValueExpression<boolean>;
14
+ colsAnd: ContextScope<Columns>;
15
+ colsOr: ContextScope<Columns>;
16
+ };
17
+ declare type ContextScope<Columns extends Table['columns']> = (rules: {
18
+ [columnKey in keyof Columns]?: [
19
+ op: null extends ColumnTypeByColumns<Columns, columnKey> ? NullOperator : never
20
+ ] | [
21
+ op: ColumnTypeByColumns<Columns, columnKey> extends boolean ? BooleanOperator : never
22
+ ] | [
23
+ op: CompareOperatorCompatible<ColumnTypeByColumns<Columns, columnKey>, CompareOperator, never>,
24
+ v: Expression<ColumnTypeByColumns<Columns, columnKey>>
25
+ ] | [
26
+ op: ListOperatorCompatible<ColumnTypeByColumns<Columns, columnKey>, ListOperator, never>,
27
+ v: Expression<ColumnTypeByColumns<Columns, columnKey>>[] | undefined
28
+ ] | [
29
+ op: Extract<LikeOperator, 'like'>,
30
+ v: ColumnTypeByColumns<Columns, columnKey> extends string ? Expression<ColumnTypeByColumns<Columns, columnKey>> : never
31
+ ] | [
32
+ op: Extract<LikeOperator, 'like some' | 'like all'>,
33
+ v: ColumnTypeByColumns<Columns, columnKey> extends string ? Expression<ColumnTypeByColumns<Columns, columnKey>>[] | undefined : never
34
+ ] | [
35
+ op: Extract<JsonOperator, '@>' | '<@'>,
36
+ v: ColumnTypeByColumns<Columns, columnKey> extends JSON ? Expression<ColumnTypeByColumns<Columns, columnKey>> : never
37
+ ] | [
38
+ op: Extract<JsonOperator, '?'>,
39
+ v: ColumnTypeByColumns<Columns, columnKey> extends JSON ? Expression<string> : never
40
+ ] | [
41
+ op: Extract<JsonOperator, '?&' | '?|'>,
42
+ v: ColumnTypeByColumns<Columns, columnKey> extends JSON ? Expression<string>[] | undefined : never
43
+ ];
44
+ }, alias?: string) => ValueExpression<boolean>;
45
+ declare type CompareOperatorCompatible<T, True, False> = number extends T ? True : bigint extends T ? True : Decimal extends T ? True : string extends T ? True : Date extends T ? True : False;
46
+ declare type ListOperatorCompatible<T, True, False> = number extends T ? True : bigint extends T ? True : Decimal extends T ? True : string extends T ? True : Date extends T ? True : False;
47
+ declare type ArithmeticOperator = '+' | '-' | '*' | '/' | '**';
48
+ declare type NullOperator = '= null' | '!= null';
49
+ declare type BooleanOperator = '= true' | '= false';
50
+ declare type CompareOperator = '=' | '!=' | '>' | '>=' | '<' | '<=';
51
+ declare type ListOperator = 'in' | 'not in';
52
+ declare type LikeOperator = 'like' | 'like all' | 'like some';
53
+ declare type JsonOperator = '?' | '@>' | '<@' | '?|' | '?&';
54
+ export type { Context, CompareOperatorCompatible, ListOperatorCompatible, ContextScope };
55
+ export type { ArithmeticOperator, NullOperator, BooleanOperator, CompareOperator, ListOperator, LikeOperator, JsonOperator };
56
56
  //# sourceMappingURL=context.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=context.js.map
@@ -1,68 +1,68 @@
1
- import { JSON } from './json';
2
- import Decimal from 'decimal.js';
3
- import type Table from './table';
4
- import { Context } from './context';
5
- import type { ClientBase } from 'pg';
6
- import type { Result } from 'never-catch';
7
- import type { ColumnTypeByColumns } from './postgres';
8
- declare type JoinType = 'inner' | 'left' | 'right' | 'full';
9
- declare type Param = number | bigint | string;
10
- declare type QueryData = {
11
- sql: string;
12
- params: Param[];
13
- };
14
- declare type TableData = {
15
- table: Table;
16
- alias: string;
17
- };
18
- declare type JoinData = {
19
- joinType: JoinType;
20
- on: Expression<boolean> | ((contexts: {
21
- [k: string]: Context<Table['columns']>;
22
- }) => Expression<boolean>);
23
- };
24
- declare type Mode = [] | ['count', number] | ['get', 'one' | number];
25
- declare type CustomColumn<Exp extends Expression<ExpressionTypes>, As extends string> = {
26
- exp: Exp;
27
- as: As;
28
- };
29
- declare type NullableAndDefaultColumns<Columns extends Table['columns']> = {
30
- [columnKey in keyof Columns as true extends Columns[columnKey]['nullable'] ? columnKey : false extends Columns[columnKey]['default'] ? never : columnKey]: true extends Columns[columnKey]['nullable'] ? Columns[columnKey] : false extends Columns[columnKey]['default'] ? never : Columns[columnKey];
31
- };
32
- declare type TablesColumnsKeys<Tables extends {
33
- [key: string]: Table;
34
- }> = {
35
- [tableKey in keyof Tables & string]: `${tableKey}_${keyof Tables[tableKey]['columns'] & string}`;
36
- }[keyof {
37
- [tableKey in keyof Tables & string]: undefined;
38
- }];
39
- declare type ExpressionTypes = null | boolean | number | bigint | Decimal | string | Date | JSON;
40
- declare type Expression<ExpType extends ExpressionTypes> = ExpType | undefined | ValueExpression<ExpType> | QueryExpression<ExpType>;
41
- declare type ValueExpression<ExpType extends ExpressionTypes> = ['val', ExpType | undefined];
42
- declare type QueryExpression<ExpType extends ExpressionTypes> = ['qry', ExpType];
43
- declare type InsertValue<Columns extends Table['columns'], NullableAndDefaultCols extends readonly (keyof NullableAndDefaultColumns<Columns>)[]> = {
44
- [columnKey in Exclude<keyof Columns, keyof NullableAndDefaultColumns<Columns>>]: Expression<ColumnTypeByColumns<Columns, columnKey>>;
45
- } & {
46
- [columnKey in Exclude<keyof NullableAndDefaultCols, keyof unknown[]> as NullableAndDefaultCols[columnKey] & string]?: Expression<ColumnTypeByColumns<Columns, NullableAndDefaultCols[columnKey] & string>>;
47
- };
48
- declare type UpdateSets<Columns extends Table['columns']> = {
49
- [columnKey in keyof Columns & string]?: Expression<ColumnTypeByColumns<Columns, columnKey>>;
50
- };
51
- declare type Query<Columns extends Table['columns'], Returning extends readonly (keyof Columns | CustomColumn<Expression<ExpressionTypes>, string>)[]> = {
52
- getData: (params?: Param[]) => Result<QueryData, string>;
53
- exec: <M extends Mode>(client: ClientBase, mode: M, params?: Param[]) => Promise<Result<QueryResult<Columns, Returning, M>, unknown>>;
54
- };
55
- declare type QueryResult<Columns extends Table['columns'], Returning extends readonly (keyof Columns | CustomColumn<Expression<ExpressionTypes>, string>)[], M extends Mode> = M extends ['get', 'one'] ? QueryResultRow<Columns, Returning> : M extends ['get', number] | [] ? QueryResultRow<Columns, Returning>[] : M extends ['count', number] ? boolean : never;
56
- declare type QueryResultRow<Columns extends Table['columns'], Returning extends readonly (keyof Columns | CustomColumn<Expression<ExpressionTypes>, string>)[]> = {
57
- [key in Exclude<keyof Returning, keyof unknown[]> as Returning[key] extends CustomColumn<Expression<ExpressionTypes>, infer As> ? As : Returning[key] & string]: Returning[key] extends CustomColumn<infer Exp, string> ? Exp extends Expression<infer ExpType> ? ExpType : Exp : ColumnTypeByColumns<Columns, Returning[key] & keyof Columns>;
58
- };
59
- declare type PartialQuery = {
60
- text: string;
61
- params: Param[];
62
- };
63
- export type { JoinType, Param, QueryData, TableData, JoinData, Mode };
64
- export type { CustomColumn, NullableAndDefaultColumns, TablesColumnsKeys };
65
- export type { ExpressionTypes, Expression, ValueExpression, QueryExpression };
66
- export type { InsertValue, UpdateSets };
67
- export type { Query, QueryResult, QueryResultRow, PartialQuery };
1
+ import { JSON } from './json';
2
+ import Decimal from 'decimal.js';
3
+ import type Table from './table';
4
+ import { Context } from './context';
5
+ import type { ClientBase } from 'pg';
6
+ import type { Result } from 'never-catch';
7
+ import type { ColumnTypeByColumns } from './postgres';
8
+ declare type JoinType = 'inner' | 'left' | 'right' | 'full';
9
+ declare type Param = number | bigint | string;
10
+ declare type QueryData = {
11
+ sql: string;
12
+ params: Param[];
13
+ };
14
+ declare type TableData = {
15
+ table: Table;
16
+ alias: string;
17
+ };
18
+ declare type JoinData = {
19
+ joinType: JoinType;
20
+ on: Expression<boolean> | ((contexts: {
21
+ [k: string]: Context<Table['columns']>;
22
+ }) => Expression<boolean>);
23
+ };
24
+ declare type Mode = [] | ['count', number] | ['get', 'one' | number];
25
+ declare type CustomColumn<Exp extends Expression<ExpressionTypes>, As extends string> = {
26
+ exp: Exp;
27
+ as: As;
28
+ };
29
+ declare type NullableAndDefaultColumns<Columns extends Table['columns']> = {
30
+ [columnKey in keyof Columns as true extends Columns[columnKey]['nullable'] ? columnKey : false extends Columns[columnKey]['default'] ? never : columnKey]: true extends Columns[columnKey]['nullable'] ? Columns[columnKey] : false extends Columns[columnKey]['default'] ? never : Columns[columnKey];
31
+ };
32
+ declare type TablesColumnsKeys<Tables extends {
33
+ [key: string]: Table;
34
+ }> = {
35
+ [tableKey in keyof Tables & string]: `${tableKey}_${keyof Tables[tableKey]['columns'] & string}`;
36
+ }[keyof {
37
+ [tableKey in keyof Tables & string]: undefined;
38
+ }];
39
+ declare type ExpressionTypes = null | boolean | number | bigint | Decimal | string | Date | JSON;
40
+ declare type Expression<ExpType extends ExpressionTypes> = ExpType | undefined | ValueExpression<ExpType> | QueryExpression<ExpType>;
41
+ declare type ValueExpression<ExpType extends ExpressionTypes> = ['val', ExpType | undefined];
42
+ declare type QueryExpression<ExpType extends ExpressionTypes> = ['qry', ExpType];
43
+ declare type InsertValue<Columns extends Table['columns'], NullableAndDefaultCols extends readonly (keyof NullableAndDefaultColumns<Columns>)[]> = {
44
+ [columnKey in Exclude<keyof Columns, keyof NullableAndDefaultColumns<Columns>>]: Expression<ColumnTypeByColumns<Columns, columnKey>>;
45
+ } & {
46
+ [columnKey in Exclude<keyof NullableAndDefaultCols, keyof unknown[]> as NullableAndDefaultCols[columnKey] & string]?: Expression<ColumnTypeByColumns<Columns, NullableAndDefaultCols[columnKey] & string>>;
47
+ };
48
+ declare type UpdateSets<Columns extends Table['columns']> = {
49
+ [columnKey in keyof Columns & string]?: Expression<ColumnTypeByColumns<Columns, columnKey>>;
50
+ };
51
+ declare type Query<Columns extends Table['columns'], Returning extends readonly (keyof Columns | CustomColumn<Expression<ExpressionTypes>, string>)[]> = {
52
+ getData: (params?: Param[]) => Result<QueryData, string>;
53
+ exec: <M extends Mode>(client: ClientBase, mode: M, params?: Param[]) => Promise<Result<QueryResult<Columns, Returning, M>, unknown>>;
54
+ };
55
+ declare type QueryResult<Columns extends Table['columns'], Returning extends readonly (keyof Columns | CustomColumn<Expression<ExpressionTypes>, string>)[], M extends Mode> = M extends ['get', 'one'] ? QueryResultRow<Columns, Returning> : M extends ['get', number] | [] ? QueryResultRow<Columns, Returning>[] : M extends ['count', number] ? boolean : never;
56
+ declare type QueryResultRow<Columns extends Table['columns'], Returning extends readonly (keyof Columns | CustomColumn<Expression<ExpressionTypes>, string>)[]> = {
57
+ [key in Exclude<keyof Returning, keyof unknown[]> as Returning[key] extends CustomColumn<Expression<ExpressionTypes>, infer As> ? As : Returning[key] & string]: Returning[key] extends CustomColumn<infer Exp, string> ? Exp extends Expression<infer ExpType> ? ExpType : Exp : ColumnTypeByColumns<Columns, Returning[key] & keyof Columns>;
58
+ };
59
+ declare type PartialQuery = {
60
+ text: string;
61
+ params: Param[];
62
+ };
63
+ export type { JoinType, Param, QueryData, TableData, JoinData, Mode };
64
+ export type { CustomColumn, NullableAndDefaultColumns, TablesColumnsKeys };
65
+ export type { ExpressionTypes, Expression, ValueExpression, QueryExpression };
66
+ export type { InsertValue, UpdateSets };
67
+ export type { Query, QueryResult, QueryResultRow, PartialQuery };
68
68
  //# sourceMappingURL=entity.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=entity.js.map
@@ -1,9 +1,9 @@
1
- import Decimal from 'decimal.js';
2
- declare type JSON = JsonObject | JsonArray;
3
- declare type JsonObject = {
4
- [key: string]: BaseJsonValue;
5
- };
6
- declare type JsonArray = BaseJsonValue[];
7
- declare type BaseJsonValue = null | boolean | number | bigint | Decimal | string | Date | JsonObject | JsonArray;
8
- export type { JSON, JsonObject, JsonArray, BaseJsonValue };
1
+ import Decimal from 'decimal.js';
2
+ declare type JSON = JsonObject | JsonArray;
3
+ declare type JsonObject = {
4
+ [key: string]: BaseJsonValue;
5
+ };
6
+ declare type JsonArray = BaseJsonValue[];
7
+ declare type BaseJsonValue = null | boolean | number | bigint | Decimal | string | Date | JsonObject | JsonArray;
8
+ export type { JSON, JsonObject, JsonArray, BaseJsonValue };
9
9
  //# sourceMappingURL=json.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=json.js.map
@@ -1,12 +1,12 @@
1
- import type Table from './table';
2
- import type { ColumnTypeByColumns, ColumnTypeByTable } from './postgres';
3
- declare type SimpleModel<T extends Table> = {
4
- [col in keyof T['columns'] & string]: ColumnTypeByTable<T, col>;
5
- };
6
- declare type Model<Columns extends Table['columns'], Requires extends readonly (keyof Columns)[], Optionals extends readonly (keyof Columns)[]> = {
7
- [key in Exclude<keyof Requires, keyof unknown[]> as Requires[key] & string]: ColumnTypeByColumns<Columns, Requires[key] & keyof Columns>;
8
- } & {
9
- [key in Exclude<keyof Optionals, keyof unknown[]> as Optionals[key] & string]?: ColumnTypeByColumns<Columns, Optionals[key] & keyof Columns>;
10
- };
11
- export type { SimpleModel, Model };
1
+ import type Table from './table';
2
+ import type { ColumnTypeByColumns, ColumnTypeByTable } from './postgres';
3
+ declare type SimpleModel<T extends Table> = {
4
+ [col in keyof T['columns'] & string]: ColumnTypeByTable<T, col>;
5
+ };
6
+ declare type Model<Columns extends Table['columns'], Requires extends readonly (keyof Columns)[], Optionals extends readonly (keyof Columns)[]> = {
7
+ [key in Exclude<keyof Requires, keyof unknown[]> as Requires[key] & string]: ColumnTypeByColumns<Columns, Requires[key] & keyof Columns>;
8
+ } & {
9
+ [key in Exclude<keyof Optionals, keyof unknown[]> as Optionals[key] & string]?: ColumnTypeByColumns<Columns, Optionals[key] & keyof Columns>;
10
+ };
11
+ export type { SimpleModel, Model };
12
12
  //# sourceMappingURL=model.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=model.js.map