litedbmodel 2.2.9 → 2.2.11
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 +8 -5
- package/dist/DBHandler.d.ts +2 -28
- package/dist/DBHandler.d.ts.map +1 -1
- package/dist/DBHandler.js.map +1 -1
- package/dist/DBModel.d.ts +14 -12
- package/dist/DBModel.d.ts.map +1 -1
- package/dist/DBModel.js +71 -72
- package/dist/DBModel.js.map +1 -1
- package/dist/LazyRelation.d.ts +1 -0
- package/dist/LazyRelation.d.ts.map +1 -1
- package/dist/LazyRelation.js +17 -14
- package/dist/LazyRelation.js.map +1 -1
- package/dist/Middleware.d.ts +19 -17
- package/dist/Middleware.d.ts.map +1 -1
- package/dist/Middleware.js +30 -33
- package/dist/Middleware.js.map +1 -1
- package/dist/drivers/mysql.d.ts.map +1 -1
- package/dist/drivers/mysql.js +1 -0
- package/dist/drivers/mysql.js.map +1 -1
- package/dist/drivers/postgres.d.ts.map +1 -1
- package/dist/drivers/postgres.js +42 -22
- package/dist/drivers/postgres.js.map +1 -1
- package/dist/drivers/types.d.ts +2 -26
- package/dist/drivers/types.d.ts.map +1 -1
- package/dist/drivers/types.js.map +1 -1
- package/dist/index.cjs +224 -163
- package/dist/scp/connection-routing.d.ts +50 -18
- package/dist/scp/connection-routing.d.ts.map +1 -1
- package/dist/scp/connection-routing.js +55 -24
- package/dist/scp/connection-routing.js.map +1 -1
- package/dist/scp/dbmodel-runtime.d.ts +3 -0
- package/dist/scp/dbmodel-runtime.d.ts.map +1 -1
- package/dist/scp/dbmodel-runtime.js +2 -0
- package/dist/scp/dbmodel-runtime.js.map +1 -1
- package/dist/scp/exec-context.d.ts.map +1 -1
- package/dist/scp/exec-context.js +54 -46
- package/dist/scp/exec-context.js.map +1 -1
- package/dist/scp/index.cjs +99 -48
- package/dist/scp/index.mjs +96 -47
- package/dist/scp/makesql/pool-executor.d.ts +4 -1
- package/dist/scp/makesql/pool-executor.d.ts.map +1 -1
- package/dist/scp/makesql/pool-executor.js +21 -3
- package/dist/scp/makesql/pool-executor.js.map +1 -1
- package/dist/types.d.ts +9 -7
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/docs/BENCHMARK.md +1 -1
- package/docs/COMPARISON.md +2 -2
- package/docs/api/README.md +1 -1
- package/docs/api/classes/Conditions.md +1 -1
- package/docs/api/classes/DBHandler.md +16 -16
- package/docs/api/classes/DBModel.md +94 -93
- package/docs/api/classes/LimitExceededError.md +8 -8
- package/docs/api/classes/Middleware.md +35 -31
- package/docs/api/classes/SqlRaw.md +1 -1
- package/docs/api/classes/SqlRef.md +1 -1
- package/docs/api/classes/Values.md +1 -1
- package/docs/api/classes/WriteInReadOnlyContextError.md +5 -5
- package/docs/api/classes/WriteOutsideTransactionError.md +5 -5
- package/docs/api/functions/belongsTo.md +1 -1
- package/docs/api/functions/closeAllPools.md +2 -2
- package/docs/api/functions/condsToRecord.md +1 -1
- package/docs/api/functions/createMiddleware.md +4 -4
- package/docs/api/functions/createPostgresDriver.md +2 -2
- package/docs/api/functions/createSqliteDriver.md +1 -1
- package/docs/api/functions/dbCast.md +1 -1
- package/docs/api/functions/dbCastIn.md +1 -1
- package/docs/api/functions/dbDynamic.md +1 -1
- package/docs/api/functions/dbFalse.md +1 -1
- package/docs/api/functions/dbImmediate.md +1 -1
- package/docs/api/functions/dbIn.md +1 -1
- package/docs/api/functions/dbNotNull.md +1 -1
- package/docs/api/functions/dbNow.md +1 -1
- package/docs/api/functions/dbNull.md +1 -1
- package/docs/api/functions/dbRaw.md +1 -1
- package/docs/api/functions/dbTrue.md +1 -1
- package/docs/api/functions/dbUuid.md +1 -1
- package/docs/api/functions/dbUuidIn.md +1 -1
- package/docs/api/functions/formatLocalDate.md +1 -1
- package/docs/api/functions/formatUTCDate.md +1 -1
- package/docs/api/functions/getDBConfig.md +2 -2
- package/docs/api/functions/getDBHandler.md +2 -2
- package/docs/api/functions/getTransactionConnection.md +2 -2
- package/docs/api/functions/getTransactionContext.md +2 -2
- package/docs/api/functions/hasMany.md +1 -1
- package/docs/api/functions/hasOne.md +1 -1
- package/docs/api/functions/initDBHandler.md +2 -2
- package/docs/api/functions/isAnySqlFragment.md +1 -1
- package/docs/api/functions/isConnectionError.md +1 -1
- package/docs/api/functions/isSqlCondition.md +1 -1
- package/docs/api/functions/isSqlFragment.md +1 -1
- package/docs/api/functions/isSqlRaw.md +1 -1
- package/docs/api/functions/isSqlRef.md +1 -1
- package/docs/api/functions/isSqlTypedFragment.md +1 -1
- package/docs/api/functions/model.md +1 -1
- package/docs/api/functions/parentRef.md +1 -1
- package/docs/api/functions/sql.md +1 -1
- package/docs/api/globals.md +5 -5
- package/docs/api/interfaces/Column.md +1 -1
- package/docs/api/interfaces/ColumnDecorator.md +1 -1
- package/docs/api/interfaces/ColumnOptions.md +1 -1
- package/docs/api/interfaces/CreatedMiddlewareClass.md +7 -7
- package/docs/api/interfaces/DBConfig.md +29 -14
- package/docs/api/interfaces/DBConfigOptions.md +8 -8
- package/docs/api/interfaces/DeleteOptions.md +4 -4
- package/docs/api/interfaces/InsertOptions.md +8 -8
- package/docs/api/interfaces/LimitConfig.md +4 -4
- package/docs/api/interfaces/MiddlewareConfig.md +15 -15
- package/docs/api/interfaces/ModelClassDecorator.md +1 -1
- package/docs/api/interfaces/ModelOptions.md +1 -1
- package/docs/api/interfaces/PkeyResult.md +1 -1
- package/docs/api/interfaces/RelationDecorator.md +1 -1
- package/docs/api/interfaces/SelectOptions.md +17 -17
- package/docs/api/interfaces/SqlCondition.md +1 -1
- package/docs/api/interfaces/SqlFragment.md +1 -1
- package/docs/api/interfaces/SqlTypedFragment.md +1 -1
- package/docs/api/interfaces/TransactionOptions.md +7 -7
- package/docs/api/interfaces/UpdateManyOptions.md +4 -4
- package/docs/api/interfaces/UpdateOptions.md +4 -4
- package/package.json +2 -2
package/docs/api/globals.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
[**litedbmodel v2.2.
|
|
1
|
+
[**litedbmodel v2.2.11**](README.md)
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
5
|
-
# litedbmodel v2.2.
|
|
5
|
+
# litedbmodel v2.2.11
|
|
6
6
|
|
|
7
7
|
litedbmodel - A lightweight TypeScript data access layer
|
|
8
8
|
|
|
@@ -53,13 +53,13 @@ Supports PostgreSQL and SQLite databases.
|
|
|
53
53
|
### Other
|
|
54
54
|
|
|
55
55
|
- [Column](interfaces/Column.md)
|
|
56
|
-
- [DBConfig](interfaces/DBConfig.md)
|
|
57
56
|
- [MiddlewareConfig](interfaces/MiddlewareConfig.md)
|
|
58
57
|
- [CreatedMiddlewareClass](interfaces/CreatedMiddlewareClass.md)
|
|
59
58
|
- [SqlFragment](interfaces/SqlFragment.md)
|
|
60
59
|
- [SqlTypedFragment](interfaces/SqlTypedFragment.md)
|
|
61
60
|
- [SqlCondition](interfaces/SqlCondition.md)
|
|
62
61
|
- [ColumnOptions](interfaces/ColumnOptions.md)
|
|
62
|
+
- [DBConfig](interfaces/DBConfig.md)
|
|
63
63
|
- [SelectOptions](interfaces/SelectOptions.md)
|
|
64
64
|
- [InsertOptions](interfaces/InsertOptions.md)
|
|
65
65
|
- [UpdateOptions](interfaces/UpdateOptions.md)
|
|
@@ -114,7 +114,7 @@ type MiddlewareClass = {
|
|
|
114
114
|
};
|
|
115
115
|
```
|
|
116
116
|
|
|
117
|
-
Defined in: [Middleware.ts:
|
|
117
|
+
Defined in: [Middleware.ts:306](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Middleware.ts#L306)
|
|
118
118
|
|
|
119
119
|
Type for middleware class (not instance) — what [DBModel.use](classes/DBModel.md#use) registers.
|
|
120
120
|
|
|
@@ -139,7 +139,7 @@ runtime-correct call, and every stateful middleware in the README was affected.
|
|
|
139
139
|
getCurrentContext(): object;
|
|
140
140
|
```
|
|
141
141
|
|
|
142
|
-
Defined in: [Middleware.ts:
|
|
142
|
+
Defined in: [Middleware.ts:306](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Middleware.ts#L306)
|
|
143
143
|
|
|
144
144
|
###### Returns
|
|
145
145
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[**litedbmodel v2.2.
|
|
1
|
+
[**litedbmodel v2.2.11**](../README.md)
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Interface: CreatedMiddlewareClass\<S\>
|
|
8
8
|
|
|
9
|
-
Defined in: [Middleware.ts:
|
|
9
|
+
Defined in: [Middleware.ts:438](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Middleware.ts#L438)
|
|
10
10
|
|
|
11
11
|
Type for the middleware class created by createMiddleware.
|
|
12
12
|
Provides typed access to state via getCurrentContext().
|
|
@@ -25,7 +25,7 @@ Provides typed access to state via getCurrentContext().
|
|
|
25
25
|
new CreatedMiddlewareClass(): Middleware & S;
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
-
Defined in: [Middleware.ts:
|
|
28
|
+
Defined in: [Middleware.ts:448](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Middleware.ts#L448)
|
|
29
29
|
|
|
30
30
|
Constructor
|
|
31
31
|
|
|
@@ -41,7 +41,7 @@ Constructor
|
|
|
41
41
|
getCurrentContext(): S;
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
-
Defined in: [Middleware.ts:
|
|
44
|
+
Defined in: [Middleware.ts:440](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Middleware.ts#L440)
|
|
45
45
|
|
|
46
46
|
Get the current request's state (creates new instance if none exists)
|
|
47
47
|
|
|
@@ -57,7 +57,7 @@ Get the current request's state (creates new instance if none exists)
|
|
|
57
57
|
run<R>(fn: () => R): R;
|
|
58
58
|
```
|
|
59
59
|
|
|
60
|
-
Defined in: [Middleware.ts:
|
|
60
|
+
Defined in: [Middleware.ts:442](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Middleware.ts#L442)
|
|
61
61
|
|
|
62
62
|
Run a function with a fresh middleware context
|
|
63
63
|
|
|
@@ -85,7 +85,7 @@ Run a function with a fresh middleware context
|
|
|
85
85
|
hasContext(): boolean;
|
|
86
86
|
```
|
|
87
87
|
|
|
88
|
-
Defined in: [Middleware.ts:
|
|
88
|
+
Defined in: [Middleware.ts:444](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Middleware.ts#L444)
|
|
89
89
|
|
|
90
90
|
Check if a context exists for the current request
|
|
91
91
|
|
|
@@ -101,7 +101,7 @@ Check if a context exists for the current request
|
|
|
101
101
|
clearContext(): void;
|
|
102
102
|
```
|
|
103
103
|
|
|
104
|
-
Defined in: [Middleware.ts:
|
|
104
|
+
Defined in: [Middleware.ts:446](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Middleware.ts#L446)
|
|
105
105
|
|
|
106
106
|
Clear the current context (useful for testing)
|
|
107
107
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[**litedbmodel v2.2.
|
|
1
|
+
[**litedbmodel v2.2.11**](../README.md)
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
@@ -6,22 +6,37 @@
|
|
|
6
6
|
|
|
7
7
|
# Interface: DBConfig
|
|
8
8
|
|
|
9
|
-
Defined in: [
|
|
9
|
+
Defined in: [types.ts:93](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L93)
|
|
10
10
|
|
|
11
|
-
Database configuration
|
|
11
|
+
Database connection configuration.
|
|
12
|
+
Used in `DBConfigOptions.config` and `DBConfigOptions.writerConfig`.
|
|
13
|
+
|
|
14
|
+
## Example
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
const config: DBConfig = {
|
|
18
|
+
driver: 'postgres',
|
|
19
|
+
host: 'localhost',
|
|
20
|
+
port: 5432,
|
|
21
|
+
database: 'mydb',
|
|
22
|
+
user: 'user',
|
|
23
|
+
password: 'pass',
|
|
24
|
+
};
|
|
25
|
+
```
|
|
12
26
|
|
|
13
27
|
## Properties
|
|
14
28
|
|
|
15
29
|
| Property | Type | Description | Defined in |
|
|
16
30
|
| ------ | ------ | ------ | ------ |
|
|
17
|
-
| <a id="
|
|
18
|
-
| <a id="
|
|
19
|
-
| <a id="
|
|
20
|
-
| <a id="
|
|
21
|
-
| <a id="
|
|
22
|
-
| <a id="
|
|
23
|
-
| <a id="
|
|
24
|
-
| <a id="
|
|
25
|
-
| <a id="
|
|
26
|
-
| <a id="
|
|
27
|
-
| <a id="
|
|
31
|
+
| <a id="driver"></a> `driver?` | `"postgres"` \| `"sqlite"` \| `"mysql"` | Database driver: 'postgres' (default), 'sqlite', or 'mysql' | [types.ts:95](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L95) |
|
|
32
|
+
| <a id="host"></a> `host?` | `string` | Database host (for server-based DBs like PostgreSQL) | [types.ts:97](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L97) |
|
|
33
|
+
| <a id="port"></a> `port?` | `number` | Database port | [types.ts:99](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L99) |
|
|
34
|
+
| <a id="database"></a> `database` | `string` | Database name or file path (for SQLite) | [types.ts:101](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L101) |
|
|
35
|
+
| <a id="user"></a> `user?` | `string` | Username | [types.ts:103](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L103) |
|
|
36
|
+
| <a id="password"></a> `password?` | `string` | Password | [types.ts:105](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L105) |
|
|
37
|
+
| <a id="max"></a> `max?` | `number` | Maximum pool size | [types.ts:107](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L107) |
|
|
38
|
+
| <a id="timeout"></a> `timeout?` | `number` | Seconds allowed for getting a connection (default: 30). With PostgreSQL this also bounds the wait for a free connection when the pool is at `max`. | [types.ts:112](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L112) |
|
|
39
|
+
| <a id="idletimeoutmillis"></a> `idleTimeoutMillis?` | `number` | Milliseconds an unused pooled connection stays open before it is closed (default: 10000) | [types.ts:114](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L114) |
|
|
40
|
+
| <a id="querytimeout"></a> `queryTimeout?` | `number` | Query timeout in seconds | [types.ts:116](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L116) |
|
|
41
|
+
| <a id="keepalive"></a> `keepAlive?` | `boolean` | Enable TCP keepalive on connections (recommended for serverless/Lambda) | [types.ts:118](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L118) |
|
|
42
|
+
| <a id="keepaliveinitialdelaymillis"></a> `keepAliveInitialDelayMillis?` | `number` | Delay in milliseconds before first keepalive probe (default: 10000) | [types.ts:120](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L120) |
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[**litedbmodel v2.2.
|
|
1
|
+
[**litedbmodel v2.2.11**](../README.md)
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Interface: DBConfigOptions
|
|
8
8
|
|
|
9
|
-
Defined in: [types.ts:
|
|
9
|
+
Defined in: [types.ts:292](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L292)
|
|
10
10
|
|
|
11
11
|
Options for database configuration.
|
|
12
12
|
Used with DBModel.setConfig() and DBModel.createDBBase().
|
|
@@ -15,9 +15,9 @@ Used with DBModel.setConfig() and DBModel.createDBBase().
|
|
|
15
15
|
|
|
16
16
|
| Property | Type | Description | Defined in |
|
|
17
17
|
| ------ | ------ | ------ | ------ |
|
|
18
|
-
| <a id="writerconfig"></a> `writerConfig?` | `DBConfig` | Writer database configuration for reader/writer separation | [types.ts:
|
|
19
|
-
| <a id="logger"></a> `logger?` | `Logger` | Logger instance | [types.ts:
|
|
20
|
-
| <a id="findhardlimit"></a> `findHardLimit?` | `number` \| `null` | Hard limit for find() - throws if exceeded | [types.ts:
|
|
21
|
-
| <a id="hasmanyhardlimit"></a> `hasManyHardLimit?` | `number` \| `null` | Hard limit for hasMany lazy loading - throws if exceeded | [types.ts:
|
|
22
|
-
| <a id="usewriteraftertransaction"></a> `useWriterAfterTransaction?` | `boolean` | Keep using writer connection after transaction completes. Helps avoid stale reads due to replication lag. **Default** `true` | [types.ts:
|
|
23
|
-
| <a id="writerstickyduration"></a> `writerStickyDuration?` | `number` | Duration (in milliseconds) to keep using writer after transaction. Only applies when useWriterAfterTransaction is true. **Default** `5000` | [types.ts:
|
|
18
|
+
| <a id="writerconfig"></a> `writerConfig?` | [`DBConfig`](DBConfig.md) | Writer database configuration for reader/writer separation | [types.ts:294](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L294) |
|
|
19
|
+
| <a id="logger"></a> `logger?` | `Logger` | Logger instance | [types.ts:296](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L296) |
|
|
20
|
+
| <a id="findhardlimit"></a> `findHardLimit?` | `number` \| `null` | Hard limit for find() - throws if exceeded | [types.ts:298](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L298) |
|
|
21
|
+
| <a id="hasmanyhardlimit"></a> `hasManyHardLimit?` | `number` \| `null` | Hard limit for hasMany lazy loading - throws if exceeded | [types.ts:300](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L300) |
|
|
22
|
+
| <a id="usewriteraftertransaction"></a> `useWriterAfterTransaction?` | `boolean` | Keep using writer connection after transaction completes. Helps avoid stale reads due to replication lag. **Default** `true` | [types.ts:306](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L306) |
|
|
23
|
+
| <a id="writerstickyduration"></a> `writerStickyDuration?` | `number` | Duration (in milliseconds) to keep using writer after transaction. Only applies when useWriterAfterTransaction is true. **Default** `5000` | [types.ts:312](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L312) |
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[**litedbmodel v2.2.
|
|
1
|
+
[**litedbmodel v2.2.11**](../README.md)
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
|
|
7
7
|
# Interface: DeleteOptions
|
|
8
8
|
|
|
9
|
-
Defined in: [types.ts:
|
|
9
|
+
Defined in: [types.ts:224](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L224)
|
|
10
10
|
|
|
11
11
|
## Properties
|
|
12
12
|
|
|
13
13
|
| Property | Type | Description | Defined in |
|
|
14
14
|
| ------ | ------ | ------ | ------ |
|
|
15
|
-
| <a id="tablename"></a> `tableName?` | `string` | - | [types.ts:
|
|
16
|
-
| <a id="returning"></a> `returning?` | `boolean` | If true, return PkeyResult with affected primary keys. If false (default), return null for better performance. | [types.ts:
|
|
15
|
+
| <a id="tablename"></a> `tableName?` | `string` | - | [types.ts:225](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L225) |
|
|
16
|
+
| <a id="returning"></a> `returning?` | `boolean` | If true, return PkeyResult with affected primary keys. If false (default), return null for better performance. | [types.ts:230](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L230) |
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[**litedbmodel v2.2.
|
|
1
|
+
[**litedbmodel v2.2.11**](../README.md)
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Interface: InsertOptions\<Model\>
|
|
8
8
|
|
|
9
|
-
Defined in: [types.ts:
|
|
9
|
+
Defined in: [types.ts:177](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L177)
|
|
10
10
|
|
|
11
11
|
Insert options with type-safe column references.
|
|
12
12
|
|
|
@@ -20,9 +20,9 @@ Insert options with type-safe column references.
|
|
|
20
20
|
|
|
21
21
|
| Property | Type | Description | Defined in |
|
|
22
22
|
| ------ | ------ | ------ | ------ |
|
|
23
|
-
| <a id="tablename"></a> `tableName?` | `string` | - | [types.ts:
|
|
24
|
-
| <a id="returning"></a> `returning?` | `boolean` | If true, return PkeyResult with affected primary keys. If false (default), return null for better performance. | [types.ts:
|
|
25
|
-
| <a id="conflict"></a> ~~`conflict?`~~ | `string` | **Deprecated** Use onConflict instead | [types.ts:
|
|
26
|
-
| <a id="onconflict"></a> `onConflict?` | \| [`Column`](Column.md)\<`unknown`, `Model`\> \| [`Column`](Column.md)\<`unknown`, `Model`\>[] | Columns for ON CONFLICT clause (unique constraint columns). Must be Column symbols from the same model for type safety. **Example** `// Single column onConflict: User.email // Multiple columns (composite unique constraint) onConflict: [UserPref.user_id, UserPref.key]` | [types.ts:
|
|
27
|
-
| <a id="onconflictupdate"></a> `onConflictUpdate?` |
|
|
28
|
-
| <a id="onconflictignore"></a> `onConflictIgnore?` | `boolean` | If true, ignore the insert on conflict (DO NOTHING). Cannot be used with onConflictUpdate. | [types.ts:
|
|
23
|
+
| <a id="tablename"></a> `tableName?` | `string` | - | [types.ts:178](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L178) |
|
|
24
|
+
| <a id="returning"></a> `returning?` | `boolean` | If true, return PkeyResult with affected primary keys. If false (default), return null for better performance. | [types.ts:183](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L183) |
|
|
25
|
+
| <a id="conflict"></a> ~~`conflict?`~~ | `string` | **Deprecated** Use onConflict instead | [types.ts:185](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L185) |
|
|
26
|
+
| <a id="onconflict"></a> `onConflict?` | \| [`Column`](Column.md)\<`unknown`, `Model`\> \| [`Column`](Column.md)\<`unknown`, `Model`\>[] | Columns for ON CONFLICT clause (unique constraint columns). Must be Column symbols from the same model for type safety. **Example** `// Single column onConflict: User.email // Multiple columns (composite unique constraint) onConflict: [UserPref.user_id, UserPref.key]` | [types.ts:195](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L195) |
|
|
27
|
+
| <a id="onconflictupdate"></a> `onConflictUpdate?` | [`Column`](Column.md)\<`unknown`, `Model`\>[] \| `"all"` | Columns to update on conflict. Can be: - 'all': Update all inserted columns - Array of Column symbols from the same model **Example** `// Update all columns onConflictUpdate: 'all' // Update specific columns onConflictUpdate: [User.name, User.updated_at]` | [types.ts:207](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L207) |
|
|
28
|
+
| <a id="onconflictignore"></a> `onConflictIgnore?` | `boolean` | If true, ignore the insert on conflict (DO NOTHING). Cannot be used with onConflictUpdate. | [types.ts:212](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L212) |
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[**litedbmodel v2.2.
|
|
1
|
+
[**litedbmodel v2.2.11**](../README.md)
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Interface: LimitConfig
|
|
8
8
|
|
|
9
|
-
Defined in: [types.ts:
|
|
9
|
+
Defined in: [types.ts:347](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L347)
|
|
10
10
|
|
|
11
11
|
Configuration for query result limits.
|
|
12
12
|
Used to prevent accidentally loading too many records.
|
|
@@ -15,5 +15,5 @@ Used to prevent accidentally loading too many records.
|
|
|
15
15
|
|
|
16
16
|
| Property | Type | Description | Defined in |
|
|
17
17
|
| ------ | ------ | ------ | ------ |
|
|
18
|
-
| <a id="findhardlimit"></a> `findHardLimit?` | `number` \| `null` | Hard limit for find() queries. If a query returns more than this many records, an exception is thrown. Set to null to disable. **Default** `null (no limit)` | [types.ts:
|
|
19
|
-
| <a id="hasmanyhardlimit"></a> `hasManyHardLimit?` | `number` \| `null` | Hard limit for hasMany relation loading (batch total). If a hasMany batch load returns more than this many records in total, an exception is thrown. Set to null to disable. **Default** `null (no limit)` | [types.ts:
|
|
18
|
+
| <a id="findhardlimit"></a> `findHardLimit?` | `number` \| `null` | Hard limit for find() queries. If a query returns more than this many records, an exception is thrown. Set to null to disable. **Default** `null (no limit)` | [types.ts:354](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L354) |
|
|
19
|
+
| <a id="hasmanyhardlimit"></a> `hasManyHardLimit?` | `number` \| `null` | Hard limit for hasMany relation loading (batch total). If a hasMany batch load returns more than this many records in total, an exception is thrown. Set to null to disable. **Default** `null (no limit)` | [types.ts:363](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L363) |
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[**litedbmodel v2.2.
|
|
1
|
+
[**litedbmodel v2.2.11**](../README.md)
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Interface: MiddlewareConfig\<S\>
|
|
8
8
|
|
|
9
|
-
Defined in: [Middleware.ts:
|
|
9
|
+
Defined in: [Middleware.ts:322](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Middleware.ts#L322)
|
|
10
10
|
|
|
11
11
|
Configuration object for createMiddleware.
|
|
12
12
|
All hook functions receive `this` bound to the state object.
|
|
@@ -25,16 +25,16 @@ Hook signature matches the Middleware class:
|
|
|
25
25
|
|
|
26
26
|
| Property | Type | Description | Defined in |
|
|
27
27
|
| ------ | ------ | ------ | ------ |
|
|
28
|
-
| <a id="state"></a> `state?` | `S` | Initial state for each request context. A fresh copy is created for each request via structuredClone. Access via `this` in hook functions or `getCurrentContext()`. | [Middleware.ts:
|
|
29
|
-
| <a id="init"></a> `init?` | (`this`: `S`) => `void` | Called when a new context is created | [Middleware.ts:
|
|
30
|
-
| <a id="find"></a> `find?` | \<`T`\>(`this`: `S`, `model`: `T`, `next`: `NextFind`\<`T`\>, `conditions`: `Conds`, `options?`: [`SelectOptions`](SelectOptions.md)) => `Promise`\<`InstanceType`\<`T`\>[]\> | Intercept find() | [Middleware.ts:
|
|
31
|
-
| <a id="findone"></a> `findOne?` | \<`T`\>(`this`: `S`, `model`: `T`, `next`: `NextFindOne`\<`T`\>, `conditions`: `Conds`, `options?`: [`SelectOptions`](SelectOptions.md)) => `Promise`\<`InstanceType`\<`T`\> \| `null`\> | Intercept findOne() | [Middleware.ts:
|
|
32
|
-
| <a id="findbyid"></a> `findById?` | \<`T`\>(`this`: `S`, `model`: `T`, `next`: `NextFindById`\<`T`\>, `id`: `unknown`, `options?`: [`SelectOptions`](SelectOptions.md)) => `Promise`\<`InstanceType`\<`T`\>[]\> | Intercept findById() | [Middleware.ts:
|
|
33
|
-
| <a id="count"></a> `count?` | \<`T`\>(`this`: `S`, `model`: `T`, `next`: `NextCount`, `conditions`: `Conds`) => `Promise`\<`number`\> | Intercept count() | [Middleware.ts:
|
|
34
|
-
| <a id="create"></a> `create?` | \<`T`\>(`this`: `S`, `model`: `T`, `next`: `NextCreate`, `pairs`: readonly readonly \[[`Column`](Column.md)\<`any`, `any`\>, `any`\][], `options?`: [`InsertOptions`](InsertOptions.md)\<`unknown`\>) => `Promise`\<[`PkeyResult`](PkeyResult.md) \| `null`\> | Intercept create() | [Middleware.ts:
|
|
35
|
-
| <a id="createmany"></a> `createMany?` | \<`T`\>(`this`: `S`, `model`: `T`, `next`: `NextCreateMany`, `pairsArray`: readonly readonly readonly \[[`Column`](Column.md)\<`any`, `any`\>, `any`\][][], `options?`: [`InsertOptions`](InsertOptions.md)\<`unknown`\>) => `Promise`\<[`PkeyResult`](PkeyResult.md) \| `null`\> | Intercept createMany() | [Middleware.ts:
|
|
36
|
-
| <a id="update"></a> `update?` | \<`T`\>(`this`: `S`, `model`: `T`, `next`: `NextUpdate`, `conditions`: `Conds`, `values`: readonly readonly \[[`Column`](Column.md)\<`any`, `any`\>, `any`\][], `options?`: [`UpdateOptions`](UpdateOptions.md)) => `Promise`\<[`PkeyResult`](PkeyResult.md) \| `null`\> | Intercept update() | [Middleware.ts:
|
|
37
|
-
| <a id="updatemany"></a> `updateMany?` | \<`T`\>(`this`: `S`, `model`: `T`, `next`: `NextUpdateMany`, `records`: readonly readonly readonly \[[`Column`](Column.md)\<`any`, `any`\>, `any`\][][], `options?`: [`UpdateManyOptions`](UpdateManyOptions.md)) => `Promise`\<[`PkeyResult`](PkeyResult.md) \| `null`\> | Intercept updateMany() | [Middleware.ts:
|
|
38
|
-
| <a id="delete"></a> `delete?` | \<`T`\>(`this`: `S`, `model`: `T`, `next`: `NextDelete`, `conditions`: `Conds`, `options?`: [`DeleteOptions`](DeleteOptions.md)) => `Promise`\<[`PkeyResult`](PkeyResult.md) \| `null`\> | Intercept delete() | [Middleware.ts:
|
|
39
|
-
| <a id="execute"></a> `execute?` | (`this`: `S`, `next`: `NextExecute`, `sql`: `string`, `params?`: `unknown`[]) => `Promise`\<`ExecuteResult`\> | Intercept execute() - lowest level, catches ALL SQL queries | [Middleware.ts:
|
|
40
|
-
| <a id="query"></a> `query?` | \<`T`\>(`this`: `S`, `model`: `T`, `next`: `NextQuery`\<`T`\>, `sql`: `string`, `params?`: `unknown`[]) => `Promise`\<`InstanceType`\<`T`\>[]\> | Intercept query() - catches raw SQL that returns model instances | [Middleware.ts:
|
|
28
|
+
| <a id="state"></a> `state?` | `S` | Initial state for each request context. A fresh copy is created for each request via structuredClone. Access via `this` in hook functions or `getCurrentContext()`. | [Middleware.ts:328](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Middleware.ts#L328) |
|
|
29
|
+
| <a id="init"></a> `init?` | (`this`: `S`) => `void` | Called when a new context is created | [Middleware.ts:331](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Middleware.ts#L331) |
|
|
30
|
+
| <a id="find"></a> `find?` | \<`T`\>(`this`: `S`, `model`: `T`, `next`: `NextFind`\<`T`\>, `conditions`: `Conds`, `options?`: [`SelectOptions`](SelectOptions.md)) => `Promise`\<`InstanceType`\<`T`\>[]\> | Intercept find() | [Middleware.ts:334](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Middleware.ts#L334) |
|
|
31
|
+
| <a id="findone"></a> `findOne?` | \<`T`\>(`this`: `S`, `model`: `T`, `next`: `NextFindOne`\<`T`\>, `conditions`: `Conds`, `options?`: [`SelectOptions`](SelectOptions.md)) => `Promise`\<`InstanceType`\<`T`\> \| `null`\> | Intercept findOne() | [Middleware.ts:343](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Middleware.ts#L343) |
|
|
32
|
+
| <a id="findbyid"></a> `findById?` | \<`T`\>(`this`: `S`, `model`: `T`, `next`: `NextFindById`\<`T`\>, `id`: `unknown`, `options?`: [`SelectOptions`](SelectOptions.md)) => `Promise`\<`InstanceType`\<`T`\>[]\> | Intercept findById() | [Middleware.ts:352](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Middleware.ts#L352) |
|
|
33
|
+
| <a id="count"></a> `count?` | \<`T`\>(`this`: `S`, `model`: `T`, `next`: `NextCount`, `conditions`: `Conds`) => `Promise`\<`number`\> | Intercept count() | [Middleware.ts:361](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Middleware.ts#L361) |
|
|
34
|
+
| <a id="create"></a> `create?` | \<`T`\>(`this`: `S`, `model`: `T`, `next`: `NextCreate`, `pairs`: readonly readonly \[[`Column`](Column.md)\<`any`, `any`\>, `any`\][], `options?`: [`InsertOptions`](InsertOptions.md)\<`unknown`\>) => `Promise`\<[`PkeyResult`](PkeyResult.md) \| `null`\> | Intercept create() | [Middleware.ts:369](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Middleware.ts#L369) |
|
|
35
|
+
| <a id="createmany"></a> `createMany?` | \<`T`\>(`this`: `S`, `model`: `T`, `next`: `NextCreateMany`, `pairsArray`: readonly readonly readonly \[[`Column`](Column.md)\<`any`, `any`\>, `any`\][][], `options?`: [`InsertOptions`](InsertOptions.md)\<`unknown`\>) => `Promise`\<[`PkeyResult`](PkeyResult.md) \| `null`\> | Intercept createMany() | [Middleware.ts:378](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Middleware.ts#L378) |
|
|
36
|
+
| <a id="update"></a> `update?` | \<`T`\>(`this`: `S`, `model`: `T`, `next`: `NextUpdate`, `conditions`: `Conds`, `values`: readonly readonly \[[`Column`](Column.md)\<`any`, `any`\>, `any`\][], `options?`: [`UpdateOptions`](UpdateOptions.md)) => `Promise`\<[`PkeyResult`](PkeyResult.md) \| `null`\> | Intercept update() | [Middleware.ts:387](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Middleware.ts#L387) |
|
|
37
|
+
| <a id="updatemany"></a> `updateMany?` | \<`T`\>(`this`: `S`, `model`: `T`, `next`: `NextUpdateMany`, `records`: readonly readonly readonly \[[`Column`](Column.md)\<`any`, `any`\>, `any`\][][], `options?`: [`UpdateManyOptions`](UpdateManyOptions.md)) => `Promise`\<[`PkeyResult`](PkeyResult.md) \| `null`\> | Intercept updateMany() | [Middleware.ts:397](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Middleware.ts#L397) |
|
|
38
|
+
| <a id="delete"></a> `delete?` | \<`T`\>(`this`: `S`, `model`: `T`, `next`: `NextDelete`, `conditions`: `Conds`, `options?`: [`DeleteOptions`](DeleteOptions.md)) => `Promise`\<[`PkeyResult`](PkeyResult.md) \| `null`\> | Intercept delete() | [Middleware.ts:406](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Middleware.ts#L406) |
|
|
39
|
+
| <a id="execute"></a> `execute?` | (`this`: `S`, `next`: `NextExecute`, `sql`: `string`, `params?`: `unknown`[]) => `Promise`\<`ExecuteResult`\> | Intercept execute() - lowest level, catches ALL SQL queries | [Middleware.ts:415](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Middleware.ts#L415) |
|
|
40
|
+
| <a id="query"></a> `query?` | \<`T`\>(`this`: `S`, `model`: `T`, `next`: `NextQuery`\<`T`\>, `sql`: `string`, `params?`: `unknown`[]) => `Promise`\<`InstanceType`\<`T`\>[]\> | Intercept query() - catches raw SQL that returns model instances | [Middleware.ts:423](https://github.com/foo-ogawa/litedbmodel/blob/main/src/Middleware.ts#L423) |
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[**litedbmodel v2.2.
|
|
1
|
+
[**litedbmodel v2.2.11**](../README.md)
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
@@ -6,24 +6,24 @@
|
|
|
6
6
|
|
|
7
7
|
# Interface: SelectOptions
|
|
8
8
|
|
|
9
|
-
Defined in: [types.ts:
|
|
9
|
+
Defined in: [types.ts:127](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L127)
|
|
10
10
|
|
|
11
11
|
## Properties
|
|
12
12
|
|
|
13
13
|
| Property | Type | Description | Defined in |
|
|
14
14
|
| ------ | ------ | ------ | ------ |
|
|
15
|
-
| <a id="order"></a> `order?` | `string` \| `OrderSpec` | Order by clause. Accepts OrderSpec (Column.asc()/desc()) or raw string. | [types.ts:
|
|
16
|
-
| <a id="limit"></a> `limit?` | `number` | - | [types.ts:
|
|
17
|
-
| <a id="offset"></a> `offset?` | `number` | - | [types.ts:
|
|
18
|
-
| <a id="select"></a> `select?` | `string` | - | [types.ts:
|
|
19
|
-
| <a id="group"></a> `group?` | `string` | - | [types.ts:
|
|
20
|
-
| <a id="tablename"></a> `tableName?` | `string` | - | [types.ts:
|
|
21
|
-
| <a id="append"></a> `append?` | `string` | - | [types.ts:
|
|
22
|
-
| <a id="forupdate"></a> `forUpdate?` | `boolean` | Lock the selected rows EXCLUSIVELY (` FOR UPDATE`). Mutually exclusive with [forShare](#forshare). | [types.ts:
|
|
23
|
-
| <a id="forshare"></a> `forShare?` | `boolean` | Lock the selected rows for SHARE (` FOR SHARE`): concurrent readers may take the same shared lock, writers block until this transaction ends. The read-side twin of [forUpdate](#forupdate) (and mutually exclusive with it). PostgreSQL / MySQL only — SQLite parses no locking clause. | [types.ts:
|
|
24
|
-
| <a id="join"></a> `join?` | `string` | JOIN clause to add to the query. Can include parameters using ? placeholders. **Example** `join: 'JOIN unnest(?::int[]) AS _keys(id) ON t.id = _keys.id'` | [types.ts:
|
|
25
|
-
| <a id="joinparams"></a> `joinParams?` | `unknown`[] | Parameters for the JOIN clause (prepended to condition params). | [types.ts:
|
|
26
|
-
| <a id="cte"></a> `cte?` | \{ `name`: `string`; `sql`: `string`; `params`: `unknown`[]; \} | CTE (Common Table Expression) to prepend to the query. Used for window functions like ROW_NUMBER() or complex subqueries. The SQL should use ? placeholders for parameters. **Example** `cte: { name: 'ranked', sql: 'SELECT *, ROW_NUMBER() OVER (PARTITION BY user_id) AS _rn FROM posts WHERE user_id IN (?, ?)', params: [1, 2] }` | [types.ts:
|
|
27
|
-
| `cte.name` | `string` | - | [types.ts:
|
|
28
|
-
| `cte.sql` | `string` | - | [types.ts:
|
|
29
|
-
| `cte.params` | `unknown`[] | - | [types.ts:
|
|
15
|
+
| <a id="order"></a> `order?` | `string` \| `OrderSpec` | Order by clause. Accepts OrderSpec (Column.asc()/desc()) or raw string. | [types.ts:129](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L129) |
|
|
16
|
+
| <a id="limit"></a> `limit?` | `number` | - | [types.ts:130](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L130) |
|
|
17
|
+
| <a id="offset"></a> `offset?` | `number` | - | [types.ts:131](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L131) |
|
|
18
|
+
| <a id="select"></a> `select?` | `string` | - | [types.ts:132](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L132) |
|
|
19
|
+
| <a id="group"></a> `group?` | `string` | - | [types.ts:133](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L133) |
|
|
20
|
+
| <a id="tablename"></a> `tableName?` | `string` | - | [types.ts:134](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L134) |
|
|
21
|
+
| <a id="append"></a> `append?` | `string` | - | [types.ts:135](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L135) |
|
|
22
|
+
| <a id="forupdate"></a> `forUpdate?` | `boolean` | Lock the selected rows EXCLUSIVELY (` FOR UPDATE`). Mutually exclusive with [forShare](#forshare). | [types.ts:137](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L137) |
|
|
23
|
+
| <a id="forshare"></a> `forShare?` | `boolean` | Lock the selected rows for SHARE (` FOR SHARE`): concurrent readers may take the same shared lock, writers block until this transaction ends. The read-side twin of [forUpdate](#forupdate) (and mutually exclusive with it). PostgreSQL / MySQL only — SQLite parses no locking clause. | [types.ts:143](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L143) |
|
|
24
|
+
| <a id="join"></a> `join?` | `string` | JOIN clause to add to the query. Can include parameters using ? placeholders. **Example** `join: 'JOIN unnest(?::int[]) AS _keys(id) ON t.id = _keys.id'` | [types.ts:150](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L150) |
|
|
25
|
+
| <a id="joinparams"></a> `joinParams?` | `unknown`[] | Parameters for the JOIN clause (prepended to condition params). | [types.ts:154](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L154) |
|
|
26
|
+
| <a id="cte"></a> `cte?` | \{ `name`: `string`; `sql`: `string`; `params`: `unknown`[]; \} | CTE (Common Table Expression) to prepend to the query. Used for window functions like ROW_NUMBER() or complex subqueries. The SQL should use ? placeholders for parameters. **Example** `cte: { name: 'ranked', sql: 'SELECT *, ROW_NUMBER() OVER (PARTITION BY user_id) AS _rn FROM posts WHERE user_id IN (?, ?)', params: [1, 2] }` | [types.ts:166](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L166) |
|
|
27
|
+
| `cte.name` | `string` | - | [types.ts:167](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L167) |
|
|
28
|
+
| `cte.sql` | `string` | - | [types.ts:168](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L168) |
|
|
29
|
+
| `cte.params` | `unknown`[] | - | [types.ts:169](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L169) |
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[**litedbmodel v2.2.
|
|
1
|
+
[**litedbmodel v2.2.11**](../README.md)
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
|
|
7
7
|
# Interface: TransactionOptions
|
|
8
8
|
|
|
9
|
-
Defined in: [types.ts:
|
|
9
|
+
Defined in: [types.ts:268](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L268)
|
|
10
10
|
|
|
11
11
|
## Properties
|
|
12
12
|
|
|
13
13
|
| Property | Type | Description | Defined in |
|
|
14
14
|
| ------ | ------ | ------ | ------ |
|
|
15
|
-
| <a id="retryonerror"></a> `retryOnError?` | `boolean` | - | [types.ts:
|
|
16
|
-
| <a id="retrylimit"></a> `retryLimit?` | `number` | - | [types.ts:
|
|
17
|
-
| <a id="retryduration"></a> `retryDuration?` | `number` | - | [types.ts:
|
|
18
|
-
| <a id="rollbackonly"></a> `rollbackOnly?` | `boolean` | If true, always rollback instead of commit (useful for preview/dry-run) | [types.ts:
|
|
19
|
-
| <a id="usewriteraftertransaction"></a> `useWriterAfterTransaction?` | `boolean` | Override global useWriterAfterTransaction for this transaction. If true, subsequent reads will use writer connection for writerStickyDuration. **Default** `Uses global setting (true by default)` | [types.ts:
|
|
15
|
+
| <a id="retryonerror"></a> `retryOnError?` | `boolean` | - | [types.ts:269](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L269) |
|
|
16
|
+
| <a id="retrylimit"></a> `retryLimit?` | `number` | - | [types.ts:270](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L270) |
|
|
17
|
+
| <a id="retryduration"></a> `retryDuration?` | `number` | - | [types.ts:271](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L271) |
|
|
18
|
+
| <a id="rollbackonly"></a> `rollbackOnly?` | `boolean` | If true, always rollback instead of commit (useful for preview/dry-run) | [types.ts:273](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L273) |
|
|
19
|
+
| <a id="usewriteraftertransaction"></a> `useWriterAfterTransaction?` | `boolean` | Override global useWriterAfterTransaction for this transaction. If true, subsequent reads will use writer connection for writerStickyDuration. **Default** `Uses global setting (true by default)` | [types.ts:279](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L279) |
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[**litedbmodel v2.2.
|
|
1
|
+
[**litedbmodel v2.2.11**](../README.md)
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Interface: UpdateManyOptions
|
|
8
8
|
|
|
9
|
-
Defined in: [types.ts:
|
|
9
|
+
Defined in: [types.ts:236](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L236)
|
|
10
10
|
|
|
11
11
|
Options for updateMany operation.
|
|
12
12
|
|
|
@@ -14,5 +14,5 @@ Options for updateMany operation.
|
|
|
14
14
|
|
|
15
15
|
| Property | Type | Description | Defined in |
|
|
16
16
|
| ------ | ------ | ------ | ------ |
|
|
17
|
-
| <a id="keycolumns"></a> `keyColumns` | \| [`Column`](Column.md)\<`unknown`, `unknown`\> \| [`Column`](Column.md)\<`unknown`, `unknown`\>[] | Columns that identify each row (used in WHERE/JOIN clause). Must uniquely identify rows (primary key or unique constraint). | [types.ts:
|
|
18
|
-
| <a id="returning"></a> `returning?` | `boolean` | If true, return PkeyResult with affected primary keys. If false (default), return null for better performance. | [types.ts:
|
|
17
|
+
| <a id="keycolumns"></a> `keyColumns` | \| [`Column`](Column.md)\<`unknown`, `unknown`\> \| [`Column`](Column.md)\<`unknown`, `unknown`\>[] | Columns that identify each row (used in WHERE/JOIN clause). Must uniquely identify rows (primary key or unique constraint). | [types.ts:241](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L241) |
|
|
18
|
+
| <a id="returning"></a> `returning?` | `boolean` | If true, return PkeyResult with affected primary keys. If false (default), return null for better performance. | [types.ts:246](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L246) |
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[**litedbmodel v2.2.
|
|
1
|
+
[**litedbmodel v2.2.11**](../README.md)
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
|
|
7
7
|
# Interface: UpdateOptions
|
|
8
8
|
|
|
9
|
-
Defined in: [types.ts:
|
|
9
|
+
Defined in: [types.ts:215](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L215)
|
|
10
10
|
|
|
11
11
|
## Properties
|
|
12
12
|
|
|
13
13
|
| Property | Type | Description | Defined in |
|
|
14
14
|
| ------ | ------ | ------ | ------ |
|
|
15
|
-
| <a id="tablename"></a> `tableName?` | `string` | - | [types.ts:
|
|
16
|
-
| <a id="returning"></a> `returning?` | `boolean` | If true, return PkeyResult with affected primary keys. If false (default), return null for better performance. | [types.ts:
|
|
15
|
+
| <a id="tablename"></a> `tableName?` | `string` | - | [types.ts:216](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L216) |
|
|
16
|
+
| <a id="returning"></a> `returning?` | `boolean` | If true, return PkeyResult with affected primary keys. If false (default), return null for better performance. | [types.ts:221](https://github.com/foo-ogawa/litedbmodel/blob/main/src/types.ts#L221) |
|