@bezoar/nuxt 0.0.2 → 0.0.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/.dist/module.js CHANGED
@@ -37,6 +37,7 @@ const declaration = ({ build, runtime }) => {
37
37
  ` export type AppBezoarQuery = ${service}.Query<AppBezoarContract>;`,
38
38
  ` export type AppBezoarArguments<Q extends AppBezoarQuery> = ${service}.Arguments<AppBezoarContract, Q>;`,
39
39
  ` export type AppBezoarRow<Q extends AppBezoarQuery> = ${service}.Row<AppBezoarContract, Q>;`,
40
+ ` export type AppBezoarDatabase = ${service}.Database<AppBezoarContract>;`,
40
41
  "}",
41
42
  ""
42
43
  ].join("\n");
@@ -96,7 +97,8 @@ var module_default = defineNuxtModule({
96
97
  "AppBezoarContract",
97
98
  "AppBezoarQuery",
98
99
  "AppBezoarArguments",
99
- "AppBezoarRow"
100
+ "AppBezoarRow",
101
+ "AppBezoarDatabase"
100
102
  ].map((name) => ({
101
103
  from: VIRTUAL.service,
102
104
  name,
@@ -1,4 +1,4 @@
1
- import { Arguments, Bezoar, Bundle, Definition, Query, Row } from "bezoar";
1
+ import { Arguments, Bezoar, Bundle, Database, Definition, Query, Row } from "bezoar";
2
2
  /**
3
3
  * The service of an app: `useBezoar` for the service, `closeBezoar`
4
4
  * to close its connection.
@@ -20,4 +20,4 @@ export interface Defined<D extends Definition> {
20
20
  * @param queries - The SQL of the build.
21
21
  */
22
22
  export declare const defineService: <const D extends Definition>(contract: D, queries: Bundle<D>) => Defined<D>;
23
- export type { Arguments, Query, Row };
23
+ export type { Arguments, Database, Query, Row };
package/README.md CHANGED
@@ -64,9 +64,13 @@ export default defineEventHandler(async (event) => {
64
64
 
65
65
  `useBezoar()` is auto-imported on the server. It returns the same service
66
66
  on every call, typed by the contract of the build, so `db.events.list`
67
- completes, and its arguments and rows check. `AppBezoar`,
68
- `AppBezoarContract`, `AppBezoarQuery`, `AppBezoarArguments<Q>`, and
69
- `AppBezoarRow<Q>` are the types, also auto-imported.
67
+ completes, and its arguments and rows check. The service carries the query
68
+ builder of `@bezoar/core`, `db.build`, a [kysely](https://kysely.dev)
69
+ typed by the tables of the build, so `db.build.selectFrom("events")`
70
+ completes as well.
71
+ `AppBezoar`, `AppBezoarContract`, `AppBezoarQuery`,
72
+ `AppBezoarArguments<Q>`, `AppBezoarRow<Q>`, and `AppBezoarDatabase` are the
73
+ types, also auto-imported.
70
74
 
71
75
  ## Startup and shutdown
72
76
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bezoar/nuxt",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "description": "Nuxt module for bezoar: a typed database service for server routes, from a kit build",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -31,9 +31,9 @@
31
31
  "dependencies": {
32
32
  "@nuxt/kit": "^4.5.0",
33
33
  "objectively": "^0.3.0",
34
- "@bezoar/pg": "0.0.2",
35
- "@bezoar/pglite": "0.0.2",
36
- "bezoar": "0.0.2"
34
+ "@bezoar/pg": "0.0.4",
35
+ "@bezoar/pglite": "0.0.4",
36
+ "bezoar": "0.0.4"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@nuxt/nitro-server": "^4.5.0",