rado 1.2.0 → 1.3.0-preview.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 +163 -257
- package/dist/compat.d.ts +3 -0
- package/dist/core/Builder.d.ts +16 -9
- package/dist/core/Builder.js +52 -4
- package/dist/core/Column.d.ts +38 -25
- package/dist/core/Column.js +56 -27
- package/dist/core/Constraint.d.ts +2 -1
- package/dist/core/Constraint.js +2 -1
- package/dist/core/Database.d.ts +5 -4
- package/dist/core/Database.js +14 -13
- package/dist/core/Emitter.d.ts +2 -2
- package/dist/core/Index.d.ts +1 -1
- package/dist/core/Internal.d.ts +19 -2
- package/dist/core/Internal.js +29 -11
- package/dist/core/Param.js +2 -0
- package/dist/core/Queries.d.ts +1 -0
- package/dist/core/Queries.js +11 -1
- package/dist/core/Resolver.js +2 -2
- package/dist/core/Schema.d.ts +1 -3
- package/dist/core/Selection.d.ts +9 -4
- package/dist/core/Selection.js +94 -5
- package/dist/core/Sql.d.ts +4 -3
- package/dist/core/Sql.js +8 -2
- package/dist/core/Table.d.ts +18 -11
- package/dist/core/Table.js +45 -25
- package/dist/core/View.d.ts +34 -0
- package/dist/core/View.js +153 -0
- package/dist/core/Virtual.d.ts +7 -2
- package/dist/core/Virtual.js +14 -10
- package/dist/core/expr/Conditions.d.ts +7 -7
- package/dist/core/expr/Include.d.ts +2 -2
- package/dist/core/expr/Include.js +1 -1
- package/dist/core/expr/Input.d.ts +1 -1
- package/dist/core/expr/Input.js +5 -1
- package/dist/core/query/CTE.d.ts +3 -5
- package/dist/core/query/CTE.js +1 -13
- package/dist/core/query/Delete.d.ts +10 -10
- package/dist/core/query/Delete.js +2 -2
- package/dist/core/query/Insert.d.ts +6 -5
- package/dist/core/query/Insert.js +22 -9
- package/dist/core/query/Query.d.ts +26 -11
- package/dist/core/query/Select.d.ts +41 -8
- package/dist/core/query/Select.js +235 -25
- package/dist/core/query/Shared.d.ts +2 -1
- package/dist/core/query/Shared.js +8 -5
- package/dist/core/query/Update.d.ts +9 -9
- package/dist/core/query/Update.js +24 -12
- package/dist/driver/better-sqlite3.js +4 -0
- package/dist/driver/bun-sqlite.js +3 -0
- package/dist/driver/d1.js +3 -0
- package/dist/driver/libsql.js +4 -0
- package/dist/driver/mysql2.js +5 -0
- package/dist/driver/pg.d.ts +17 -1
- package/dist/driver/pg.js +10 -1
- package/dist/driver/pglite.js +21 -6
- package/dist/driver/sql.js.js +4 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/mysql/columns.d.ts +30 -30
- package/dist/mysql/columns.js +25 -24
- package/dist/mysql/dialect.js +6 -2
- package/dist/mysql/diff.js +1 -1
- package/dist/mysql.d.ts +1 -0
- package/dist/mysql.js +2 -0
- package/dist/postgres/columns.d.ts +103 -33
- package/dist/postgres/columns.js +317 -35
- package/dist/postgres/diff.js +3 -3
- package/dist/postgres/enum.d.ts +17 -0
- package/dist/postgres/enum.js +64 -0
- package/dist/postgres/schema.d.ts +19 -0
- package/dist/postgres/schema.js +47 -0
- package/dist/postgres.d.ts +3 -1
- package/dist/postgres.js +9 -2
- package/dist/sqlite/columns.d.ts +29 -14
- package/dist/sqlite/columns.js +41 -9
- package/dist/sqlite/dialect.js +3 -1
- package/dist/sqlite/diff.js +1 -1
- package/dist/sqlite/functions.d.ts +1 -1
- package/dist/sqlite/functions.js +1 -1
- package/dist/sqlite.d.ts +1 -0
- package/dist/sqlite.js +3 -6
- package/dist/universal/columns.d.ts +8 -8
- package/dist/universal/columns.js +43 -26
- package/dist/universal/functions.d.ts +1 -1
- package/dist/universal/functions.js +1 -1
- package/package.json +54 -37
package/dist/postgres.js
CHANGED
|
@@ -9,15 +9,20 @@ import {
|
|
|
9
9
|
union,
|
|
10
10
|
unionAll
|
|
11
11
|
} from "./core/query/Select.js";
|
|
12
|
-
import { schema } from "./core/Schema.js";
|
|
13
12
|
import {
|
|
14
13
|
alias,
|
|
15
14
|
table,
|
|
16
15
|
tableCreator
|
|
17
16
|
} from "./core/Table.js";
|
|
17
|
+
import {
|
|
18
|
+
materializedView,
|
|
19
|
+
view
|
|
20
|
+
} from "./core/View.js";
|
|
18
21
|
export * from "./postgres/builder.js";
|
|
19
22
|
export * from "./postgres/columns.js";
|
|
20
23
|
export * from "./postgres/dialect.js";
|
|
24
|
+
export * from "./postgres/enum.js";
|
|
25
|
+
import { pgSchema } from "./postgres/schema.js";
|
|
21
26
|
export {
|
|
22
27
|
alias,
|
|
23
28
|
except,
|
|
@@ -26,9 +31,11 @@ export {
|
|
|
26
31
|
index,
|
|
27
32
|
intersect,
|
|
28
33
|
intersectAll,
|
|
29
|
-
|
|
34
|
+
materializedView as pgMaterializedView,
|
|
35
|
+
pgSchema,
|
|
30
36
|
table as pgTable,
|
|
31
37
|
tableCreator as pgTableCreator,
|
|
38
|
+
view as pgView,
|
|
32
39
|
primaryKey,
|
|
33
40
|
union,
|
|
34
41
|
unionAll,
|
package/dist/sqlite/columns.d.ts
CHANGED
|
@@ -1,25 +1,40 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function boolean(name?: string): Column<boolean
|
|
3
|
-
export declare function integer(name?: string): Column<number
|
|
1
|
+
import { Column, type ColumnArguments, JsonColumn } from '../core/Column.js';
|
|
2
|
+
export declare function boolean(name?: string): Column<boolean>;
|
|
3
|
+
export declare function integer(name?: string): Column<number>;
|
|
4
4
|
export declare function integer(...args: ColumnArguments<{
|
|
5
5
|
mode: 'boolean';
|
|
6
|
-
}>): Column<boolean
|
|
6
|
+
}>): Column<boolean>;
|
|
7
7
|
export declare function integer(...args: ColumnArguments<{
|
|
8
8
|
mode: 'timestamp';
|
|
9
|
-
}>): Column<Date
|
|
9
|
+
}>): Column<Date>;
|
|
10
10
|
export declare function integer(...args: ColumnArguments<{
|
|
11
11
|
mode: 'timestamp_ms';
|
|
12
|
-
}>): Column<Date
|
|
12
|
+
}>): Column<Date>;
|
|
13
|
+
export declare function integer(...args: ColumnArguments<{
|
|
14
|
+
mode: 'number';
|
|
15
|
+
}>): Column<number>;
|
|
13
16
|
export declare const int: typeof integer;
|
|
14
|
-
export declare function blob(name?: string): Column<Uint8Array
|
|
17
|
+
export declare function blob(name?: string): Column<Uint8Array>;
|
|
15
18
|
export declare function blob(...args: ColumnArguments<{
|
|
16
19
|
mode: 'bigint';
|
|
17
|
-
}>): Column<
|
|
20
|
+
}>): Column<bigint>;
|
|
18
21
|
export declare function blob<T>(...args: ColumnArguments<{
|
|
19
22
|
mode: 'json';
|
|
20
|
-
}>): Column<T
|
|
21
|
-
export declare function
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
export declare function
|
|
25
|
-
export declare function
|
|
23
|
+
}>): Column<T>;
|
|
24
|
+
export declare function blob(...args: ColumnArguments<{
|
|
25
|
+
mode: 'buffer';
|
|
26
|
+
}>): Column<ArrayBuffer>;
|
|
27
|
+
export declare function text(name?: string): Column<string>;
|
|
28
|
+
export declare function text<const Values extends readonly string[]>(...args: ColumnArguments<{
|
|
29
|
+
mode?: 'text';
|
|
30
|
+
length?: number;
|
|
31
|
+
enum?: Values;
|
|
32
|
+
}>): Column<Values[number]>;
|
|
33
|
+
export declare function text<T>(...args: ColumnArguments<{
|
|
34
|
+
mode: 'json';
|
|
35
|
+
length?: number;
|
|
36
|
+
}>): JsonColumn<T>;
|
|
37
|
+
export declare function real(name?: string): Column<number>;
|
|
38
|
+
export declare function numeric(name?: string): Column<number>;
|
|
39
|
+
export declare function json<T>(name?: string): JsonColumn<T>;
|
|
40
|
+
export declare function jsonb<T>(name?: string): JsonColumn<T>;
|
package/dist/sqlite/columns.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
// src/sqlite/columns.ts
|
|
2
2
|
import {
|
|
3
|
+
Column,
|
|
3
4
|
JsonColumn,
|
|
4
5
|
column,
|
|
5
6
|
columnConfig
|
|
6
7
|
} from "../core/Column.js";
|
|
7
8
|
function boolean(name) {
|
|
8
|
-
return
|
|
9
|
+
return new Column({
|
|
9
10
|
name,
|
|
10
11
|
type: column.integer(),
|
|
11
12
|
mapFromDriverValue(value) {
|
|
@@ -20,7 +21,7 @@ function integer(...args) {
|
|
|
20
21
|
const { name, options } = columnConfig(args);
|
|
21
22
|
if (options?.mode === "timestamp" || options?.mode === "timestamp_ms") {
|
|
22
23
|
const scale = options.mode === "timestamp" ? 1e3 : 1;
|
|
23
|
-
return
|
|
24
|
+
return new Column({
|
|
24
25
|
name,
|
|
25
26
|
type: column.integer(),
|
|
26
27
|
mapFromDriverValue(value) {
|
|
@@ -33,14 +34,14 @@ function integer(...args) {
|
|
|
33
34
|
});
|
|
34
35
|
}
|
|
35
36
|
if (options?.mode === "boolean") return boolean();
|
|
36
|
-
return
|
|
37
|
+
return new Column({ name, type: column.integer() });
|
|
37
38
|
}
|
|
38
39
|
var int = integer;
|
|
39
40
|
function blob(...args) {
|
|
40
41
|
const { name, options } = columnConfig(args);
|
|
41
42
|
if (options?.mode === "json") return json(name);
|
|
42
43
|
if (options?.mode === "bigint")
|
|
43
|
-
return
|
|
44
|
+
return new Column({
|
|
44
45
|
name,
|
|
45
46
|
type: column.blob(),
|
|
46
47
|
mapFromDriverValue(value) {
|
|
@@ -50,16 +51,47 @@ function blob(...args) {
|
|
|
50
51
|
return value.toString();
|
|
51
52
|
}
|
|
52
53
|
});
|
|
53
|
-
|
|
54
|
+
if (options?.mode === "buffer")
|
|
55
|
+
return new Column({
|
|
56
|
+
name,
|
|
57
|
+
type: column.blob(),
|
|
58
|
+
mapFromDriverValue(value) {
|
|
59
|
+
if (value instanceof ArrayBuffer) return value;
|
|
60
|
+
if (value && typeof value === "object" && ArrayBuffer.isView(value)) {
|
|
61
|
+
const view = value;
|
|
62
|
+
return view.buffer.slice(
|
|
63
|
+
view.byteOffset,
|
|
64
|
+
view.byteOffset + view.byteLength
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
return value;
|
|
68
|
+
},
|
|
69
|
+
mapToDriverValue(value) {
|
|
70
|
+
return value instanceof ArrayBuffer ? new Uint8Array(value) : value;
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
return new Column({ name, type: column.blob() });
|
|
54
74
|
}
|
|
55
|
-
function text(
|
|
56
|
-
|
|
75
|
+
function text(...args) {
|
|
76
|
+
const { name, options } = columnConfig(args);
|
|
77
|
+
if (options?.mode === "json")
|
|
78
|
+
return new JsonColumn({
|
|
79
|
+
name,
|
|
80
|
+
type: column.text(options?.length),
|
|
81
|
+
mapToDriverValue(value) {
|
|
82
|
+
return JSON.stringify(value);
|
|
83
|
+
},
|
|
84
|
+
mapFromDriverValue(value) {
|
|
85
|
+
return JSON.parse(value);
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
return new Column({ name, type: column.text(options?.length) });
|
|
57
89
|
}
|
|
58
90
|
function real(name) {
|
|
59
|
-
return
|
|
91
|
+
return new Column({ name, type: column.real() });
|
|
60
92
|
}
|
|
61
93
|
function numeric(name) {
|
|
62
|
-
return
|
|
94
|
+
return new Column({ name, type: column.numeric() });
|
|
63
95
|
}
|
|
64
96
|
function json(name) {
|
|
65
97
|
return new JsonColumn({
|
package/dist/sqlite/dialect.js
CHANGED
|
@@ -26,7 +26,9 @@ var sqliteDialect = new Dialect(
|
|
|
26
26
|
target.emit(this);
|
|
27
27
|
this.sql += asSql ? "->>" : "->";
|
|
28
28
|
this.sql += this.quoteString(
|
|
29
|
-
`$${segments.map(
|
|
29
|
+
`$${segments.map(
|
|
30
|
+
(p) => typeof p === "number" ? `[${p}]` : `.${JSON.stringify(p)}`
|
|
31
|
+
).join("")}`
|
|
30
32
|
);
|
|
31
33
|
}
|
|
32
34
|
emitInline(value) {
|
package/dist/sqlite/diff.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// src/sqlite/diff.ts
|
|
2
2
|
import { formatColumn } from "../core/Column.js";
|
|
3
3
|
import { Rollback } from "../core/Database.js";
|
|
4
|
+
import { eq } from "../core/expr/Conditions.js";
|
|
4
5
|
import { getData, getQuery, getTable } from "../core/Internal.js";
|
|
5
6
|
import { sql } from "../core/Sql.js";
|
|
6
7
|
import { table } from "../core/Table.js";
|
|
7
|
-
import { eq } from "../core/expr/Conditions.js";
|
|
8
8
|
import { txGenerator } from "../universal.js";
|
|
9
9
|
import * as column from "./columns.js";
|
|
10
10
|
import { sqliteDialect } from "./dialect.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { type Input } from '../core/expr/Input.js';
|
|
1
2
|
import type { HasSql, HasTable } from '../core/Internal.js';
|
|
2
3
|
import { type Sql } from '../core/Sql.js';
|
|
3
|
-
import { type Input } from '../core/expr/Input.js';
|
|
4
4
|
/**: The count(X) function returns a count of the number of times that X is not NULL in a group. The count(*) function (with no arguments) returns the total number of rows in the group. */
|
|
5
5
|
export declare const count: (x?: HasSql) => Sql<number>;
|
|
6
6
|
/** The iif(X,Y,Z) function returns the value Y if X is true, and Z otherwise. The iif(X,Y,Z) function is logically equivalent to and generates the same bytecode as the CASE HasSql "CASE WHEN X THEN Y ELSE Z END".*/
|
package/dist/sqlite/functions.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/sqlite/functions.ts
|
|
2
|
-
import { sql } from "../core/Sql.js";
|
|
3
2
|
import { Functions } from "../core/expr/Functions.js";
|
|
4
3
|
import { input } from "../core/expr/Input.js";
|
|
4
|
+
import { sql } from "../core/Sql.js";
|
|
5
5
|
var count = Functions.count;
|
|
6
6
|
var iif = Functions.iif;
|
|
7
7
|
var bm25 = Functions.bm25;
|
package/dist/sqlite.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export { foreignKey, primaryKey, unique } from './core/Constraint.js';
|
|
|
2
2
|
export { index, uniqueIndex } from './core/Index.js';
|
|
3
3
|
export { except, intersect, union, unionAll } from './core/query/Select.js';
|
|
4
4
|
export { alias, table as sqliteTable, tableCreator as sqliteTableCreator } from './core/Table.js';
|
|
5
|
+
export { view as sqliteView } from './core/View.js';
|
|
5
6
|
export * from './sqlite/builder.js';
|
|
6
7
|
export * from './sqlite/columns.js';
|
|
7
8
|
export * from './sqlite/dialect.js';
|
package/dist/sqlite.js
CHANGED
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
// src/sqlite.ts
|
|
2
2
|
import { foreignKey, primaryKey, unique } from "./core/Constraint.js";
|
|
3
3
|
import { index, uniqueIndex } from "./core/Index.js";
|
|
4
|
-
import {
|
|
5
|
-
except,
|
|
6
|
-
intersect,
|
|
7
|
-
union,
|
|
8
|
-
unionAll
|
|
9
|
-
} from "./core/query/Select.js";
|
|
4
|
+
import { except, intersect, union, unionAll } from "./core/query/Select.js";
|
|
10
5
|
import {
|
|
11
6
|
alias,
|
|
12
7
|
table,
|
|
13
8
|
tableCreator
|
|
14
9
|
} from "./core/Table.js";
|
|
10
|
+
import { view } from "./core/View.js";
|
|
15
11
|
export * from "./sqlite/builder.js";
|
|
16
12
|
export * from "./sqlite/columns.js";
|
|
17
13
|
export * from "./sqlite/dialect.js";
|
|
@@ -25,6 +21,7 @@ export {
|
|
|
25
21
|
primaryKey,
|
|
26
22
|
table as sqliteTable,
|
|
27
23
|
tableCreator as sqliteTableCreator,
|
|
24
|
+
view as sqliteView,
|
|
28
25
|
union,
|
|
29
26
|
unionAll,
|
|
30
27
|
unique,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function id(name?: string): Column<number>;
|
|
3
|
-
export declare function text(name?: string): Column<string
|
|
1
|
+
import { Column, JsonColumn } from '../core/Column.js';
|
|
2
|
+
export declare function id(name?: string): Column<number, [false, false]>;
|
|
3
|
+
export declare function text(name?: string): Column<string>;
|
|
4
4
|
export declare function varchar(name?: string, options?: {
|
|
5
5
|
length: number;
|
|
6
|
-
}): Column<string
|
|
7
|
-
export declare function integer(name?: string): Column<number
|
|
8
|
-
export declare function number(name?: string): Column<number
|
|
9
|
-
export declare function boolean(name?: string): Column<boolean
|
|
6
|
+
}): Column<string>;
|
|
7
|
+
export declare function integer(name?: string): Column<number>;
|
|
8
|
+
export declare function number(name?: string): Column<number>;
|
|
9
|
+
export declare function boolean(name?: string): Column<boolean>;
|
|
10
10
|
export declare function json<T>(name?: string): JsonColumn<T>;
|
|
11
11
|
export declare function jsonb<T>(name?: string): JsonColumn<T>;
|
|
12
|
-
export declare function blob(name?: string): Column<Uint8Array
|
|
12
|
+
export declare function blob(name?: string): Column<Uint8Array>;
|
|
@@ -1,44 +1,61 @@
|
|
|
1
1
|
// src/universal/columns.ts
|
|
2
|
-
import { JsonColumn, column } from "../core/Column.js";
|
|
2
|
+
import { Column, ColumnType, JsonColumn, column } from "../core/Column.js";
|
|
3
3
|
import { sql } from "../core/Sql.js";
|
|
4
|
-
var idType =
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
4
|
+
var idType = new ColumnType(
|
|
5
|
+
"id",
|
|
6
|
+
[],
|
|
7
|
+
sql.universal({
|
|
8
|
+
sqlite: sql`integer`,
|
|
9
|
+
postgres: sql`integer generated always as identity`,
|
|
10
|
+
mysql: sql`int not null auto_increment`
|
|
11
|
+
})
|
|
12
|
+
);
|
|
13
|
+
var blobType = new ColumnType(
|
|
14
|
+
"blob",
|
|
15
|
+
[],
|
|
16
|
+
sql.universal({
|
|
17
|
+
postgres: sql`bytea`,
|
|
18
|
+
default: sql`blob`
|
|
19
|
+
})
|
|
20
|
+
);
|
|
21
|
+
var numberType = new ColumnType(
|
|
22
|
+
"number",
|
|
23
|
+
[],
|
|
24
|
+
sql.universal({
|
|
25
|
+
mysql: sql`double`,
|
|
26
|
+
default: sql`numeric`
|
|
27
|
+
})
|
|
28
|
+
);
|
|
29
|
+
var jsonbType = new ColumnType(
|
|
30
|
+
"json",
|
|
31
|
+
[],
|
|
32
|
+
sql.universal({
|
|
33
|
+
mysql: sql`json`,
|
|
34
|
+
default: sql`jsonb`
|
|
35
|
+
})
|
|
36
|
+
);
|
|
21
37
|
function id(name) {
|
|
22
|
-
return
|
|
38
|
+
return new Column({
|
|
23
39
|
name,
|
|
24
40
|
type: idType,
|
|
25
|
-
primary: true
|
|
41
|
+
primary: true,
|
|
42
|
+
notNull: true
|
|
26
43
|
});
|
|
27
44
|
}
|
|
28
45
|
function text(name) {
|
|
29
|
-
return
|
|
46
|
+
return new Column({ name, type: column.text() });
|
|
30
47
|
}
|
|
31
48
|
function varchar(name, options) {
|
|
32
|
-
return
|
|
49
|
+
return new Column({ name, type: column.varchar(options?.length) });
|
|
33
50
|
}
|
|
34
51
|
function integer(name) {
|
|
35
|
-
return
|
|
52
|
+
return new Column({ name, type: column.integer() });
|
|
36
53
|
}
|
|
37
54
|
function number(name) {
|
|
38
|
-
return
|
|
55
|
+
return new Column({ name, type: numberType, mapFromDriverValue: Number });
|
|
39
56
|
}
|
|
40
57
|
function boolean(name) {
|
|
41
|
-
return
|
|
58
|
+
return new Column({
|
|
42
59
|
name,
|
|
43
60
|
type: column.boolean(),
|
|
44
61
|
mapFromDriverValue: Boolean
|
|
@@ -69,7 +86,7 @@ function jsonb(name) {
|
|
|
69
86
|
});
|
|
70
87
|
}
|
|
71
88
|
function blob(name) {
|
|
72
|
-
return
|
|
89
|
+
return new Column({
|
|
73
90
|
name,
|
|
74
91
|
type: blobType,
|
|
75
92
|
mapFromDriverValue(value) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Sql } from '../core/Sql.js';
|
|
2
1
|
import { type Input } from '../core/expr/Input.js';
|
|
2
|
+
import { type Sql } from '../core/Sql.js';
|
|
3
3
|
export declare function lastInsertId(): Sql<number>;
|
|
4
4
|
export declare function concat(...slices: Array<Input<string | null>>): Sql<string>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/universal/functions.ts
|
|
2
|
-
import { sql } from "../core/Sql.js";
|
|
3
2
|
import { Functions } from "../core/expr/Functions.js";
|
|
4
3
|
import { input } from "../core/expr/Input.js";
|
|
4
|
+
import { sql } from "../core/Sql.js";
|
|
5
5
|
var insertId = sql.universal({
|
|
6
6
|
sqlite: Functions.last_insert_rowid(),
|
|
7
7
|
postgres: Functions.lastval(),
|
package/package.json
CHANGED
|
@@ -1,55 +1,72 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rado",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0-preview.0",
|
|
4
4
|
"license": "MIT",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/benmerckx/rado"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"dist"
|
|
11
|
+
],
|
|
5
12
|
"type": "module",
|
|
13
|
+
"sideEffects": false,
|
|
14
|
+
"typesVersions": {
|
|
15
|
+
"*": {
|
|
16
|
+
"*": [
|
|
17
|
+
"./dist/*"
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"exports": {
|
|
22
|
+
"./package.json": "./package.json",
|
|
23
|
+
".": "./dist/index.js",
|
|
24
|
+
"./*": "./dist/*.js"
|
|
25
|
+
},
|
|
6
26
|
"scripts": {
|
|
7
27
|
"build": "rm -rf dist && tsc -p tsconfig.build.json && bun build.ts",
|
|
8
28
|
"size": "esbuild src/index.ts --bundle --minify --format=esm --outdir=dist",
|
|
9
29
|
"profile": "PROFILE=true bun build.ts && cd bin && (rimraf CPU*.cpuprofile || true) && node --cpu-prof --cpu-prof-interval=100 test && speedscope CPU*.cpuprofile",
|
|
10
30
|
"prepublishOnly": "bun run build",
|
|
11
31
|
"cycles": "madge --circular src/index.ts src/sqlite.ts src/mysql.ts src/postgres.ts",
|
|
32
|
+
"format": "oxfmt .",
|
|
33
|
+
"format:check": "oxfmt --check .",
|
|
34
|
+
"lint": "oxlint .",
|
|
35
|
+
"check": "bun run format:check && bun run lint",
|
|
12
36
|
"test:bun": "bun test",
|
|
13
37
|
"test:node": "node --test-force-exit --test-concurrency=1 --import tsx --test \"**/*.test.ts\"",
|
|
14
|
-
"test:deno": "deno test --node-modules-dir=false --no-check -A --unstable-ffi"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"exports": {
|
|
18
|
-
"./package.json": "./package.json",
|
|
19
|
-
".": "./dist/index.js",
|
|
20
|
-
"./*": "./dist/*.js"
|
|
21
|
-
},
|
|
22
|
-
"typesVersions": {
|
|
23
|
-
"*": {
|
|
24
|
-
"*": ["./dist/*"]
|
|
25
|
-
}
|
|
38
|
+
"test:deno": "deno test --node-modules-dir=false --no-check -A --unstable-ffi",
|
|
39
|
+
"docs:build": "bun docs/build.ts",
|
|
40
|
+
"docs:dev": "bun docs/build.ts --serve"
|
|
26
41
|
},
|
|
27
|
-
"files": ["dist"],
|
|
28
42
|
"devDependencies": {
|
|
29
|
-
"@alinea/suite": "^0.6.
|
|
30
|
-
"@
|
|
31
|
-
"@
|
|
32
|
-
"@
|
|
33
|
-
"@
|
|
34
|
-
"@
|
|
35
|
-
"@miniflare/
|
|
36
|
-
"@
|
|
37
|
-
"@
|
|
38
|
-
"@types/
|
|
39
|
-
"@types/
|
|
40
|
-
"@types/
|
|
41
|
-
"@types/
|
|
43
|
+
"@alinea/suite": "^0.6.3",
|
|
44
|
+
"@cloudflare/workers-types": "^4.20260610.1",
|
|
45
|
+
"@electric-sql/pglite": "^0.4.6",
|
|
46
|
+
"@fontsource/inter": "^5.2.8",
|
|
47
|
+
"@fontsource/jetbrains-mono": "^5.2.8",
|
|
48
|
+
"@libsql/client": "^0.17.3",
|
|
49
|
+
"@miniflare/d1": "^2.14.4",
|
|
50
|
+
"@miniflare/shared": "^2.14.4",
|
|
51
|
+
"@sqlite.org/sqlite-wasm": "^3.53.0-build1",
|
|
52
|
+
"@types/better-sqlite3": "^7.6.13",
|
|
53
|
+
"@types/bun": "^1.3.14",
|
|
54
|
+
"@types/glob": "^9.0.0",
|
|
55
|
+
"@types/pg": "^8.20.0",
|
|
56
|
+
"@types/sql.js": "^1.4.11",
|
|
42
57
|
"@vercel/postgres": "^0.10.0",
|
|
43
|
-
"better-sqlite3": "^11.
|
|
44
|
-
"esbuild": "^0.
|
|
45
|
-
"glob": "^11.
|
|
58
|
+
"better-sqlite3": "^11.10.0",
|
|
59
|
+
"esbuild": "^0.28.0",
|
|
60
|
+
"glob": "^11.1.0",
|
|
46
61
|
"madge": "^8.0.0",
|
|
47
|
-
"mysql2": "^3.
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
62
|
+
"mysql2": "^3.22.5",
|
|
63
|
+
"oxfmt": "^0.54.0",
|
|
64
|
+
"oxlint": "^1.69.0",
|
|
65
|
+
"pg": "^8.21.0",
|
|
66
|
+
"speedscope": "^1.25.0",
|
|
67
|
+
"sql.js": "^1.14.1",
|
|
68
|
+
"sqlite3": "^6.0.1",
|
|
69
|
+
"tsx": "^4.22.4",
|
|
70
|
+
"typescript": "^5.9.3"
|
|
54
71
|
}
|
|
55
72
|
}
|