@lunora/hyperdrive 1.0.0-alpha.208 → 1.0.0-alpha.209

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/global.d.mts CHANGED
@@ -1,3 +1,27 @@
1
+ /**
2
+ * `@lunora/hyperdrive/global` — a Postgres/MySQL database reached through
3
+ * Cloudflare Hyperdrive (PlanetScale, Neon, RDS, …) as a **first-class,
4
+ * reactive** `.global()` storage backend for Lunora, alongside D1.
5
+ *
6
+ * Unlike the package's `ctx.sql` surface (an action-only, non-reactive escape
7
+ * hatch for an external DB), this makes Lunora the **owner** of the schema:
8
+ * `.global()` tables get a real column-per-field layout and all writes route
9
+ * through the shared store core (`createSqlCtxDb` from `@lunora/sql-store`) with
10
+ * a Postgres or MySQL {@link postgresDialect}/{@link mysqlDialect} and a
11
+ * Hyperdrive-backed {@link SqlExec}. The returned `DatabaseWriterLike` is
12
+ * injected as `globalDb` into `createShardCtxDb`, whose broadcast hook drives
13
+ * live queries — so subscriptions stay reactive with zero extra wiring,
14
+ * identical to D1.
15
+ *
16
+ * Drivers (`postgres`/`pg`/`mysql2`) are optional peer deps — bring your own,
17
+ * constructed from the `HYPERDRIVE` binding's connection string. The binding is
18
+ * reachable from inside the Durable Object that hosts the writer; cache the
19
+ * driver on the DO instance and rebuild it lazily after hibernation.
20
+ *
21
+ * **MySQL connections must enable `CLIENT_FOUND_ROWS`** (mysql2:
22
+ * `createPool({ flags: ["FOUND_ROWS"] })`) so the affected-rows OCC guard sees
23
+ * matched (not changed) rows — see {@link buildMysqlExec}.
24
+ */
1
25
  import { DatabaseWriterLike } from '@lunora/shard-engine';
2
26
  import { SqlExec, SqlDialect, SqlCtxDbOptions } from '@lunora/sql-store';
3
27
  import { M as Mysql2Like, S as SqlClient } from "./packem_shared/types.d-B2JdXSms.mjs";
package/dist/global.d.ts CHANGED
@@ -1,3 +1,27 @@
1
+ /**
2
+ * `@lunora/hyperdrive/global` — a Postgres/MySQL database reached through
3
+ * Cloudflare Hyperdrive (PlanetScale, Neon, RDS, …) as a **first-class,
4
+ * reactive** `.global()` storage backend for Lunora, alongside D1.
5
+ *
6
+ * Unlike the package's `ctx.sql` surface (an action-only, non-reactive escape
7
+ * hatch for an external DB), this makes Lunora the **owner** of the schema:
8
+ * `.global()` tables get a real column-per-field layout and all writes route
9
+ * through the shared store core (`createSqlCtxDb` from `@lunora/sql-store`) with
10
+ * a Postgres or MySQL {@link postgresDialect}/{@link mysqlDialect} and a
11
+ * Hyperdrive-backed {@link SqlExec}. The returned `DatabaseWriterLike` is
12
+ * injected as `globalDb` into `createShardCtxDb`, whose broadcast hook drives
13
+ * live queries — so subscriptions stay reactive with zero extra wiring,
14
+ * identical to D1.
15
+ *
16
+ * Drivers (`postgres`/`pg`/`mysql2`) are optional peer deps — bring your own,
17
+ * constructed from the `HYPERDRIVE` binding's connection string. The binding is
18
+ * reachable from inside the Durable Object that hosts the writer; cache the
19
+ * driver on the DO instance and rebuild it lazily after hibernation.
20
+ *
21
+ * **MySQL connections must enable `CLIENT_FOUND_ROWS`** (mysql2:
22
+ * `createPool({ flags: ["FOUND_ROWS"] })`) so the affected-rows OCC guard sees
23
+ * matched (not changed) rows — see {@link buildMysqlExec}.
24
+ */
1
25
  import { DatabaseWriterLike } from '@lunora/shard-engine';
2
26
  import { SqlExec, SqlDialect, SqlCtxDbOptions } from '@lunora/sql-store';
3
27
  import { M as Mysql2Like, S as SqlClient } from "./packem_shared/types.d-B2JdXSms.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lunora/hyperdrive",
3
- "version": "1.0.0-alpha.208",
3
+ "version": "1.0.0-alpha.209",
4
4
  "description": "Bring-your-own Postgres/MySQL for Lunora via Cloudflare Hyperdrive: a driver-agnostic, action-only ctx.sql",
5
5
  "keywords": [
6
6
  "cloudflare",
@@ -52,8 +52,8 @@
52
52
  "dependencies": {
53
53
  "@lunora/errors": ">=1.0.0-alpha.51 <2.0.0-0",
54
54
  "@lunora/platform": "1.0.0-alpha.75",
55
- "@lunora/shard-engine": "1.0.0-alpha.162",
56
- "@lunora/sql-store": "1.0.0-alpha.211",
55
+ "@lunora/shard-engine": "1.0.0-alpha.163",
56
+ "@lunora/sql-store": "1.0.0-alpha.212",
57
57
  "drizzle-orm": "1.0.0-rc.5"
58
58
  },
59
59
  "peerDependencies": {