turbine-orm 0.28.0 → 0.28.1
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 +2 -2
- package/dist/cjs/errors.js +15 -1
- package/dist/cjs/powdb.js +1 -1
- package/dist/cjs/powql.js +1 -1
- package/dist/cjs/query/builder.js +75 -294
- package/dist/cjs/query/deferred.js +7 -0
- package/dist/cjs/query/filters.js +251 -0
- package/dist/errors.js +15 -1
- package/dist/powdb.d.ts +1 -1
- package/dist/powdb.js +1 -1
- package/dist/powql.d.ts +1 -1
- package/dist/powql.js +1 -1
- package/dist/query/builder.d.ts +3 -122
- package/dist/query/builder.js +1 -220
- package/dist/query/deferred.d.ts +130 -0
- package/dist/query/deferred.js +6 -0
- package/dist/query/filters.d.ts +120 -0
- package/dist/query/filters.js +232 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -990,13 +990,13 @@ Turbine is focused and opinionated. Here's what it doesn't do:
|
|
|
990
990
|
|
|
991
991
|
## Requirements
|
|
992
992
|
|
|
993
|
-
- Node.js >=
|
|
993
|
+
- Node.js >= 20.0.0
|
|
994
994
|
- PostgreSQL >= 14
|
|
995
995
|
- Works with both ESM (`import`) and CommonJS (`require`)
|
|
996
996
|
|
|
997
997
|
## Contributing
|
|
998
998
|
|
|
999
|
-
Contributions are welcome. See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup, the test strategy, and the PR checklist. The unit suite runs without a database:
|
|
999
|
+
Contributions are welcome. See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup, the test strategy, and the PR checklist. Participants agree to the [Code of Conduct](CODE_OF_CONDUCT.md). The unit suite runs without a database:
|
|
1000
1000
|
|
|
1001
1001
|
```bash
|
|
1002
1002
|
npm install
|
package/dist/cjs/errors.js
CHANGED
|
@@ -30,11 +30,25 @@ exports.TurbineErrorCode = {
|
|
|
30
30
|
EXCLUSION_VIOLATION: 'TURBINE_E016',
|
|
31
31
|
UNSUPPORTED_FEATURE: 'TURBINE_E017',
|
|
32
32
|
};
|
|
33
|
+
/**
|
|
34
|
+
* Prefix a human message with its stable error code so logs are greppable
|
|
35
|
+
* without requiring structured field access. Idempotent if the message already
|
|
36
|
+
* starts with `[TURBINE_E0NN]`.
|
|
37
|
+
*/
|
|
38
|
+
function formatErrorMessage(code, message) {
|
|
39
|
+
const tag = `[${code}]`;
|
|
40
|
+
if (message.startsWith(tag))
|
|
41
|
+
return message;
|
|
42
|
+
// Empty message → just the code (defensive; callers always pass text today).
|
|
43
|
+
if (!message)
|
|
44
|
+
return tag;
|
|
45
|
+
return `${tag} ${message}`;
|
|
46
|
+
}
|
|
33
47
|
/** Base error class for all Turbine errors */
|
|
34
48
|
class TurbineError extends Error {
|
|
35
49
|
code;
|
|
36
50
|
constructor(code, message, options) {
|
|
37
|
-
super(message, options);
|
|
51
|
+
super(formatErrorMessage(code, message), options);
|
|
38
52
|
this.name = 'TurbineError';
|
|
39
53
|
this.code = code;
|
|
40
54
|
}
|
package/dist/cjs/powdb.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* seam. The four SQL engines are untouched.
|
|
11
11
|
*
|
|
12
12
|
* PowDB realities shape the design (all verified firsthand against a live
|
|
13
|
-
* `powdb-server` / the embedded addon, see `docs/strategy/powdb-parity-matrix.md`):
|
|
13
|
+
* `powdb-server` / the embedded addon, see `docs/internal/strategy/powdb-parity-matrix.md`):
|
|
14
14
|
* - **`RETURNING` (since 0.7.0)** — `create/createMany/update/delete` append the
|
|
15
15
|
* trailing `returning` keyword (`RETURNING *`, all columns) and read the
|
|
16
16
|
* affected rows back in one round-trip. `upsert` is the lone exception (its
|
package/dist/cjs/powql.js
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* it separate also means the four SQL engines are untouched.
|
|
12
12
|
*
|
|
13
13
|
* Behavioural deltas from the SQL path, all driven by PowDB's wire reality (see
|
|
14
|
-
* `docs/strategy/powdb-parity-matrix.md`, every row verified against a live
|
|
14
|
+
* `docs/internal/strategy/powdb-parity-matrix.md`, every row verified against a live
|
|
15
15
|
* server):
|
|
16
16
|
* - `create`/`createMany`/`update`/`delete` use PowDB 0.7.0's trailing
|
|
17
17
|
* `returning` keyword (`RETURNING *`, all columns) to surface affected rows
|