@ignisia/sql 0.1.0 → 0.2.0
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/README.md +8 -8
- package/dist/{chunk-MG2S4V4N.js → chunk-62FKD35V.js} +6 -1
- package/dist/{chunk-TQ2GXAE7.js → chunk-EIUC7HJS.js} +29 -6
- package/dist/{chunk-W2DR3ZVK.js → chunk-KVCIOW7L.js} +5 -5
- package/dist/{chunk-D2ASIT4Q.js → chunk-OYM2PNYZ.js} +2 -2
- package/dist/{chunk-4DQRB5XS.js → chunk-UI7U54OT.js} +21 -3
- package/dist/database/alter.d.ts +3 -3
- package/dist/database/column.d.ts +3 -3
- package/dist/database/contract.d.ts +3 -3
- package/dist/database/index.d.ts +3 -3
- package/dist/database/index.js +7 -7
- package/dist/database/table.d.ts +3 -3
- package/dist/database/table.js +5 -5
- package/dist/database/types.d.ts +1 -1
- package/dist/database/wrapper.d.ts +1 -1
- package/dist/{index-Dcm5xIpR.d.ts → index-DFrpzXEn.d.ts} +5 -1
- package/dist/{index-DJhQVUY3.d.ts → index-FMT0YEO7.d.ts} +17 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +7 -7
- package/dist/migration/index.d.ts +3 -3
- package/dist/migration/runner.js +5 -5
- package/dist/migration/type.d.ts +3 -3
- package/dist/query/builder.d.ts +1 -1
- package/dist/query/builder.js +2 -2
- package/dist/query/condition.d.ts +1 -1
- package/dist/query/condition.js +2 -2
- package/dist/query/constants.d.ts +6 -1
- package/dist/query/constants.js +3 -1
- package/dist/query/contract.d.ts +1 -1
- package/dist/query/helper.d.ts +1 -1
- package/dist/query/helper.js +2 -2
- package/dist/query/index.d.ts +1 -1
- package/dist/query/index.js +2 -2
- package/dist/query/join.d.ts +1 -1
- package/dist/query/sql.d.ts +1 -1
- package/dist/query/sql.js +2 -2
- package/dist/query/types.d.ts +1 -1
- package/dist/query/utilities.d.ts +1 -1
- package/dist/query/utilities.js +2 -2
- package/dist/table/index.d.ts +1 -1
- package/dist/table/index.js +4 -4
- package/dist/table/types.d.ts +1 -1
- package/dist/table/utilities.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -19,14 +19,14 @@ bun add @ignisia/sql
|
|
|
19
19
|
import { Table, Column, Database } from '@ignisia/sql';
|
|
20
20
|
|
|
21
21
|
// Define a table
|
|
22
|
-
const users = Table.define(
|
|
22
|
+
const users = Table.define({
|
|
23
23
|
name: 'users',
|
|
24
|
+
dialect: 'postgres',
|
|
24
25
|
columns: {
|
|
25
26
|
// Define a column called "id"
|
|
26
27
|
id: Column.define({
|
|
27
28
|
type: 'SERIAL',
|
|
28
|
-
})
|
|
29
|
-
.primaryKey(),
|
|
29
|
+
}).primaryKey(),
|
|
30
30
|
name: Column.define({
|
|
31
31
|
type: 'TEXT',
|
|
32
32
|
length: 255,
|
|
@@ -47,7 +47,7 @@ const users = Table.define(
|
|
|
47
47
|
// By default the name of the created at column called "createdAt" and the name of the updated at column called "updatedAt"
|
|
48
48
|
// Pass an object with `createdAt` and `updatedAt` to rename them
|
|
49
49
|
timestamp: true,
|
|
50
|
-
);
|
|
50
|
+
});
|
|
51
51
|
|
|
52
52
|
// Define a database
|
|
53
53
|
const db = Database.define({
|
|
@@ -57,7 +57,7 @@ const db = Database.define({
|
|
|
57
57
|
config: {
|
|
58
58
|
host: 'localhost',
|
|
59
59
|
port: 5432,
|
|
60
|
-
|
|
60
|
+
user: 'postgres',
|
|
61
61
|
password: 'postgres',
|
|
62
62
|
database: 'my_database',
|
|
63
63
|
},
|
|
@@ -65,13 +65,13 @@ const db = Database.define({
|
|
|
65
65
|
// This will automatically assign db properties to each table so it can do query
|
|
66
66
|
tables: {
|
|
67
67
|
users,
|
|
68
|
-
}
|
|
68
|
+
},
|
|
69
69
|
});
|
|
70
70
|
|
|
71
71
|
// Using the database
|
|
72
72
|
|
|
73
73
|
// Fetch all users
|
|
74
|
-
const listUsers = await db.table('users').select().query()
|
|
74
|
+
const listUsers = await db.table('users').select().query();
|
|
75
75
|
// ^ Add .limit before the .query() to limit the number of results
|
|
76
76
|
// ^ Add .offset before the .query() to offset the results
|
|
77
77
|
// ^ Add .orderBy before the .query() to order the results
|
|
@@ -93,7 +93,7 @@ const newUsers = await db.table('users').insert(
|
|
|
93
93
|
);
|
|
94
94
|
|
|
95
95
|
// Delete a user
|
|
96
|
-
const deletedUsers = await db.table('users').delete()
|
|
96
|
+
const deletedUsers = await db.table('users').delete();
|
|
97
97
|
// ^ Add .where before the .query() to filter the deleted rows
|
|
98
98
|
|
|
99
99
|
// Update a user
|
|
@@ -48,6 +48,10 @@ var AcceptedJoin = {
|
|
|
48
48
|
RIGHT: "RIGHT",
|
|
49
49
|
NATURAL: "NATURAL"
|
|
50
50
|
};
|
|
51
|
+
var QueryHooksType = {
|
|
52
|
+
AFTER: "after",
|
|
53
|
+
BEFORE: "before"
|
|
54
|
+
};
|
|
51
55
|
|
|
52
56
|
export {
|
|
53
57
|
LogicalOperator,
|
|
@@ -56,5 +60,6 @@ export {
|
|
|
56
60
|
QueryType,
|
|
57
61
|
OrderBy,
|
|
58
62
|
AggregationFunction,
|
|
59
|
-
AcceptedJoin
|
|
63
|
+
AcceptedJoin,
|
|
64
|
+
QueryHooksType
|
|
60
65
|
};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
addJoin
|
|
3
|
+
} from "./chunk-FYSNJAGD.js";
|
|
1
4
|
import {
|
|
2
5
|
AcceptedJoin,
|
|
3
6
|
AcceptedOperator,
|
|
4
7
|
ConditionClause,
|
|
5
8
|
LogicalOperator,
|
|
9
|
+
QueryHooksType,
|
|
6
10
|
QueryType
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import {
|
|
9
|
-
addJoin
|
|
10
|
-
} from "./chunk-FYSNJAGD.js";
|
|
11
|
+
} from "./chunk-62FKD35V.js";
|
|
11
12
|
import {
|
|
12
13
|
deepClone,
|
|
13
14
|
quoteIdentifier
|
|
@@ -405,9 +406,29 @@ function toString() {
|
|
|
405
406
|
return this.toQuery().query;
|
|
406
407
|
}
|
|
407
408
|
async function exec() {
|
|
408
|
-
if (!this.table.
|
|
409
|
+
if (!this.table.client) throw new Error("Database client not defined");
|
|
409
410
|
const { query, params } = this.toQuery();
|
|
410
|
-
|
|
411
|
+
if (this.hooks?.before?.size) {
|
|
412
|
+
for (const hook of this.hooks.before.values()) {
|
|
413
|
+
hook({
|
|
414
|
+
query,
|
|
415
|
+
params,
|
|
416
|
+
type: this.definition.queryType,
|
|
417
|
+
hook: QueryHooksType.BEFORE
|
|
418
|
+
});
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
const result = await this.table.client.exec(query, params);
|
|
422
|
+
if (this.hooks?.after?.size) {
|
|
423
|
+
for (const hook of this.hooks.after.values()) {
|
|
424
|
+
hook({
|
|
425
|
+
query,
|
|
426
|
+
params,
|
|
427
|
+
type: this.definition.queryType,
|
|
428
|
+
hook: QueryHooksType.AFTER
|
|
429
|
+
});
|
|
430
|
+
}
|
|
431
|
+
}
|
|
411
432
|
return result.map(
|
|
412
433
|
(r) => parseAliasedRow({
|
|
413
434
|
row: r,
|
|
@@ -419,6 +440,7 @@ async function exec() {
|
|
|
419
440
|
|
|
420
441
|
// src/query/index.ts
|
|
421
442
|
var QueryBuilder2 = class {
|
|
443
|
+
hooks;
|
|
422
444
|
table;
|
|
423
445
|
definition;
|
|
424
446
|
_output;
|
|
@@ -436,6 +458,7 @@ var QueryBuilder2 = class {
|
|
|
436
458
|
or;
|
|
437
459
|
having;
|
|
438
460
|
constructor(table) {
|
|
461
|
+
this.hooks = {};
|
|
439
462
|
this.table = table;
|
|
440
463
|
this.definition = {
|
|
441
464
|
queryType: null,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
QueryBuilder
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-EIUC7HJS.js";
|
|
4
4
|
import {
|
|
5
5
|
defineColumns
|
|
6
6
|
} from "./chunk-WVJGTZFI.js";
|
|
7
7
|
|
|
8
8
|
// src/table/index.ts
|
|
9
9
|
var Table = class _Table {
|
|
10
|
-
|
|
10
|
+
client;
|
|
11
11
|
dialect;
|
|
12
12
|
name;
|
|
13
13
|
columns;
|
|
@@ -20,7 +20,7 @@ var Table = class _Table {
|
|
|
20
20
|
this.columns = options.columns;
|
|
21
21
|
this.paranoid = options.paranoid || null;
|
|
22
22
|
this.timestamp = options.timestamp || null;
|
|
23
|
-
this.
|
|
23
|
+
this.client = null;
|
|
24
24
|
for (const column of Object.values(this.columns)) {
|
|
25
25
|
column.dialect(options.dialect);
|
|
26
26
|
}
|
|
@@ -35,7 +35,7 @@ var Table = class _Table {
|
|
|
35
35
|
columns
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
|
-
async create(db = this.
|
|
38
|
+
async create(db = this.client) {
|
|
39
39
|
if (!db) throw new Error("Database client not defined");
|
|
40
40
|
const sql = `CREATE TABLE IF NOT EXISTS ${this.name} (${Object.entries(
|
|
41
41
|
this.columns
|
|
@@ -43,7 +43,7 @@ var Table = class _Table {
|
|
|
43
43
|
await db.exec(sql);
|
|
44
44
|
return this;
|
|
45
45
|
}
|
|
46
|
-
async drop(db = this.
|
|
46
|
+
async drop(db = this.client) {
|
|
47
47
|
if (!db) throw new Error("Database client not defined");
|
|
48
48
|
const sql = `DROP TABLE IF EXISTS ${this.name};`;
|
|
49
49
|
await db.exec(sql);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Table
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-KVCIOW7L.js";
|
|
4
4
|
|
|
5
5
|
// src/database/table.ts
|
|
6
6
|
async function createTable(tableName, columns, options) {
|
|
@@ -10,7 +10,7 @@ async function createTable(tableName, columns, options) {
|
|
|
10
10
|
columns,
|
|
11
11
|
...options
|
|
12
12
|
});
|
|
13
|
-
table.
|
|
13
|
+
table.client = this.client;
|
|
14
14
|
this.tables[tableName] = table;
|
|
15
15
|
if (!this?.client) {
|
|
16
16
|
throw new Error("Database not connected");
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
createTable,
|
|
12
12
|
dropTable,
|
|
13
13
|
renameTable
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-OYM2PNYZ.js";
|
|
15
15
|
import {
|
|
16
16
|
alterColumnType,
|
|
17
17
|
dropColumnDefault,
|
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
|
|
25
25
|
// src/database/index.ts
|
|
26
26
|
var Database = class _Database {
|
|
27
|
+
hooks;
|
|
27
28
|
dialect;
|
|
28
29
|
defintion;
|
|
29
30
|
tables;
|
|
@@ -40,6 +41,7 @@ var Database = class _Database {
|
|
|
40
41
|
setColumnNotNull;
|
|
41
42
|
dropColumnNotNull;
|
|
42
43
|
constructor(options) {
|
|
44
|
+
this.hooks = {};
|
|
43
45
|
this.dialect = options.dialect;
|
|
44
46
|
this.tables = options.tables ?? {};
|
|
45
47
|
this.defintion = {
|
|
@@ -49,7 +51,7 @@ var Database = class _Database {
|
|
|
49
51
|
this.client = options.dialect === Dialect.POSTGRES ? new DatabasePsql(options.config) : new DatabaseSqlite(options.config);
|
|
50
52
|
if (options.tables) {
|
|
51
53
|
for (const tableName in options.tables) {
|
|
52
|
-
options.tables[tableName].
|
|
54
|
+
options.tables[tableName].client = this.client;
|
|
53
55
|
}
|
|
54
56
|
}
|
|
55
57
|
this.createTable = createTable.bind(this);
|
|
@@ -79,7 +81,23 @@ var Database = class _Database {
|
|
|
79
81
|
throw new Error(`Table ${tableName} does not exist`);
|
|
80
82
|
}
|
|
81
83
|
const table = this.tables[tableName];
|
|
82
|
-
|
|
84
|
+
const query = table.query();
|
|
85
|
+
query.hooks.before = this.hooks.before;
|
|
86
|
+
query.hooks.after = this.hooks.after;
|
|
87
|
+
return query;
|
|
88
|
+
}
|
|
89
|
+
addHook(type, fn) {
|
|
90
|
+
if (!this.hooks[type]) {
|
|
91
|
+
this.hooks[type] = /* @__PURE__ */ new Set();
|
|
92
|
+
}
|
|
93
|
+
this.hooks[type].add(fn);
|
|
94
|
+
return this;
|
|
95
|
+
}
|
|
96
|
+
removeHook(type, fn) {
|
|
97
|
+
if (this.hooks[type]) {
|
|
98
|
+
this.hooks[type].delete(fn);
|
|
99
|
+
}
|
|
100
|
+
return this;
|
|
83
101
|
}
|
|
84
102
|
async transaction(fn) {
|
|
85
103
|
return this.client.transaction(fn);
|
package/dist/database/alter.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { D as Database } from '../index-
|
|
1
|
+
import { D as Database } from '../index-DFrpzXEn.js';
|
|
2
2
|
import { Column } from '../column/index.js';
|
|
3
3
|
import { AcceptedColumnTypes } from '../column/constants.js';
|
|
4
|
-
import { T as Table, D as DatabaseDefinition } from '../index-
|
|
4
|
+
import { T as Table, D as DatabaseDefinition } from '../index-FMT0YEO7.js';
|
|
5
5
|
import { Dialect } from '../table/constants.js';
|
|
6
|
+
import '../query/constants.js';
|
|
6
7
|
import '../column/types.js';
|
|
7
8
|
import '../types.js';
|
|
8
|
-
import '../query/constants.js';
|
|
9
9
|
|
|
10
10
|
declare function alterColumnType<DbDialect extends Dialect, Tables extends Record<string, Table<string, Record<string, Column>>>, Definition extends Partial<DatabaseDefinition<DbDialect>>, TableName extends (keyof Tables & string) | (string & {}), ColName extends (keyof Tables[TableName]['columns'] & string) | (string & {}), Type extends Omit<AcceptedColumnTypes, typeof AcceptedColumnTypes.ENUM>, NewTables extends Omit<Tables, TableName> & {
|
|
11
11
|
[K in TableName]: Table<TableName, Omit<Tables[TableName]['columns'], ColName> & {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { D as Database } from '../index-
|
|
1
|
+
import { D as Database } from '../index-DFrpzXEn.js';
|
|
2
2
|
import { Column } from '../column/index.js';
|
|
3
|
-
import { T as Table, D as DatabaseDefinition } from '../index-
|
|
3
|
+
import { T as Table, D as DatabaseDefinition } from '../index-FMT0YEO7.js';
|
|
4
4
|
import { Dialect } from '../table/constants.js';
|
|
5
|
+
import '../query/constants.js';
|
|
5
6
|
import '../column/constants.js';
|
|
6
7
|
import '../column/types.js';
|
|
7
8
|
import '../types.js';
|
|
8
|
-
import '../query/constants.js';
|
|
9
9
|
|
|
10
10
|
declare function addColumn<DbDialect extends Dialect, Tables extends Record<string, Table<string, Record<string, Column>>>, Definition extends Partial<DatabaseDefinition<DbDialect>>, TableName extends (keyof Tables & string) | (string & {}), ColName extends (keyof Tables[TableName]['columns'] & string) | (string & {}), NewTables extends Omit<Tables, TableName> & {
|
|
11
11
|
[K in TableName]: Table<TableName, Tables[TableName]['columns'] & {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { C as ColumnAlterationContract, T as TableAlterationContract } from '../index-
|
|
1
|
+
export { C as ColumnAlterationContract, T as TableAlterationContract } from '../index-DFrpzXEn.js';
|
|
2
2
|
import '../column/index.js';
|
|
3
3
|
import '../column/constants.js';
|
|
4
|
-
import '../index-
|
|
4
|
+
import '../index-FMT0YEO7.js';
|
|
5
5
|
import '../table/constants.js';
|
|
6
|
+
import '../query/constants.js';
|
|
6
7
|
import '../column/types.js';
|
|
7
8
|
import '../types.js';
|
|
8
|
-
import '../query/constants.js';
|
package/dist/database/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import '../column/index.js';
|
|
2
|
-
import '../index-
|
|
2
|
+
import '../index-FMT0YEO7.js';
|
|
3
|
+
import '../query/constants.js';
|
|
3
4
|
import '../table/constants.js';
|
|
4
|
-
export { D as Database } from '../index-
|
|
5
|
+
export { D as Database } from '../index-DFrpzXEn.js';
|
|
5
6
|
import '../column/constants.js';
|
|
6
7
|
import '../column/types.js';
|
|
7
8
|
import '../types.js';
|
|
8
|
-
import '../query/constants.js';
|
package/dist/database/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Database
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-UI7U54OT.js";
|
|
4
4
|
import "../chunk-HKTHKQLK.js";
|
|
5
5
|
import "../chunk-JF7OSNH4.js";
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-MG2S4V4N.js";
|
|
6
|
+
import "../chunk-OYM2PNYZ.js";
|
|
7
|
+
import "../chunk-KVCIOW7L.js";
|
|
8
|
+
import "../chunk-EIUC7HJS.js";
|
|
10
9
|
import "../chunk-FYSNJAGD.js";
|
|
10
|
+
import "../chunk-62FKD35V.js";
|
|
11
|
+
import "../chunk-V4OMHVJN.js";
|
|
12
|
+
import "../chunk-Y7FSRHH3.js";
|
|
11
13
|
import "../chunk-WVJGTZFI.js";
|
|
12
14
|
import "../chunk-GY7R637S.js";
|
|
13
15
|
import "../chunk-G3LSCLIQ.js";
|
|
14
|
-
import "../chunk-Y7FSRHH3.js";
|
|
15
|
-
import "../chunk-V4OMHVJN.js";
|
|
16
16
|
import "../chunk-GLOHF5CP.js";
|
|
17
17
|
export {
|
|
18
18
|
Database
|
package/dist/database/table.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { D as Database } from '../index-
|
|
1
|
+
import { D as Database } from '../index-DFrpzXEn.js';
|
|
2
2
|
import { Column } from '../column/index.js';
|
|
3
|
-
import { T as Table, D as DatabaseDefinition, a as TimestampOptions, M as MergeTimestampParanoid } from '../index-
|
|
3
|
+
import { T as Table, D as DatabaseDefinition, a as TimestampOptions, M as MergeTimestampParanoid } from '../index-FMT0YEO7.js';
|
|
4
4
|
import { Dialect } from '../table/constants.js';
|
|
5
|
+
import '../query/constants.js';
|
|
5
6
|
import '../column/constants.js';
|
|
6
7
|
import '../column/types.js';
|
|
7
8
|
import '../types.js';
|
|
8
|
-
import '../query/constants.js';
|
|
9
9
|
|
|
10
10
|
declare function createTable<DbDialect extends Dialect, Tables extends Record<string, Table<string, Record<string, Column>>>, Definition extends Partial<DatabaseDefinition<DbDialect>>, TableName extends string, Columns extends Record<string, Column>, CreatedAt extends string, UpdatedAt extends string, Timestamp extends TimestampOptions<CreatedAt, UpdatedAt> | boolean, Paranoid extends string | boolean, FinalColumns extends MergeTimestampParanoid<Columns, CreatedAt, UpdatedAt, Timestamp, Paranoid>, NewTables extends Tables & {
|
|
11
11
|
[K in TableName]: Table<TableName, FinalColumns, DbDialect, CreatedAt, UpdatedAt, Timestamp, Paranoid>;
|
package/dist/database/table.js
CHANGED
|
@@ -2,15 +2,15 @@ import {
|
|
|
2
2
|
createTable,
|
|
3
3
|
dropTable,
|
|
4
4
|
renameTable
|
|
5
|
-
} from "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-MG2S4V4N.js";
|
|
5
|
+
} from "../chunk-OYM2PNYZ.js";
|
|
6
|
+
import "../chunk-KVCIOW7L.js";
|
|
7
|
+
import "../chunk-EIUC7HJS.js";
|
|
9
8
|
import "../chunk-FYSNJAGD.js";
|
|
9
|
+
import "../chunk-62FKD35V.js";
|
|
10
|
+
import "../chunk-Y7FSRHH3.js";
|
|
10
11
|
import "../chunk-WVJGTZFI.js";
|
|
11
12
|
import "../chunk-GY7R637S.js";
|
|
12
13
|
import "../chunk-G3LSCLIQ.js";
|
|
13
|
-
import "../chunk-Y7FSRHH3.js";
|
|
14
14
|
import "../chunk-GLOHF5CP.js";
|
|
15
15
|
export {
|
|
16
16
|
createTable,
|
package/dist/database/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '../column/index.js';
|
|
2
|
-
export { D as DatabaseDefinition, b as DatabaseDialect,
|
|
2
|
+
export { D as DatabaseDefinition, b as DatabaseDialect, g as DatabaseOptions, P as PostgresConfig, S as SqliteConfig } from '../index-FMT0YEO7.js';
|
|
3
3
|
import '../table/constants.js';
|
|
4
4
|
import '../column/constants.js';
|
|
5
5
|
import '../column/types.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SQL } from 'bun';
|
|
2
2
|
import { Database } from 'bun:sqlite';
|
|
3
3
|
import { Dialect } from '../table/constants.js';
|
|
4
|
-
import { b as DatabaseDialect, P as PostgresConfig, S as SqliteConfig } from '../index-
|
|
4
|
+
import { b as DatabaseDialect, P as PostgresConfig, S as SqliteConfig } from '../index-FMT0YEO7.js';
|
|
5
5
|
import '../column/index.js';
|
|
6
6
|
import '../column/constants.js';
|
|
7
7
|
import '../column/types.js';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Column } from './column/index.js';
|
|
2
|
-
import { T as Table, D as DatabaseDefinition, a as TimestampOptions, M as MergeTimestampParanoid, b as DatabaseDialect,
|
|
2
|
+
import { T as Table, D as DatabaseDefinition, a as TimestampOptions, M as MergeTimestampParanoid, f as QuerHooks, b as DatabaseDialect, g as DatabaseOptions, d as QueryBuilder, h as QueryRunHooks } from './index-FMT0YEO7.js';
|
|
3
|
+
import { QueryHooksType } from './query/constants.js';
|
|
3
4
|
import { Dialect } from './table/constants.js';
|
|
4
5
|
import { AcceptedColumnTypes } from './column/constants.js';
|
|
5
6
|
|
|
@@ -75,6 +76,7 @@ interface ColumnAlterationContract<DbDialect extends Dialect, Tables extends Rec
|
|
|
75
76
|
}
|
|
76
77
|
|
|
77
78
|
declare class Database<DbDialect extends Dialect, Tables extends Record<string, Table<string, Record<string, Column>>>, Definition extends Partial<DatabaseDefinition<DbDialect>> = DatabaseDefinition<DbDialect>> {
|
|
79
|
+
readonly hooks: Partial<QuerHooks>;
|
|
78
80
|
readonly dialect: DbDialect;
|
|
79
81
|
readonly defintion: Definition;
|
|
80
82
|
readonly tables: Tables;
|
|
@@ -92,6 +94,8 @@ declare class Database<DbDialect extends Dialect, Tables extends Record<string,
|
|
|
92
94
|
dropColumnNotNull: ColumnAlterationContract<DbDialect, Tables, Definition>['dropColumnNotNull'];
|
|
93
95
|
protected constructor(options: DatabaseOptions<DbDialect, Tables>);
|
|
94
96
|
table<TableName extends keyof Tables & string, Table extends Tables[TableName]>(tableName: TableName): QueryBuilder<TableName, Table>;
|
|
97
|
+
addHook(type: QueryHooksType, fn: QueryRunHooks): this;
|
|
98
|
+
removeHook(type: QueryHooksType, fn: QueryRunHooks): this;
|
|
95
99
|
transaction<T, U extends () => Promise<T>>(fn: U): Promise<unknown>;
|
|
96
100
|
static define<DbDialect extends Dialect, Tables extends Record<string, Table<string, Record<string, Column>>>>(options: DatabaseOptions<DbDialect, Tables>): Database<DbDialect, Tables, DatabaseDefinition<DbDialect>>;
|
|
97
101
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Column } from './column/index.js';
|
|
2
2
|
import { AcceptedColumnTypes } from './column/constants.js';
|
|
3
3
|
import { UnionToIntersection } from './types.js';
|
|
4
|
-
import { QueryType, OrderBy, AggregationFunction, AcceptedOperator, ConditionClause, LogicalOperator } from './query/constants.js';
|
|
4
|
+
import { QueryType, OrderBy, AggregationFunction, QueryHooksType, AcceptedOperator, ConditionClause, LogicalOperator } from './query/constants.js';
|
|
5
5
|
import { Dialect } from './table/constants.js';
|
|
6
6
|
|
|
7
7
|
type ColumnSelector<Alias extends string, TableRef extends Table<string, Record<string, Column>>, JoinedTables extends Record<string, Table<string, Record<string, Column>>>> = `${Alias}."${keyof TableRef['columns'] & string}"` | `${Alias}.*` | {
|
|
@@ -118,6 +118,19 @@ type SelectQueryOutput<Alias extends string, TableRef extends Table<string, Reco
|
|
|
118
118
|
type QueryOutput<Alias extends string, TableRef extends Table<string, Record<string, Column>>, JoinedTables extends Record<string, Table<string, Record<string, Column>>>, Definition extends Partial<QueryDefinition<Alias, TableRef, JoinedTables>>, AllowedColumn extends ColumnSelector<Alias, TableRef, JoinedTables>> = Definition extends {
|
|
119
119
|
queryType: infer Type;
|
|
120
120
|
} ? Type extends null ? never : Type extends typeof QueryType.INSERT | typeof QueryType.UPDATE | typeof QueryType.DELETE ? InsertUpdateDeleteQueryOutput<TableRef>[] : Type extends typeof QueryType.SELECT ? SelectQueryOutput<Alias, TableRef, JoinedTables, Definition, AllowedColumn>[] : never : never;
|
|
121
|
+
interface QueryRunHooksOptions {
|
|
122
|
+
query: string;
|
|
123
|
+
hook: QueryHooksType;
|
|
124
|
+
params: unknown[] | null | undefined;
|
|
125
|
+
type: QueryType;
|
|
126
|
+
}
|
|
127
|
+
interface QueryRunHooks {
|
|
128
|
+
(options: QueryRunHooksOptions): void;
|
|
129
|
+
}
|
|
130
|
+
interface QuerHooks {
|
|
131
|
+
after: Set<QueryRunHooks>;
|
|
132
|
+
before: Set<QueryRunHooks>;
|
|
133
|
+
}
|
|
121
134
|
|
|
122
135
|
declare const createdAt: Column<AcceptedColumnTypes, number | readonly string[], {
|
|
123
136
|
type: "DATETIME";
|
|
@@ -190,7 +203,7 @@ interface DatabaseDialect {
|
|
|
190
203
|
}
|
|
191
204
|
|
|
192
205
|
declare class Table<TableName extends string, Columns extends Record<string, Column>, DbDialect extends Dialect = Dialect, CreatedAt extends string = string, UpdatedAt extends string = string, Timestamp extends TimestampOptions<CreatedAt, UpdatedAt> | boolean = TimestampOptions<CreatedAt, UpdatedAt> | boolean, Paranoid extends string | boolean = string | boolean> {
|
|
193
|
-
|
|
206
|
+
client: DatabaseDialect | null;
|
|
194
207
|
readonly dialect: DbDialect;
|
|
195
208
|
readonly name: TableName;
|
|
196
209
|
readonly columns: Columns;
|
|
@@ -262,6 +275,7 @@ interface QueryConditionContract<Alias extends string, TableRef extends Table<st
|
|
|
262
275
|
}
|
|
263
276
|
|
|
264
277
|
declare class QueryBuilder<Alias extends TableRef['name'], TableRef extends Table<string, Record<string, Column>>, JoinedTables extends Record<string, Table<string, Record<string, Column>>> = NonNullable<unknown>, Definition extends Partial<QueryDefinition<Alias, TableRef, JoinedTables>> = NonNullable<unknown>, AllowedColumn extends ColumnSelector<Alias, TableRef, JoinedTables> = ColumnSelector<Alias, TableRef, JoinedTables>, StrictAllowedColumn extends StrictColumnSelector<Alias, TableRef, JoinedTables> = StrictColumnSelector<Alias, TableRef, JoinedTables>> {
|
|
278
|
+
readonly hooks: Partial<QuerHooks>;
|
|
265
279
|
readonly table: TableRef;
|
|
266
280
|
readonly definition: Definition;
|
|
267
281
|
readonly _output: QueryOutput<Alias, TableRef, JoinedTables, Definition, AllowedColumn>;
|
|
@@ -341,4 +355,4 @@ declare class QueryBuilder<Alias extends TableRef['name'], TableRef extends Tabl
|
|
|
341
355
|
infer(): this['_output'];
|
|
342
356
|
}
|
|
343
357
|
|
|
344
|
-
export { type AliasedColumn as A,
|
|
358
|
+
export { type AliasedColumn as A, addRawCondition as B, type ColumnSelector as C, type DatabaseDefinition as D, rawWhere as E, rawOr as F, rawHaving as G, addCondition as H, where as I, or as J, having as K, type QueryTransformerContract as L, type MergeTimestampParanoid as M, type QueryConditionContract as N, type PostgresConfig as P, type QueryDefinition as Q, type RawColumn as R, type SqliteConfig as S, Table as T, type WhereValue as W, type TimestampOptions as a, type DatabaseDialect as b, type StrictColumnSelector as c, QueryBuilder as d, type SelectableColumn as e, type QuerHooks as f, type DatabaseOptions as g, type QueryRunHooks as h, type AcceptedOrderBy as i, type AcceptedInsertValues as j, type AcceptedUpdateValues as k, type AggregateColumn as l, type SelectQueryOutput as m, type QueryOutput as n, type QueryRunHooksOptions as o, createdAt as p, deletedAt as q, defineColumns as r, type TableOptions as s, type TableOutput as t, updatedAt as u, alias as v, clone as w, rawCol as x, col as y, aggregateCol as z };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export { Column } from './column/index.js';
|
|
2
|
-
export { D as Database } from './index-
|
|
2
|
+
export { D as Database } from './index-DFrpzXEn.js';
|
|
3
3
|
export { Migration } from './migration/index.js';
|
|
4
|
-
export { d as QueryBuilder, T as Table } from './index-
|
|
4
|
+
export { d as QueryBuilder, T as Table } from './index-FMT0YEO7.js';
|
|
5
5
|
import './table/constants.js';
|
|
6
6
|
import './column/constants.js';
|
|
7
7
|
import './column/types.js';
|
|
8
|
+
import './query/constants.js';
|
|
8
9
|
import './migration/type.js';
|
|
9
10
|
import './types.js';
|
|
10
|
-
import './query/constants.js';
|
package/dist/index.js
CHANGED
|
@@ -3,25 +3,25 @@ import {
|
|
|
3
3
|
} from "./chunk-CIWX3UCZ.js";
|
|
4
4
|
import {
|
|
5
5
|
Database
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-UI7U54OT.js";
|
|
7
7
|
import "./chunk-HKTHKQLK.js";
|
|
8
8
|
import "./chunk-JF7OSNH4.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-OYM2PNYZ.js";
|
|
10
10
|
import {
|
|
11
11
|
Table
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-KVCIOW7L.js";
|
|
13
13
|
import {
|
|
14
14
|
QueryBuilder
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import "./chunk-MG2S4V4N.js";
|
|
15
|
+
} from "./chunk-EIUC7HJS.js";
|
|
17
16
|
import "./chunk-FYSNJAGD.js";
|
|
17
|
+
import "./chunk-62FKD35V.js";
|
|
18
|
+
import "./chunk-V4OMHVJN.js";
|
|
19
|
+
import "./chunk-Y7FSRHH3.js";
|
|
18
20
|
import "./chunk-WVJGTZFI.js";
|
|
19
21
|
import {
|
|
20
22
|
Column
|
|
21
23
|
} from "./chunk-GY7R637S.js";
|
|
22
24
|
import "./chunk-G3LSCLIQ.js";
|
|
23
|
-
import "./chunk-Y7FSRHH3.js";
|
|
24
|
-
import "./chunk-V4OMHVJN.js";
|
|
25
25
|
import "./chunk-GLOHF5CP.js";
|
|
26
26
|
export {
|
|
27
27
|
Column,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Column } from '../column/index.js';
|
|
2
|
-
import { D as Database } from '../index-
|
|
3
|
-
import { T as Table } from '../index-
|
|
2
|
+
import { D as Database } from '../index-DFrpzXEn.js';
|
|
3
|
+
import { T as Table } from '../index-FMT0YEO7.js';
|
|
4
4
|
import { Dialect } from '../table/constants.js';
|
|
5
5
|
import { MigrationOptions, MigrationFn } from './type.js';
|
|
6
6
|
import '../column/constants.js';
|
|
7
7
|
import '../column/types.js';
|
|
8
|
-
import '../types.js';
|
|
9
8
|
import '../query/constants.js';
|
|
9
|
+
import '../types.js';
|
|
10
10
|
|
|
11
11
|
declare class Migration<DbDialect extends Dialect, Tables extends Record<string, Table<string, Record<string, Column>>>> {
|
|
12
12
|
readonly db: Database<DbDialect, Tables>;
|
package/dist/migration/runner.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Table
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-MG2S4V4N.js";
|
|
3
|
+
} from "../chunk-KVCIOW7L.js";
|
|
4
|
+
import "../chunk-EIUC7HJS.js";
|
|
6
5
|
import "../chunk-FYSNJAGD.js";
|
|
6
|
+
import "../chunk-62FKD35V.js";
|
|
7
|
+
import "../chunk-Y7FSRHH3.js";
|
|
7
8
|
import "../chunk-WVJGTZFI.js";
|
|
8
9
|
import {
|
|
9
10
|
Column
|
|
10
11
|
} from "../chunk-GY7R637S.js";
|
|
11
12
|
import "../chunk-G3LSCLIQ.js";
|
|
12
|
-
import "../chunk-Y7FSRHH3.js";
|
|
13
13
|
import "../chunk-GLOHF5CP.js";
|
|
14
14
|
|
|
15
15
|
// src/migration/runner.ts
|
|
@@ -39,7 +39,7 @@ async function runMigration(filePath, direction) {
|
|
|
39
39
|
},
|
|
40
40
|
dialect: migration.db.dialect
|
|
41
41
|
});
|
|
42
|
-
migrationTable.
|
|
42
|
+
migrationTable.client = migration.db.client;
|
|
43
43
|
await migrationTable.create();
|
|
44
44
|
}
|
|
45
45
|
const fn = migration[direction];
|
package/dist/migration/type.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Column } from '../column/index.js';
|
|
2
|
-
import { D as Database } from '../index-
|
|
3
|
-
import { T as Table } from '../index-
|
|
2
|
+
import { D as Database } from '../index-DFrpzXEn.js';
|
|
3
|
+
import { T as Table } from '../index-FMT0YEO7.js';
|
|
4
4
|
import { Dialect } from '../table/constants.js';
|
|
5
5
|
import '../column/constants.js';
|
|
6
6
|
import '../column/types.js';
|
|
7
|
-
import '../types.js';
|
|
8
7
|
import '../query/constants.js';
|
|
8
|
+
import '../types.js';
|
|
9
9
|
|
|
10
10
|
interface MigrationOptions<DbDialect extends Dialect, Tables extends Record<string, Table<string, Record<string, Column>>>> {
|
|
11
11
|
db: Database<DbDialect, Tables>;
|
package/dist/query/builder.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { T as Table, Q as QueryDefinition, C as ColumnSelector, c as StrictColumnSelector, d as QueryBuilder } from '../index-
|
|
1
|
+
import { T as Table, Q as QueryDefinition, C as ColumnSelector, c as StrictColumnSelector, d as QueryBuilder } from '../index-FMT0YEO7.js';
|
|
2
2
|
import { Column } from '../column/index.js';
|
|
3
3
|
import '../column/constants.js';
|
|
4
4
|
import '../types.js';
|
package/dist/query/builder.js
CHANGED
|
@@ -3,9 +3,9 @@ import {
|
|
|
3
3
|
buildInsertQuery,
|
|
4
4
|
buildSelectQuery,
|
|
5
5
|
buildUpdateQuery
|
|
6
|
-
} from "../chunk-
|
|
7
|
-
import "../chunk-MG2S4V4N.js";
|
|
6
|
+
} from "../chunk-EIUC7HJS.js";
|
|
8
7
|
import "../chunk-FYSNJAGD.js";
|
|
8
|
+
import "../chunk-62FKD35V.js";
|
|
9
9
|
import "../chunk-Y7FSRHH3.js";
|
|
10
10
|
import "../chunk-GLOHF5CP.js";
|
|
11
11
|
export {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { H as addCondition, B as addRawCondition, K as having, J as or, G as rawHaving, F as rawOr, E as rawWhere, I as where } from '../index-FMT0YEO7.js';
|
|
2
2
|
import '../column/index.js';
|
|
3
3
|
import './constants.js';
|
|
4
4
|
import '../column/constants.js';
|
package/dist/query/condition.js
CHANGED
|
@@ -7,9 +7,9 @@ import {
|
|
|
7
7
|
rawOr,
|
|
8
8
|
rawWhere,
|
|
9
9
|
where
|
|
10
|
-
} from "../chunk-
|
|
11
|
-
import "../chunk-MG2S4V4N.js";
|
|
10
|
+
} from "../chunk-EIUC7HJS.js";
|
|
12
11
|
import "../chunk-FYSNJAGD.js";
|
|
12
|
+
import "../chunk-62FKD35V.js";
|
|
13
13
|
import "../chunk-Y7FSRHH3.js";
|
|
14
14
|
import "../chunk-GLOHF5CP.js";
|
|
15
15
|
export {
|
|
@@ -54,5 +54,10 @@ declare const AcceptedJoin: {
|
|
|
54
54
|
readonly NATURAL: "NATURAL";
|
|
55
55
|
};
|
|
56
56
|
type AcceptedJoin = (typeof AcceptedJoin)[keyof typeof AcceptedJoin];
|
|
57
|
+
declare const QueryHooksType: {
|
|
58
|
+
readonly AFTER: "after";
|
|
59
|
+
readonly BEFORE: "before";
|
|
60
|
+
};
|
|
61
|
+
type QueryHooksType = (typeof QueryHooksType)[keyof typeof QueryHooksType];
|
|
57
62
|
|
|
58
|
-
export { AcceptedJoin, AcceptedOperator, AggregationFunction, ConditionClause, LogicalOperator, OrderBy, QueryType };
|
|
63
|
+
export { AcceptedJoin, AcceptedOperator, AggregationFunction, ConditionClause, LogicalOperator, OrderBy, QueryHooksType, QueryType };
|
package/dist/query/constants.js
CHANGED
|
@@ -5,8 +5,9 @@ import {
|
|
|
5
5
|
ConditionClause,
|
|
6
6
|
LogicalOperator,
|
|
7
7
|
OrderBy,
|
|
8
|
+
QueryHooksType,
|
|
8
9
|
QueryType
|
|
9
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-62FKD35V.js";
|
|
10
11
|
export {
|
|
11
12
|
AcceptedJoin,
|
|
12
13
|
AcceptedOperator,
|
|
@@ -14,5 +15,6 @@ export {
|
|
|
14
15
|
ConditionClause,
|
|
15
16
|
LogicalOperator,
|
|
16
17
|
OrderBy,
|
|
18
|
+
QueryHooksType,
|
|
17
19
|
QueryType
|
|
18
20
|
};
|
package/dist/query/contract.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { N as QueryConditionContract, L as QueryTransformerContract } from '../index-FMT0YEO7.js';
|
|
2
2
|
import '../column/index.js';
|
|
3
3
|
import './constants.js';
|
|
4
4
|
import '../column/constants.js';
|
package/dist/query/helper.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { z as aggregateCol, v as alias, w as clone, y as col, x as rawCol } from '../index-FMT0YEO7.js';
|
|
2
2
|
import '../column/index.js';
|
|
3
3
|
import './constants.js';
|
|
4
4
|
import '../column/constants.js';
|
package/dist/query/helper.js
CHANGED
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
clone,
|
|
5
5
|
col,
|
|
6
6
|
rawCol
|
|
7
|
-
} from "../chunk-
|
|
8
|
-
import "../chunk-MG2S4V4N.js";
|
|
7
|
+
} from "../chunk-EIUC7HJS.js";
|
|
9
8
|
import "../chunk-FYSNJAGD.js";
|
|
9
|
+
import "../chunk-62FKD35V.js";
|
|
10
10
|
import "../chunk-Y7FSRHH3.js";
|
|
11
11
|
import "../chunk-GLOHF5CP.js";
|
|
12
12
|
export {
|
package/dist/query/index.d.ts
CHANGED
package/dist/query/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
QueryBuilder
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-MG2S4V4N.js";
|
|
3
|
+
} from "../chunk-EIUC7HJS.js";
|
|
5
4
|
import "../chunk-FYSNJAGD.js";
|
|
5
|
+
import "../chunk-62FKD35V.js";
|
|
6
6
|
import "../chunk-Y7FSRHH3.js";
|
|
7
7
|
import "../chunk-GLOHF5CP.js";
|
|
8
8
|
export {
|
package/dist/query/join.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { T as Table, Q as QueryDefinition, C as ColumnSelector, c as StrictColumnSelector, d as QueryBuilder } from '../index-
|
|
1
|
+
import { T as Table, Q as QueryDefinition, C as ColumnSelector, c as StrictColumnSelector, d as QueryBuilder } from '../index-FMT0YEO7.js';
|
|
2
2
|
import { Column } from '../column/index.js';
|
|
3
3
|
import { AcceptedJoin } from './constants.js';
|
|
4
4
|
import '../column/constants.js';
|
package/dist/query/sql.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { T as Table, Q as QueryDefinition, C as ColumnSelector, c as StrictColumnSelector, d as QueryBuilder } from '../index-
|
|
1
|
+
import { T as Table, Q as QueryDefinition, C as ColumnSelector, c as StrictColumnSelector, d as QueryBuilder } from '../index-FMT0YEO7.js';
|
|
2
2
|
import { Column } from '../column/index.js';
|
|
3
3
|
import '../column/constants.js';
|
|
4
4
|
import '../types.js';
|
package/dist/query/sql.js
CHANGED
|
@@ -3,9 +3,9 @@ import {
|
|
|
3
3
|
exec,
|
|
4
4
|
toQuery,
|
|
5
5
|
toString
|
|
6
|
-
} from "../chunk-
|
|
7
|
-
import "../chunk-MG2S4V4N.js";
|
|
6
|
+
} from "../chunk-EIUC7HJS.js";
|
|
8
7
|
import "../chunk-FYSNJAGD.js";
|
|
8
|
+
import "../chunk-62FKD35V.js";
|
|
9
9
|
import "../chunk-Y7FSRHH3.js";
|
|
10
10
|
import "../chunk-GLOHF5CP.js";
|
|
11
11
|
export {
|
package/dist/query/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '../column/index.js';
|
|
2
2
|
import '../column/constants.js';
|
|
3
|
-
export {
|
|
3
|
+
export { j as AcceptedInsertValues, i as AcceptedOrderBy, k as AcceptedUpdateValues, l as AggregateColumn, A as AliasedColumn, C as ColumnSelector, f as QuerHooks, Q as QueryDefinition, n as QueryOutput, h as QueryRunHooks, o as QueryRunHooksOptions, R as RawColumn, m as SelectQueryOutput, e as SelectableColumn, c as StrictColumnSelector, W as WhereValue } from '../index-FMT0YEO7.js';
|
|
4
4
|
import '../types.js';
|
|
5
5
|
import './constants.js';
|
|
6
6
|
import '../table/constants.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { T as Table, W as WhereValue, Q as QueryDefinition, C as ColumnSelector, c as StrictColumnSelector, d as QueryBuilder, A as AliasedColumn, e as SelectableColumn } from '../index-
|
|
1
|
+
import { T as Table, W as WhereValue, Q as QueryDefinition, C as ColumnSelector, c as StrictColumnSelector, d as QueryBuilder, A as AliasedColumn, e as SelectableColumn } from '../index-FMT0YEO7.js';
|
|
2
2
|
import { Column } from '../column/index.js';
|
|
3
3
|
import { Dialect } from '../table/constants.js';
|
|
4
4
|
import { AcceptedOperator } from './constants.js';
|
package/dist/query/utilities.js
CHANGED
|
@@ -7,9 +7,9 @@ import {
|
|
|
7
7
|
getTimestamp,
|
|
8
8
|
getWhereConditions,
|
|
9
9
|
parseAliasedRow
|
|
10
|
-
} from "../chunk-
|
|
11
|
-
import "../chunk-MG2S4V4N.js";
|
|
10
|
+
} from "../chunk-EIUC7HJS.js";
|
|
12
11
|
import "../chunk-FYSNJAGD.js";
|
|
12
|
+
import "../chunk-62FKD35V.js";
|
|
13
13
|
import "../chunk-Y7FSRHH3.js";
|
|
14
14
|
import "../chunk-GLOHF5CP.js";
|
|
15
15
|
export {
|
package/dist/table/index.d.ts
CHANGED
package/dist/table/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Table
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-MG2S4V4N.js";
|
|
3
|
+
} from "../chunk-KVCIOW7L.js";
|
|
4
|
+
import "../chunk-EIUC7HJS.js";
|
|
6
5
|
import "../chunk-FYSNJAGD.js";
|
|
6
|
+
import "../chunk-62FKD35V.js";
|
|
7
|
+
import "../chunk-Y7FSRHH3.js";
|
|
7
8
|
import "../chunk-WVJGTZFI.js";
|
|
8
9
|
import "../chunk-GY7R637S.js";
|
|
9
10
|
import "../chunk-G3LSCLIQ.js";
|
|
10
|
-
import "../chunk-Y7FSRHH3.js";
|
|
11
11
|
import "../chunk-GLOHF5CP.js";
|
|
12
12
|
export {
|
|
13
13
|
Table
|
package/dist/table/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { M as MergeTimestampParanoid,
|
|
1
|
+
export { M as MergeTimestampParanoid, s as TableOptions, t as TableOutput, a as TimestampOptions } from '../index-FMT0YEO7.js';
|
|
2
2
|
import '../column/index.js';
|
|
3
3
|
import './constants.js';
|
|
4
4
|
import '../column/constants.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import '../column/constants.js';
|
|
2
2
|
import '../column/index.js';
|
|
3
3
|
import './constants.js';
|
|
4
|
-
export {
|
|
4
|
+
export { p as createdAt, r as defineColumns, q as deletedAt, u as updatedAt } from '../index-FMT0YEO7.js';
|
|
5
5
|
import '../column/types.js';
|
|
6
6
|
import '../types.js';
|
|
7
7
|
import '../query/constants.js';
|