@type32/tauri-sqlite-orm 0.4.1-1 → 0.4.1-2
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 +1 -1
- package/dist/index.d.mts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +6 -7
- package/dist/index.mjs +6 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -47,7 +47,7 @@ const posts = sqliteTable('posts', {
|
|
|
47
47
|
id: integer('id').primaryKey().autoincrement(),
|
|
48
48
|
title: text('title').notNull(),
|
|
49
49
|
content: text('content').notNull(),
|
|
50
|
-
userId: integer('user_id').notNull().references(() => users.id, { onDelete: 'cascade' }),
|
|
50
|
+
userId: integer('user_id').notNull().references(() => users._.columns.id, { onDelete: 'cascade' }),
|
|
51
51
|
})
|
|
52
52
|
|
|
53
53
|
// Define relations
|
package/dist/index.d.mts
CHANGED
|
@@ -286,7 +286,12 @@ declare class SQLiteColumn<TName extends string = string, TType extends ColumnDa
|
|
|
286
286
|
primaryKey(): SQLiteColumn<TName, TType, TMode, true, THasDefault, TAutoincrement, TEnum, TCustomType>;
|
|
287
287
|
autoincrement(): SQLiteColumn<TName, TType, TMode, TNotNull, THasDefault, true, TEnum, TCustomType>;
|
|
288
288
|
unique(): SQLiteColumn<TName, TType, TMode, TNotNull, THasDefault, TAutoincrement, TEnum, TCustomType>;
|
|
289
|
-
/**
|
|
289
|
+
/**
|
|
290
|
+
* Lazy reference (Drizzle-style) - use getter to allow self-refs and forward refs.
|
|
291
|
+
* Use table._.columns.columnName (e.g. references(() => users._.columns.id)).
|
|
292
|
+
* For self-references, add explicit return type to fix TS7022/TS7024:
|
|
293
|
+
* references((): AnySQLiteColumn => messages._.columns.id)
|
|
294
|
+
*/
|
|
290
295
|
references(getRef: () => AnySQLiteColumn, options?: {
|
|
291
296
|
onDelete?: 'cascade' | 'set null' | 'set default' | 'restrict' | 'no action';
|
|
292
297
|
onUpdate?: 'cascade' | 'set null' | 'set default' | 'restrict' | 'no action';
|
package/dist/index.d.ts
CHANGED
|
@@ -286,7 +286,12 @@ declare class SQLiteColumn<TName extends string = string, TType extends ColumnDa
|
|
|
286
286
|
primaryKey(): SQLiteColumn<TName, TType, TMode, true, THasDefault, TAutoincrement, TEnum, TCustomType>;
|
|
287
287
|
autoincrement(): SQLiteColumn<TName, TType, TMode, TNotNull, THasDefault, true, TEnum, TCustomType>;
|
|
288
288
|
unique(): SQLiteColumn<TName, TType, TMode, TNotNull, THasDefault, TAutoincrement, TEnum, TCustomType>;
|
|
289
|
-
/**
|
|
289
|
+
/**
|
|
290
|
+
* Lazy reference (Drizzle-style) - use getter to allow self-refs and forward refs.
|
|
291
|
+
* Use table._.columns.columnName (e.g. references(() => users._.columns.id)).
|
|
292
|
+
* For self-references, add explicit return type to fix TS7022/TS7024:
|
|
293
|
+
* references((): AnySQLiteColumn => messages._.columns.id)
|
|
294
|
+
*/
|
|
290
295
|
references(getRef: () => AnySQLiteColumn, options?: {
|
|
291
296
|
onDelete?: 'cascade' | 'set null' | 'set default' | 'restrict' | 'no action';
|
|
292
297
|
onUpdate?: 'cascade' | 'set null' | 'set default' | 'restrict' | 'no action';
|
package/dist/index.js
CHANGED
|
@@ -1254,7 +1254,12 @@ var SQLiteColumn = class _SQLiteColumn {
|
|
|
1254
1254
|
unique() {
|
|
1255
1255
|
return new _SQLiteColumn(this._.name, this.type, { ...this.options, unique: true, mode: this._.mode });
|
|
1256
1256
|
}
|
|
1257
|
-
/**
|
|
1257
|
+
/**
|
|
1258
|
+
* Lazy reference (Drizzle-style) - use getter to allow self-refs and forward refs.
|
|
1259
|
+
* Use table._.columns.columnName (e.g. references(() => users._.columns.id)).
|
|
1260
|
+
* For self-references, add explicit return type to fix TS7022/TS7024:
|
|
1261
|
+
* references((): AnySQLiteColumn => messages._.columns.id)
|
|
1262
|
+
*/
|
|
1258
1263
|
references(getRef, options) {
|
|
1259
1264
|
return new _SQLiteColumn(
|
|
1260
1265
|
this._.name,
|
|
@@ -1300,12 +1305,6 @@ var sqliteTable = (tableName, columns) => {
|
|
|
1300
1305
|
for (const col of Object.values(columns)) {
|
|
1301
1306
|
col.__table = table;
|
|
1302
1307
|
}
|
|
1303
|
-
for (const key of Object.keys(columns)) {
|
|
1304
|
-
Object.defineProperty(table, key, {
|
|
1305
|
-
get: () => table._.columns[key],
|
|
1306
|
-
enumerable: true
|
|
1307
|
-
});
|
|
1308
|
-
}
|
|
1309
1308
|
return table;
|
|
1310
1309
|
};
|
|
1311
1310
|
var asc = (column) => import_kysely5.sql`${import_kysely5.sql.ref(column._.name)} ASC`;
|
package/dist/index.mjs
CHANGED
|
@@ -1158,7 +1158,12 @@ var SQLiteColumn = class _SQLiteColumn {
|
|
|
1158
1158
|
unique() {
|
|
1159
1159
|
return new _SQLiteColumn(this._.name, this.type, { ...this.options, unique: true, mode: this._.mode });
|
|
1160
1160
|
}
|
|
1161
|
-
/**
|
|
1161
|
+
/**
|
|
1162
|
+
* Lazy reference (Drizzle-style) - use getter to allow self-refs and forward refs.
|
|
1163
|
+
* Use table._.columns.columnName (e.g. references(() => users._.columns.id)).
|
|
1164
|
+
* For self-references, add explicit return type to fix TS7022/TS7024:
|
|
1165
|
+
* references((): AnySQLiteColumn => messages._.columns.id)
|
|
1166
|
+
*/
|
|
1162
1167
|
references(getRef, options) {
|
|
1163
1168
|
return new _SQLiteColumn(
|
|
1164
1169
|
this._.name,
|
|
@@ -1204,12 +1209,6 @@ var sqliteTable = (tableName, columns) => {
|
|
|
1204
1209
|
for (const col of Object.values(columns)) {
|
|
1205
1210
|
col.__table = table;
|
|
1206
1211
|
}
|
|
1207
|
-
for (const key of Object.keys(columns)) {
|
|
1208
|
-
Object.defineProperty(table, key, {
|
|
1209
|
-
get: () => table._.columns[key],
|
|
1210
|
-
enumerable: true
|
|
1211
|
-
});
|
|
1212
|
-
}
|
|
1213
1212
|
return table;
|
|
1214
1213
|
};
|
|
1215
1214
|
var asc = (column) => kyselySql`${kyselySql.ref(column._.name)} ASC`;
|