@btravstack/prisma 0.10.0 → 0.11.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 +27 -7
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@ generated from your schema. Node `>=22`.
|
|
|
22
22
|
<!-- doctest: group=order-api -->
|
|
23
23
|
<!-- doctest: prelude
|
|
24
24
|
import { Env } from "@btravstack/config";
|
|
25
|
-
import { Logger
|
|
25
|
+
import { Logger } from "@btravstack/core";
|
|
26
26
|
import { Module } from "@btravstack/di";
|
|
27
27
|
import { PrismaPg } from "@prisma/adapter-pg";
|
|
28
28
|
|
|
@@ -46,14 +46,15 @@ const database = prismaDatabase("OrderDatabase")({
|
|
|
46
46
|
});
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
-
That is the whole surface. `database`
|
|
50
|
-
root
|
|
49
|
+
That is the whole surface. `database` is a **module** carrying the port a
|
|
50
|
+
composition root reads; the provider binding `DATABASE_URL`, the resourceful
|
|
51
|
+
client provider, the health check and the engine-tracing loader are inside it:
|
|
51
52
|
|
|
52
53
|
```ts
|
|
53
54
|
export const PersistenceModule = Module("Persistence")({
|
|
54
55
|
imports: [database],
|
|
55
56
|
exports: [database.port],
|
|
56
|
-
needs: [Env, Logger
|
|
57
|
+
needs: [Env, Logger],
|
|
57
58
|
});
|
|
58
59
|
```
|
|
59
60
|
|
|
@@ -72,6 +73,17 @@ port is typed by exactly what it returns.
|
|
|
72
73
|
reachable — build it in your own `client` arrow and ignore the one passed in.
|
|
73
74
|
- **The pool's lifetime.** The provider is _resourceful_, so `release` closes it
|
|
74
75
|
on every exit path, including a boot that fails after it ran.
|
|
76
|
+
- **A health check**, named after the starter — `SELECT 1` through `$queryRaw`,
|
|
77
|
+
folded into the kernel's `GET /healthz` with nothing wired. `/readyz` does not
|
|
78
|
+
read it: failing readiness on a dependency every replica shares removes them
|
|
79
|
+
all at once.
|
|
80
|
+
- **Engine tracing, offered rather than registered.** The starter contributes a
|
|
81
|
+
loader for the optional `@prisma/instrumentation` peer to `Instrumentations`;
|
|
82
|
+
composing `@btravstack/observability/otel` is what turns it on, and a graph
|
|
83
|
+
with no SDK never imports it. A missing peer is a `debug` line, never silence.
|
|
84
|
+
- **Every query handed to `Observers`**, so composing `observability()` writes
|
|
85
|
+
the failures as lines and `otel()` mints the instruments — with no flag here
|
|
86
|
+
and no port list to satisfy when you compose neither.
|
|
75
87
|
|
|
76
88
|
## What it does not
|
|
77
89
|
|
|
@@ -89,9 +101,17 @@ package's.
|
|
|
89
101
|
|
|
90
102
|
## Options
|
|
91
103
|
|
|
92
|
-
| Option
|
|
93
|
-
|
|
|
94
|
-
| `
|
|
104
|
+
| Option | Where | What it is |
|
|
105
|
+
| -------------- | ------------------------------------------- | ---------------------------------------------------------------------------------------- |
|
|
106
|
+
| `name` | `prismaDatabase(name)` | the port's id and the health check's name — required |
|
|
107
|
+
| `client` | `prismaDatabase(name)({ client })` | builds your client from the driver adapter this package built from the URL — required |
|
|
108
|
+
| `DATABASE_URL` | environment, read by `prismaDatabase(name)` | the connection string — required, validated at graph build; blank is an error, exit `78` |
|
|
109
|
+
|
|
110
|
+
There is **no `instrumented` flag**: observation is a set port every call is
|
|
111
|
+
handed to, so a graph composing no observability pays one inert call and no
|
|
112
|
+
port list. The full table — defaults, semantics and the reasoning — lives on
|
|
113
|
+
[the reference page](https://btravstack.github.io/btravstack/reference/prisma),
|
|
114
|
+
which is this list's one detailed home.
|
|
95
115
|
|
|
96
116
|
## License
|
|
97
117
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@btravstack/prisma",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "The Prisma starter for @btravstack/core: DATABASE_URL through Config, the Postgres driver adapter, and a client whose pool is the application scope's",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"database",
|
|
@@ -53,17 +53,17 @@
|
|
|
53
53
|
"typescript": "7.0.2",
|
|
54
54
|
"unthrown": "5.7.0",
|
|
55
55
|
"vitest": "4.1.11",
|
|
56
|
-
"@btravstack/config": "0.
|
|
57
|
-
"@btravstack/
|
|
58
|
-
"@btravstack/
|
|
56
|
+
"@btravstack/config": "0.11.0",
|
|
57
|
+
"@btravstack/core": "0.11.0",
|
|
58
|
+
"@btravstack/di": "0.11.0"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
61
|
"@prisma/adapter-pg": "^7.0.0",
|
|
62
62
|
"@prisma/instrumentation": "^7.0.0",
|
|
63
63
|
"unthrown": "^5.0.0",
|
|
64
|
-
"@btravstack/config": "^0.
|
|
65
|
-
"@btravstack/core": "^0.
|
|
66
|
-
"@btravstack/di": "^0.
|
|
64
|
+
"@btravstack/config": "^0.11.0",
|
|
65
|
+
"@btravstack/core": "^0.11.0",
|
|
66
|
+
"@btravstack/di": "^0.11.0"
|
|
67
67
|
},
|
|
68
68
|
"peerDependenciesMeta": {
|
|
69
69
|
"@prisma/instrumentation": {
|