@rowstile/pg 0.1.0-alpha.2 → 0.1.0-alpha.4
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 +3 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -57,7 +57,9 @@ Traps it handles:
|
|
|
57
57
|
transactions, from the first caller's context. `authz()` runs each `findUnique` in a transaction of its own,
|
|
58
58
|
and refuses `$transaction([...])` (use `$transaction(async (tx) => ...)`), so no query runs as someone else.
|
|
59
59
|
Use the client `$extends(authz())` returns, and only that one: the client it was made from is refused
|
|
60
|
-
whenever it is used.
|
|
60
|
+
whenever it is used, inside your own extensions too. An extension you add to the client `authz()` returns is
|
|
61
|
+
placed before it, so `authz()` stays the last one: each of your query hooks runs once for a call, and sees
|
|
62
|
+
the errors `authz()` makes (`Refused`, `NotFound`).
|
|
61
63
|
- **Inserts that read the row back** (`RETURNING`, Prisma's `create`) also need the select rule: Postgres's own
|
|
62
64
|
message comes back as `Refused` naming the select rule.
|
|
63
65
|
- **Prisma's promises are lazy**: `actingAs` and `job` await what they return inside their scope.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rowstile/pg",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.4",
|
|
4
4
|
"description": "rowstile with node-postgres (pg): transactions signed in as the request's user",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": { "type": "git", "url": "git+https://github.com/rowstile/rowstile.git", "directory": "sdk/typescript/pg" },
|
|
@@ -10,6 +10,6 @@
|
|
|
10
10
|
"exports": { ".": { "types": "./dist/index.d.ts", "default": "./dist/index.js" } },
|
|
11
11
|
"files": ["dist"],
|
|
12
12
|
"sideEffects": false,
|
|
13
|
-
"dependencies": { "@rowstile/client": "0.1.0-alpha.
|
|
13
|
+
"dependencies": { "@rowstile/client": "0.1.0-alpha.4" },
|
|
14
14
|
"peerDependencies": { "pg": ">=8" }
|
|
15
15
|
}
|