You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Fix stale db.now()/db.json() reference (now NOW/TODAY/CURRENT_*)
- Add connection pooling note to Driver Interface section
- Add relationship-traversing derive example (tags from postTags)
- Document compound foreign keys with example
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Are lazy getters (computed on access, not stored)
348
373
- Are non-enumerable (hidden from `Object.keys()` and `JSON.stringify()`)
349
374
- Must be pure functions (no I/O, no database queries)
350
-
-Only transform data already in the entity
375
+
-Can traverse resolved relationships from the same query
351
376
- Are fully typed via `Row<T>` inference
352
377
353
378
**Partial selects** with `pick()`:
@@ -776,6 +801,8 @@ interface Driver {
776
801
777
802
**Migration locking**: If the driver provides `withMigrationLock()`, migrations run atomically (PostgreSQL uses advisory locks, MySQL uses `GET_LOCK`, SQLite uses exclusive transactions).
778
803
804
+
**Connection pooling**: Handled by the underlying driver. `postgres.js` and `mysql2` pool automatically; `better-sqlite3` uses a single connection (SQLite is single-writer anyway).
805
+
779
806
## Error Handling
780
807
781
808
All errors extend `DatabaseError` with typed error codes:
@@ -905,13 +932,12 @@ import {
905
932
Transaction, // Transaction context (passed to transaction callbacks)
906
933
DatabaseUpgradeEvent, // Event object for "upgradeneeded" handler
907
934
908
-
// DB expressions
909
-
db, // Runtime DB expressions (db.now(), db.json(), etc.)
910
-
isDBExpression, // Type guard for DBExpression objects
911
-
912
-
// Custom field helpers
913
-
setDBMeta, // Set database metadata on a Zod schema
914
-
getDBMeta, // Get database metadata from a Zod schema
0 commit comments