@entro314labs/entro-auth-kysely-adapter 1.8.0-beta.13 → 1.8.0-beta.14
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/dist/index.d.mts +15 -1
- package/dist/index.mjs +9 -5
- package/package.json +5 -5
package/dist/index.d.mts
CHANGED
|
@@ -35,16 +35,18 @@ export type DatabaseIndexIntrospector = (tableNames: readonly string[]) => Promi
|
|
|
35
35
|
export declare function getKyselyDatabaseType(db: EntroAuthOptions["database"]): KyselyDatabaseType | null;
|
|
36
36
|
export declare const createKyselyAdapter: (config: EntroAuthOptions) => Promise<{
|
|
37
37
|
kysely: Kysely<any>;
|
|
38
|
-
databaseType: "
|
|
38
|
+
databaseType: "mssql" | "mysql" | "postgres" | "sqlite";
|
|
39
39
|
introspectIndexes: undefined;
|
|
40
40
|
schemaName: string | undefined;
|
|
41
41
|
transaction: boolean | undefined;
|
|
42
|
+
datesAsStrings: boolean | undefined;
|
|
42
43
|
} | {
|
|
43
44
|
kysely: Kysely<any> | null;
|
|
44
45
|
databaseType: KyselyDatabaseType | null;
|
|
45
46
|
introspectIndexes: DatabaseIndexIntrospector | undefined;
|
|
46
47
|
schemaName: undefined;
|
|
47
48
|
transaction: boolean | undefined;
|
|
49
|
+
datesAsStrings: undefined;
|
|
48
50
|
}>;
|
|
49
51
|
interface KyselyAdapterConfig {
|
|
50
52
|
/**
|
|
@@ -84,6 +86,18 @@ interface KyselyAdapterConfig {
|
|
|
84
86
|
* @default false
|
|
85
87
|
*/
|
|
86
88
|
transaction?: boolean | undefined;
|
|
89
|
+
/**
|
|
90
|
+
* Set when the database client hands timestamps over as strings and takes
|
|
91
|
+
* them as strings, as a postgres-js client with a pass-through
|
|
92
|
+
* `timestamptz` type does. Entro Auth then sends ISO 8601 strings in place
|
|
93
|
+
* of `Date` objects and turns the strings it reads back into dates, so the
|
|
94
|
+
* client an application already has can be shared.
|
|
95
|
+
*
|
|
96
|
+
* SQLite and SQL Server are always treated this way.
|
|
97
|
+
*
|
|
98
|
+
* @default false
|
|
99
|
+
*/
|
|
100
|
+
datesAsStrings?: boolean | undefined;
|
|
87
101
|
}
|
|
88
102
|
export declare const kyselyAdapter: (db: Kysely<any>, config?: KyselyAdapterConfig | undefined) => (options: EntroAuthOptions) => DBAdapter<EntroAuthOptions>;
|
|
89
103
|
/**
|
package/dist/index.mjs
CHANGED
|
@@ -35,7 +35,8 @@ const createKyselyAdapter = async (config) => {
|
|
|
35
35
|
databaseType: null,
|
|
36
36
|
introspectIndexes: void 0,
|
|
37
37
|
schemaName: void 0,
|
|
38
|
-
transaction: void 0
|
|
38
|
+
transaction: void 0,
|
|
39
|
+
datesAsStrings: void 0
|
|
39
40
|
};
|
|
40
41
|
if ("db" in db) {
|
|
41
42
|
const schemaName = db.schemaName;
|
|
@@ -45,7 +46,8 @@ const createKyselyAdapter = async (config) => {
|
|
|
45
46
|
databaseType: db.type,
|
|
46
47
|
introspectIndexes: void 0,
|
|
47
48
|
schemaName,
|
|
48
|
-
transaction: db.transaction
|
|
49
|
+
transaction: db.transaction,
|
|
50
|
+
datesAsStrings: db.datesAsStrings
|
|
49
51
|
};
|
|
50
52
|
}
|
|
51
53
|
if ("dialect" in db) {
|
|
@@ -57,7 +59,8 @@ const createKyselyAdapter = async (config) => {
|
|
|
57
59
|
databaseType: db.type,
|
|
58
60
|
introspectIndexes: void 0,
|
|
59
61
|
schemaName,
|
|
60
|
-
transaction: db.transaction
|
|
62
|
+
transaction: db.transaction,
|
|
63
|
+
datesAsStrings: db.datesAsStrings
|
|
61
64
|
};
|
|
62
65
|
}
|
|
63
66
|
let dialect = void 0;
|
|
@@ -111,7 +114,8 @@ const createKyselyAdapter = async (config) => {
|
|
|
111
114
|
databaseType,
|
|
112
115
|
introspectIndexes,
|
|
113
116
|
schemaName: void 0,
|
|
114
|
-
transaction
|
|
117
|
+
transaction,
|
|
118
|
+
datesAsStrings: void 0
|
|
115
119
|
};
|
|
116
120
|
};
|
|
117
121
|
// src/query-builders.ts
|
|
@@ -764,7 +768,7 @@ const kyselyAdapter = (db, config) => {
|
|
|
764
768
|
usePlural: config?.usePlural,
|
|
765
769
|
debugLogs: config?.debugLogs,
|
|
766
770
|
supportsBooleans: config?.type === "sqlite" || config?.type === "mssql" || config?.type === "mysql" || !config?.type ? false : true,
|
|
767
|
-
supportsDates: config?.type === "sqlite" || config?.type === "mssql" || !config?.type ? false : true,
|
|
771
|
+
supportsDates: config?.datesAsStrings || config?.type === "sqlite" || config?.type === "mssql" || !config?.type ? false : true,
|
|
768
772
|
supportsJSON: config?.type === "postgres" ? true : false,
|
|
769
773
|
supportsArrays: false,
|
|
770
774
|
supportsUUIDs: config?.type === "postgres" ? true : false,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@entro314labs/entro-auth-kysely-adapter",
|
|
3
|
-
"version": "1.8.0-beta.
|
|
3
|
+
"version": "1.8.0-beta.14",
|
|
4
4
|
"description": "Kysely adapter for Entro Auth",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
}
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"@entro314labs/entro-auth-core": "^1.8.0-beta.13",
|
|
44
43
|
"@better-auth/utils": "^0.4.2 || ^0.5.1",
|
|
44
|
+
"@entro314labs/entro-auth-core": "^1.8.0-beta.14",
|
|
45
45
|
"kysely": "^0.28.17 || ^0.29.9"
|
|
46
46
|
},
|
|
47
47
|
"peerDependenciesMeta": {
|
|
@@ -50,14 +50,14 @@
|
|
|
50
50
|
}
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@entro314labs/entro-auth-core": "1.8.0-beta.13",
|
|
54
53
|
"@better-auth/utils": "0.5.1",
|
|
55
|
-
"@cloudflare/workers-types": "^5.
|
|
54
|
+
"@cloudflare/workers-types": "^5.20261125.1",
|
|
55
|
+
"@entro314labs/entro-auth-core": "1.8.0-beta.14",
|
|
56
56
|
"@types/pg": "^8.23.1",
|
|
57
57
|
"kysely": "^0.28.17 || ^0.29.9",
|
|
58
58
|
"pg": "^8.23.1",
|
|
59
59
|
"tsdown": "0.23.7",
|
|
60
|
-
"typescript": "^
|
|
60
|
+
"typescript": "^7.0.2"
|
|
61
61
|
},
|
|
62
62
|
"scripts": {
|
|
63
63
|
"build": "tsdown",
|