@kysera/timestamps 0.6.0 → 0.7.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 +6 -6
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @kysera/timestamps
|
|
2
2
|
|
|
3
|
-
> Automatic timestamp management plugin for Kysera
|
|
3
|
+
> Automatic timestamp management plugin for Kysera - Zero-configuration `created_at` and `updated_at` tracking with powerful query helpers.
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@kysera/timestamps)
|
|
6
6
|
[](https://opensource.org/licenses/MIT)
|
|
@@ -94,7 +94,7 @@ const db = new Kysely<Database>({
|
|
|
94
94
|
})
|
|
95
95
|
})
|
|
96
96
|
|
|
97
|
-
// Create
|
|
97
|
+
// Create plugin container with timestamps plugin
|
|
98
98
|
const orm = await createORM(db, [
|
|
99
99
|
timestampsPlugin() // ✨ That's it!
|
|
100
100
|
])
|
|
@@ -286,7 +286,7 @@ const plugin = timestampsPlugin({
|
|
|
286
286
|
})
|
|
287
287
|
|
|
288
288
|
// Generates: new Date()
|
|
289
|
-
// Best for: Native DATE columns,
|
|
289
|
+
// Best for: Native DATE columns, database compatibility
|
|
290
290
|
```
|
|
291
291
|
|
|
292
292
|
### Custom Timestamp Generator
|
|
@@ -924,7 +924,7 @@ function createUserRepository(executor: Executor<Database>) {
|
|
|
924
924
|
})
|
|
925
925
|
}
|
|
926
926
|
|
|
927
|
-
// Create
|
|
927
|
+
// Create plugin container with timestamps
|
|
928
928
|
const orm = await createORM(db, [timestampsPlugin()])
|
|
929
929
|
|
|
930
930
|
// Create repository (automatically extended)
|
|
@@ -1538,7 +1538,7 @@ const plugin = timestampsPlugin({
|
|
|
1538
1538
|
|
|
1539
1539
|
**Problem:** `userRepo.findRecentlyCreated` is undefined.
|
|
1540
1540
|
|
|
1541
|
-
**Solution:** Ensure you're using the
|
|
1541
|
+
**Solution:** Ensure you're using the plugin container's createRepository method:
|
|
1542
1542
|
|
|
1543
1543
|
```typescript
|
|
1544
1544
|
// ❌ Wrong: Direct factory (no plugin extensions)
|
|
@@ -1546,7 +1546,7 @@ const factory = createRepositoryFactory(db)
|
|
|
1546
1546
|
const userRepo = factory.create(/* ... */)
|
|
1547
1547
|
await userRepo.findRecentlyCreated() // ❌ Undefined
|
|
1548
1548
|
|
|
1549
|
-
// ✅ Correct:
|
|
1549
|
+
// ✅ Correct: Plugin container with plugins
|
|
1550
1550
|
const orm = await createORM(db, [timestampsPlugin()])
|
|
1551
1551
|
const userRepo = orm.createRepository((executor) => {
|
|
1552
1552
|
const factory = createRepositoryFactory(executor)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kysera/timestamps",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Automatic timestamp management plugin for
|
|
3
|
+
"version": "0.7.0",
|
|
4
|
+
"description": "Automatic timestamp management plugin for Kysely repositories",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
],
|
|
18
18
|
"keywords": [
|
|
19
19
|
"kysely",
|
|
20
|
-
"
|
|
20
|
+
"data-access",
|
|
21
21
|
"timestamps",
|
|
22
22
|
"created_at",
|
|
23
23
|
"updated_at",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"author": "Kysera Team",
|
|
28
28
|
"license": "MIT",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@kysera/core": "0.
|
|
30
|
+
"@kysera/core": "0.7.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@types/better-sqlite3": "^7.6.13",
|
|
@@ -39,12 +39,12 @@
|
|
|
39
39
|
"typescript": "^5.9.3",
|
|
40
40
|
"vitest": "^4.0.15",
|
|
41
41
|
"zod": "^4.1.13",
|
|
42
|
-
"@kysera/repository": "0.
|
|
42
|
+
"@kysera/repository": "0.7.0"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"kysely": ">=0.28.8",
|
|
46
46
|
"zod": "^4.1.13",
|
|
47
|
-
"@kysera/repository": "0.
|
|
47
|
+
"@kysera/repository": "0.7.0"
|
|
48
48
|
},
|
|
49
49
|
"peerDependenciesMeta": {
|
|
50
50
|
"zod": {
|