@hulla/db-better-auth 0.1.2 → 0.1.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 CHANGED
@@ -26,3 +26,13 @@ options to the schema helper and Better Auth when using plugins or custom fields
26
26
  See the [complete setup](https://github.com/hulladev/db/blob/main/docs/better-auth.md) for schema bootstrap, generated
27
27
  static schemas, session verification, browser auth changes and supported limits.
28
28
  Better Auth owns authentication; the application owns routes and authorization.
29
+
30
+ ## AI agent guidance
31
+
32
+ Install the [@hulla/db skill](https://github.com/hulladev/skills/tree/main/skills/db) for package-specific guidance on database schemas, server authorization, and generated client authentication scopes:
33
+
34
+ ```sh
35
+ npx skills add hulladev/skills --skill db
36
+ ```
37
+
38
+ Choose your coding agent in the installer. See [installation and version compatibility](https://hulla.dev/docs/cli/agent-skills) before adding or updating skills in your application.
package/dist/index.js CHANGED
@@ -83,7 +83,7 @@ export function hullaAdapter(db) {
83
83
  });
84
84
  },
85
85
  async updateMany({ model, where, update }) {
86
- return (await database.update(model, update).where(filter(where))).length;
86
+ return atomic(async (tx) => (await tx.update(model, update).where(filter(where))).length);
87
87
  },
88
88
  async delete({ model, where }) {
89
89
  await atomic(async (tx) => {
@@ -92,7 +92,7 @@ export function hullaAdapter(db) {
92
92
  await tx.delete(model).where({ id: row.id });
93
93
  });
94
94
  },
95
- async deleteMany({ model, where }) { return (await database.delete(model).where(filter(where))).length; },
95
+ async deleteMany({ model, where }) { return atomic(async (tx) => (await tx.delete(model).where(filter(where))).length); },
96
96
  async consumeOne({ model, where }) {
97
97
  return atomic(async (tx) => {
98
98
  const row = await first(tx, model, where);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hulla/db-better-auth",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -18,7 +18,7 @@
18
18
  "LICENSE"
19
19
  ],
20
20
  "peerDependencies": {
21
- "@hulla/db": "^0.1.2",
21
+ "@hulla/db": "^0.1.4",
22
22
  "better-auth": "^1.7.12"
23
23
  },
24
24
  "engines": {