@platformatic/sql-mapper 2.25.0 → 2.26.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.
Files changed (2) hide show
  1. package/mapper.d.ts +10 -4
  2. package/package.json +4 -4
package/mapper.d.ts CHANGED
@@ -69,6 +69,12 @@ export interface DBEntityField {
69
69
  autoTimestamp?: boolean
70
70
  }
71
71
 
72
+ export type WhereClause = {
73
+ or?: WhereCondition[];
74
+ } | {
75
+ [columnName: string]: WhereCondition[string];
76
+ }
77
+
72
78
  export interface WhereCondition {
73
79
  [columnName: string]: {
74
80
  /**
@@ -139,7 +145,7 @@ interface Find<EntityFields> {
139
145
  /**
140
146
  * SQL where condition.
141
147
  */
142
- where?: WhereCondition,
148
+ where?: WhereClause,
143
149
  /**
144
150
  * List of fields to be returned for each object
145
151
  */
@@ -173,7 +179,7 @@ interface Count {
173
179
  /**
174
180
  * SQL where condition.
175
181
  */
176
- where?: WhereCondition,
182
+ where?: WhereClause,
177
183
  /**
178
184
  * If present, the entity participates in transaction
179
185
  */
@@ -235,7 +241,7 @@ interface Delete<EntityFields> {
235
241
  /**
236
242
  * SQL where condition.
237
243
  */
238
- where?: WhereCondition,
244
+ where?: WhereClause,
239
245
  /**
240
246
  * List of fields to be returned for each object
241
247
  */
@@ -257,7 +263,7 @@ interface UpdateMany<EntityFields> {
257
263
  /**
258
264
  * SQL where condition.
259
265
  */
260
- where: WhereCondition,
266
+ where?: WhereClause,
261
267
  /**
262
268
  * Entity fields to update.
263
269
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/sql-mapper",
3
- "version": "2.25.0",
3
+ "version": "2.26.0",
4
4
  "description": "A data mapper utility for SQL databases",
5
5
  "main": "mapper.js",
6
6
  "types": "mapper.d.ts",
@@ -30,13 +30,13 @@
30
30
  "@databases/sql": "^3.3.0",
31
31
  "@fastify/error": "^4.0.0",
32
32
  "@hapi/topo": "^6.0.2",
33
- "@matteo.collina/sqlite-pool": "^0.4.0",
33
+ "@matteo.collina/sqlite-pool": "^0.5.0",
34
34
  "async-cache-dedupe": "^2.1.0",
35
35
  "camelcase": "^6.3.0",
36
36
  "fastify-plugin": "^5.0.0",
37
37
  "inflected": "^2.1.0",
38
- "@platformatic/telemetry": "2.25.0",
39
- "@platformatic/utils": "2.25.0"
38
+ "@platformatic/utils": "2.26.0",
39
+ "@platformatic/telemetry": "2.26.0"
40
40
  },
41
41
  "tsd": {
42
42
  "directory": "test/types"