@type32/tauri-sqlite-orm 0.1.5 → 0.1.7
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 +14 -6
- package/dist/index.js +19 -4
- package/dist/index.mjs +19 -4
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -56,6 +56,20 @@ const res = await db.query.users.findMany({
|
|
|
56
56
|
});
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
+
### Documentation
|
|
60
|
+
|
|
61
|
+
- See full docs in `docs/`:
|
|
62
|
+
- Getting Started: `docs/getting-started.md`
|
|
63
|
+
- Schema & Types: `docs/schema-and-types.md`
|
|
64
|
+
- Relations: `docs/relations.md`
|
|
65
|
+
- Queries (select): `docs/queries-select.md`
|
|
66
|
+
- CRUD (insert): `docs/crud-insert.md`
|
|
67
|
+
- CRUD (update): `docs/crud-update.md`
|
|
68
|
+
- CRUD (delete): `docs/crud-delete.md`
|
|
69
|
+
- SQL Helpers: `docs/sql-helpers.md`
|
|
70
|
+
- Indexes & Constraints: `docs/indexes-constraints.md`
|
|
71
|
+
- Migrations: `docs/migrations.md`
|
|
72
|
+
|
|
59
73
|
### Schema builder
|
|
60
74
|
|
|
61
75
|
Chainable, Drizzle-style:
|
|
@@ -236,12 +250,6 @@ export default defineNuxtPlugin(async () => {
|
|
|
236
250
|
});
|
|
237
251
|
```
|
|
238
252
|
|
|
239
|
-
### Roadmap
|
|
240
|
-
|
|
241
|
-
- Aliasing helpers and typed orderBy (asc(users.id)) for findMany
|
|
242
|
-
- Unique(), check(), composite primary/unique constraints
|
|
243
|
-
- Insert returning / batch returning (where feasible)
|
|
244
|
-
|
|
245
253
|
### License
|
|
246
254
|
|
|
247
255
|
MIT
|
package/dist/index.js
CHANGED
|
@@ -211,7 +211,10 @@ function increments(name) {
|
|
|
211
211
|
}
|
|
212
212
|
function unique(name) {
|
|
213
213
|
return {
|
|
214
|
-
on: (...cols) => ({
|
|
214
|
+
on: (...cols) => ({
|
|
215
|
+
name,
|
|
216
|
+
columns: cols.map((c) => c.name)
|
|
217
|
+
})
|
|
215
218
|
};
|
|
216
219
|
}
|
|
217
220
|
function primaryKey(opts) {
|
|
@@ -233,14 +236,26 @@ function foreignKey(opts) {
|
|
|
233
236
|
}
|
|
234
237
|
function index(name) {
|
|
235
238
|
return {
|
|
236
|
-
on: (...cols) => ({
|
|
239
|
+
on: (...cols) => ({
|
|
240
|
+
name,
|
|
241
|
+
columns: cols.map((c) => c.name)
|
|
242
|
+
}),
|
|
237
243
|
where: (expr) => ({ name, columns: [], where: expr })
|
|
238
244
|
};
|
|
239
245
|
}
|
|
240
246
|
function uniqueIndex(name) {
|
|
241
247
|
return {
|
|
242
|
-
on: (...cols) => ({
|
|
243
|
-
|
|
248
|
+
on: (...cols) => ({
|
|
249
|
+
name,
|
|
250
|
+
columns: cols.map((c) => c.name),
|
|
251
|
+
unique: true
|
|
252
|
+
}),
|
|
253
|
+
where: (expr) => ({
|
|
254
|
+
name,
|
|
255
|
+
columns: [],
|
|
256
|
+
unique: true,
|
|
257
|
+
where: expr
|
|
258
|
+
})
|
|
244
259
|
};
|
|
245
260
|
}
|
|
246
261
|
function defineTable(tableName, schema, extras) {
|
package/dist/index.mjs
CHANGED
|
@@ -133,7 +133,10 @@ function increments(name) {
|
|
|
133
133
|
}
|
|
134
134
|
function unique(name) {
|
|
135
135
|
return {
|
|
136
|
-
on: (...cols) => ({
|
|
136
|
+
on: (...cols) => ({
|
|
137
|
+
name,
|
|
138
|
+
columns: cols.map((c) => c.name)
|
|
139
|
+
})
|
|
137
140
|
};
|
|
138
141
|
}
|
|
139
142
|
function primaryKey(opts) {
|
|
@@ -155,14 +158,26 @@ function foreignKey(opts) {
|
|
|
155
158
|
}
|
|
156
159
|
function index(name) {
|
|
157
160
|
return {
|
|
158
|
-
on: (...cols) => ({
|
|
161
|
+
on: (...cols) => ({
|
|
162
|
+
name,
|
|
163
|
+
columns: cols.map((c) => c.name)
|
|
164
|
+
}),
|
|
159
165
|
where: (expr) => ({ name, columns: [], where: expr })
|
|
160
166
|
};
|
|
161
167
|
}
|
|
162
168
|
function uniqueIndex(name) {
|
|
163
169
|
return {
|
|
164
|
-
on: (...cols) => ({
|
|
165
|
-
|
|
170
|
+
on: (...cols) => ({
|
|
171
|
+
name,
|
|
172
|
+
columns: cols.map((c) => c.name),
|
|
173
|
+
unique: true
|
|
174
|
+
}),
|
|
175
|
+
where: (expr) => ({
|
|
176
|
+
name,
|
|
177
|
+
columns: [],
|
|
178
|
+
unique: true,
|
|
179
|
+
where: expr
|
|
180
|
+
})
|
|
166
181
|
};
|
|
167
182
|
}
|
|
168
183
|
function defineTable(tableName, schema, extras) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@type32/tauri-sqlite-orm",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "A Drizzle-like ORM for Tauri v2's SQL JS API plugin.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"drizzle"
|
|
27
27
|
],
|
|
28
28
|
"author": "Type-32",
|
|
29
|
-
"license": "
|
|
29
|
+
"license": "MIT",
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/node": "^24.3.0",
|
|
32
32
|
"tsup": "^8.5.0",
|