@xfcfam/xf-sql 0.1.1 → 0.1.2
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 +10 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -13,14 +13,15 @@ packages:
|
|
|
13
13
|
|
|
14
14
|
Or supply any Kysely `Dialect` directly to `DatabaseRepository`.
|
|
15
15
|
|
|
16
|
-
Peer dependency: `@xfcfam/xf`. `kysely` is a direct (bundled)
|
|
16
|
+
Peer dependency: `@xfcfam/xf`. `kysely` is a direct (bundled)
|
|
17
|
+
dependency — you never install it separately.
|
|
17
18
|
|
|
18
19
|
## Install
|
|
19
20
|
|
|
20
21
|
```bash
|
|
21
|
-
pnpm add @xfcfam/xf @xfcfam/xf-sql
|
|
22
|
-
# plus one dialect adapter, e.g.
|
|
23
|
-
pnpm add @xfcfam/xf-sql-postgres
|
|
22
|
+
pnpm add @xfcfam/xf @xfcfam/xf-sql
|
|
23
|
+
# plus one dialect adapter — it bundles its own driver, e.g. Postgres:
|
|
24
|
+
pnpm add @xfcfam/xf-sql-postgres
|
|
24
25
|
```
|
|
25
26
|
|
|
26
27
|
## What ships here
|
|
@@ -78,9 +79,12 @@ export class UsersDb extends TransactionalDatabaseRepository<Schema> {
|
|
|
78
79
|
```
|
|
79
80
|
|
|
80
81
|
> The example above uses the generic `DatabaseRepository` with a
|
|
81
|
-
> raw Kysely dialect
|
|
82
|
+
> raw Kysely dialect — this DIY path is the one case where you bring
|
|
83
|
+
> the driver yourself (`pnpm add pg`), since xf-sql is dialect-agnostic
|
|
84
|
+
> and bundles no driver. In a real project you would typically extend
|
|
82
85
|
> `PostgresDatabaseRepository` from `@xfcfam/xf-sql-postgres`, which
|
|
83
|
-
> wires the dialect and translates Postgres errors
|
|
86
|
+
> **bundles `pg`**, wires the dialect, and translates Postgres errors
|
|
87
|
+
> automatically — no driver to install.
|
|
84
88
|
|
|
85
89
|
## Batching pattern (deferred writes)
|
|
86
90
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xfcfam/xf-sql",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "SQL Access Layer Generalization for the XF Architecture Model — encapsulates the Kysely query builder. Dialect-agnostic; pair with @xfcfam/xf-sql-postgres / @xfcfam/xf-sql-mysql / etc.",
|
|
5
5
|
"author": "XF Contributors",
|
|
6
6
|
"license": "MIT",
|