@tailor-platform/create-sdk 1.11.1 → 1.13.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/CHANGELOG.md +4 -0
- package/package.json +1 -1
- package/templates/hello-world/package.json +1 -1
- package/templates/hello-world/src/generated/kysely-tailordb.ts +19 -46
- package/templates/inventory-management/package.json +1 -1
- package/templates/inventory-management/src/generated/kysely-tailordb.ts +19 -46
- package/templates/multi-application/package.json +1 -1
- package/templates/testing/package.json +1 -1
- package/templates/testing/src/generated/db.ts +19 -46
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
type
|
|
5
|
-
type
|
|
6
|
-
type
|
|
7
|
-
type
|
|
8
|
-
type
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
type Generated<T> = T extends ColumnType<infer S, infer I, infer U>
|
|
14
|
-
? ColumnType<S, I | undefined, U>
|
|
15
|
-
: ColumnType<T, T | undefined, T>;
|
|
2
|
+
createGetDB,
|
|
3
|
+
type Generated,
|
|
4
|
+
type Timestamp,
|
|
5
|
+
type NamespaceDB,
|
|
6
|
+
type NamespaceInsertable,
|
|
7
|
+
type NamespaceSelectable,
|
|
8
|
+
type NamespaceTable,
|
|
9
|
+
type NamespaceTableName,
|
|
10
|
+
type NamespaceTransaction,
|
|
11
|
+
type NamespaceUpdateable,
|
|
12
|
+
} from "@tailor-platform/sdk/kysely";
|
|
16
13
|
|
|
17
14
|
export interface Namespace {
|
|
18
15
|
"main-db": {
|
|
@@ -27,40 +24,16 @@ export interface Namespace {
|
|
|
27
24
|
}
|
|
28
25
|
}
|
|
29
26
|
|
|
30
|
-
export
|
|
31
|
-
namespace: N,
|
|
32
|
-
kyselyConfig?: Omit<KyselyConfig, "dialect">,
|
|
33
|
-
): Kysely<Namespace[N]> {
|
|
34
|
-
const client = new tailordb.Client({ namespace });
|
|
35
|
-
return new Kysely<Namespace[N]>({
|
|
36
|
-
dialect: new TailordbDialect(client),
|
|
37
|
-
...kyselyConfig,
|
|
38
|
-
});
|
|
39
|
-
}
|
|
27
|
+
export const getDB = createGetDB<Namespace>();
|
|
40
28
|
|
|
41
|
-
export type DB<N extends keyof Namespace = keyof Namespace> =
|
|
29
|
+
export type DB<N extends keyof Namespace = keyof Namespace> = NamespaceDB<Namespace, N>;
|
|
42
30
|
|
|
43
31
|
export type Transaction<K extends keyof Namespace | DB = keyof Namespace> =
|
|
44
|
-
|
|
45
|
-
? KyselyTransaction<Namespace[N]>
|
|
46
|
-
: K extends keyof Namespace
|
|
47
|
-
? KyselyTransaction<Namespace[K]>
|
|
48
|
-
: never;
|
|
32
|
+
NamespaceTransaction<Namespace, K>;
|
|
49
33
|
|
|
50
|
-
type TableName =
|
|
51
|
-
|
|
52
|
-
}[keyof Namespace];
|
|
53
|
-
export type Table<T extends TableName> = {
|
|
54
|
-
[N in keyof Namespace]: T extends keyof Namespace[N] ? Namespace[N][T]
|
|
55
|
-
: never;
|
|
56
|
-
}[keyof Namespace];
|
|
34
|
+
type TableName = NamespaceTableName<Namespace>;
|
|
35
|
+
export type Table<T extends TableName> = NamespaceTable<Namespace, T>;
|
|
57
36
|
|
|
58
|
-
export type Insertable<T extends
|
|
59
|
-
|
|
60
|
-
>;
|
|
61
|
-
export type Selectable<T extends keyof Namespace[keyof Namespace]> = KyselySelectable<
|
|
62
|
-
Table<T>
|
|
63
|
-
>;
|
|
64
|
-
export type Updateable<T extends keyof Namespace[keyof Namespace]> = KyselyUpdateable<
|
|
65
|
-
Table<T>
|
|
66
|
-
>;
|
|
37
|
+
export type Insertable<T extends TableName> = NamespaceInsertable<Namespace, T>;
|
|
38
|
+
export type Selectable<T extends TableName> = NamespaceSelectable<Namespace, T>;
|
|
39
|
+
export type Updateable<T extends TableName> = NamespaceUpdateable<Namespace, T>;
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@eslint/js": "9.39.2",
|
|
20
20
|
"@tailor-platform/function-types": "0.8.0",
|
|
21
|
-
"@tailor-platform/sdk": "1.
|
|
21
|
+
"@tailor-platform/sdk": "1.13.0",
|
|
22
22
|
"@types/node": "24.10.9",
|
|
23
23
|
"eslint": "9.39.2",
|
|
24
24
|
"eslint-plugin-oxlint": "1.39.0",
|
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
type
|
|
5
|
-
type
|
|
6
|
-
type
|
|
7
|
-
type
|
|
8
|
-
type
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
type Generated<T> = T extends ColumnType<infer S, infer I, infer U>
|
|
14
|
-
? ColumnType<S, I | undefined, U>
|
|
15
|
-
: ColumnType<T, T | undefined, T>;
|
|
2
|
+
createGetDB,
|
|
3
|
+
type Generated,
|
|
4
|
+
type Timestamp,
|
|
5
|
+
type NamespaceDB,
|
|
6
|
+
type NamespaceInsertable,
|
|
7
|
+
type NamespaceSelectable,
|
|
8
|
+
type NamespaceTable,
|
|
9
|
+
type NamespaceTableName,
|
|
10
|
+
type NamespaceTransaction,
|
|
11
|
+
type NamespaceUpdateable,
|
|
12
|
+
} from "@tailor-platform/sdk/kysely";
|
|
16
13
|
|
|
17
14
|
export interface Namespace {
|
|
18
15
|
"main-db": {
|
|
@@ -91,40 +88,16 @@ export interface Namespace {
|
|
|
91
88
|
}
|
|
92
89
|
}
|
|
93
90
|
|
|
94
|
-
export
|
|
95
|
-
namespace: N,
|
|
96
|
-
kyselyConfig?: Omit<KyselyConfig, "dialect">,
|
|
97
|
-
): Kysely<Namespace[N]> {
|
|
98
|
-
const client = new tailordb.Client({ namespace });
|
|
99
|
-
return new Kysely<Namespace[N]>({
|
|
100
|
-
dialect: new TailordbDialect(client),
|
|
101
|
-
...kyselyConfig,
|
|
102
|
-
});
|
|
103
|
-
}
|
|
91
|
+
export const getDB = createGetDB<Namespace>();
|
|
104
92
|
|
|
105
|
-
export type DB<N extends keyof Namespace = keyof Namespace> =
|
|
93
|
+
export type DB<N extends keyof Namespace = keyof Namespace> = NamespaceDB<Namespace, N>;
|
|
106
94
|
|
|
107
95
|
export type Transaction<K extends keyof Namespace | DB = keyof Namespace> =
|
|
108
|
-
|
|
109
|
-
? KyselyTransaction<Namespace[N]>
|
|
110
|
-
: K extends keyof Namespace
|
|
111
|
-
? KyselyTransaction<Namespace[K]>
|
|
112
|
-
: never;
|
|
96
|
+
NamespaceTransaction<Namespace, K>;
|
|
113
97
|
|
|
114
|
-
type TableName =
|
|
115
|
-
|
|
116
|
-
}[keyof Namespace];
|
|
117
|
-
export type Table<T extends TableName> = {
|
|
118
|
-
[N in keyof Namespace]: T extends keyof Namespace[N] ? Namespace[N][T]
|
|
119
|
-
: never;
|
|
120
|
-
}[keyof Namespace];
|
|
98
|
+
type TableName = NamespaceTableName<Namespace>;
|
|
99
|
+
export type Table<T extends TableName> = NamespaceTable<Namespace, T>;
|
|
121
100
|
|
|
122
|
-
export type Insertable<T extends
|
|
123
|
-
|
|
124
|
-
>;
|
|
125
|
-
export type Selectable<T extends keyof Namespace[keyof Namespace]> = KyselySelectable<
|
|
126
|
-
Table<T>
|
|
127
|
-
>;
|
|
128
|
-
export type Updateable<T extends keyof Namespace[keyof Namespace]> = KyselyUpdateable<
|
|
129
|
-
Table<T>
|
|
130
|
-
>;
|
|
101
|
+
export type Insertable<T extends TableName> = NamespaceInsertable<Namespace, T>;
|
|
102
|
+
export type Selectable<T extends TableName> = NamespaceSelectable<Namespace, T>;
|
|
103
|
+
export type Updateable<T extends TableName> = NamespaceUpdateable<Namespace, T>;
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@eslint/js": "9.39.2",
|
|
23
23
|
"@tailor-platform/function-types": "0.8.0",
|
|
24
|
-
"@tailor-platform/sdk": "1.
|
|
24
|
+
"@tailor-platform/sdk": "1.13.0",
|
|
25
25
|
"@types/node": "24.10.9",
|
|
26
26
|
"eslint": "9.39.2",
|
|
27
27
|
"eslint-plugin-oxlint": "1.39.0",
|
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
type
|
|
5
|
-
type
|
|
6
|
-
type
|
|
7
|
-
type
|
|
8
|
-
type
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
type Generated<T> = T extends ColumnType<infer S, infer I, infer U>
|
|
14
|
-
? ColumnType<S, I | undefined, U>
|
|
15
|
-
: ColumnType<T, T | undefined, T>;
|
|
2
|
+
createGetDB,
|
|
3
|
+
type Generated,
|
|
4
|
+
type Timestamp,
|
|
5
|
+
type NamespaceDB,
|
|
6
|
+
type NamespaceInsertable,
|
|
7
|
+
type NamespaceSelectable,
|
|
8
|
+
type NamespaceTable,
|
|
9
|
+
type NamespaceTableName,
|
|
10
|
+
type NamespaceTransaction,
|
|
11
|
+
type NamespaceUpdateable,
|
|
12
|
+
} from "@tailor-platform/sdk/kysely";
|
|
16
13
|
|
|
17
14
|
export interface Namespace {
|
|
18
15
|
"main-db": {
|
|
@@ -27,40 +24,16 @@ export interface Namespace {
|
|
|
27
24
|
}
|
|
28
25
|
}
|
|
29
26
|
|
|
30
|
-
export
|
|
31
|
-
namespace: N,
|
|
32
|
-
kyselyConfig?: Omit<KyselyConfig, "dialect">,
|
|
33
|
-
): Kysely<Namespace[N]> {
|
|
34
|
-
const client = new tailordb.Client({ namespace });
|
|
35
|
-
return new Kysely<Namespace[N]>({
|
|
36
|
-
dialect: new TailordbDialect(client),
|
|
37
|
-
...kyselyConfig,
|
|
38
|
-
});
|
|
39
|
-
}
|
|
27
|
+
export const getDB = createGetDB<Namespace>();
|
|
40
28
|
|
|
41
|
-
export type DB<N extends keyof Namespace = keyof Namespace> =
|
|
29
|
+
export type DB<N extends keyof Namespace = keyof Namespace> = NamespaceDB<Namespace, N>;
|
|
42
30
|
|
|
43
31
|
export type Transaction<K extends keyof Namespace | DB = keyof Namespace> =
|
|
44
|
-
|
|
45
|
-
? KyselyTransaction<Namespace[N]>
|
|
46
|
-
: K extends keyof Namespace
|
|
47
|
-
? KyselyTransaction<Namespace[K]>
|
|
48
|
-
: never;
|
|
32
|
+
NamespaceTransaction<Namespace, K>;
|
|
49
33
|
|
|
50
|
-
type TableName =
|
|
51
|
-
|
|
52
|
-
}[keyof Namespace];
|
|
53
|
-
export type Table<T extends TableName> = {
|
|
54
|
-
[N in keyof Namespace]: T extends keyof Namespace[N] ? Namespace[N][T]
|
|
55
|
-
: never;
|
|
56
|
-
}[keyof Namespace];
|
|
34
|
+
type TableName = NamespaceTableName<Namespace>;
|
|
35
|
+
export type Table<T extends TableName> = NamespaceTable<Namespace, T>;
|
|
57
36
|
|
|
58
|
-
export type Insertable<T extends
|
|
59
|
-
|
|
60
|
-
>;
|
|
61
|
-
export type Selectable<T extends keyof Namespace[keyof Namespace]> = KyselySelectable<
|
|
62
|
-
Table<T>
|
|
63
|
-
>;
|
|
64
|
-
export type Updateable<T extends keyof Namespace[keyof Namespace]> = KyselyUpdateable<
|
|
65
|
-
Table<T>
|
|
66
|
-
>;
|
|
37
|
+
export type Insertable<T extends TableName> = NamespaceInsertable<Namespace, T>;
|
|
38
|
+
export type Selectable<T extends TableName> = NamespaceSelectable<Namespace, T>;
|
|
39
|
+
export type Updateable<T extends TableName> = NamespaceUpdateable<Namespace, T>;
|