kern-orm 0.8.0 → 0.10.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 CHANGED
@@ -9,18 +9,18 @@ See the [documentation](https://ilyasemenov.github.io/kern-orm/).
9
9
  ## Install
10
10
 
11
11
  ```sh
12
- npm install kern-orm @kern-orm/postgres-js postgres
12
+ npm install kern-orm postgres
13
13
  ```
14
14
 
15
- See [Getting Started](https://ilyasemenov.github.io/kern-orm/getting-started) for the supported runtimes, TypeScript, and PostgreSQL versions.
15
+ See [Getting Started](https://ilyasemenov.github.io/kern-orm/orm/getting-started) for the supported runtimes, TypeScript, and PostgreSQL versions.
16
16
 
17
17
  ## Usage
18
18
 
19
19
  Describe the tables and their relations, then load forms with their fields in one SQL statement, and insert a form with its fields in a transaction:
20
20
 
21
21
  ```ts
22
- import { postgresJsDriver } from "@kern-orm/postgres-js"
23
- import { createDatabase, defineSchema, defineTable, many } from "kern-orm"
22
+ import { bindSchema, createDatabase, defineSchema, defineTable, many } from "kern-orm"
23
+ import { postgresJsDriver } from "kern-orm/db/postgres-js"
24
24
  import * as t from "kern-orm/types"
25
25
  import postgres from "postgres"
26
26
 
@@ -45,7 +45,7 @@ const schema = defineSchema({ form, field }).$relations({
45
45
  const database = createDatabase({
46
46
  driver: postgresJsDriver(postgres(process.env.DATABASE_URL!)),
47
47
  })
48
- const db = database.bind(schema)
48
+ const db = bindSchema(schema, database)
49
49
 
50
50
  const forms = await db.form
51
51
  .where({ published: true })
@@ -0,0 +1 @@
1
+ export * from "kern-db/node-postgres";
@@ -0,0 +1,2 @@
1
+ export * from "kern-db/node-postgres";
2
+ export {};
@@ -0,0 +1 @@
1
+ export * from "kern-db/postgres-js";
@@ -0,0 +1,2 @@
1
+ export * from "kern-db/postgres-js";
2
+ export {};
@@ -0,0 +1 @@
1
+ export * from "kern-db/types";
@@ -0,0 +1,2 @@
1
+ export * from "kern-db/types";
2
+ export {};
package/dist/db.d.mts ADDED
@@ -0,0 +1 @@
1
+ export * from "kern-db";
package/dist/db.mjs ADDED
@@ -0,0 +1,2 @@
1
+ export * from "kern-db";
2
+ export {};