@lunora/hyperdrive 1.0.0-alpha.157 → 1.0.0-alpha.159

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,6 +1,6 @@
1
1
  import { DatabaseWriterLike } from '@lunora/shard-engine';
2
2
  import { SqlExec, SqlDialect, SqlCtxDbOptions } from '@lunora/sql-store';
3
- import { M as Mysql2Like, S as SqlClient } from "./packem_shared/types.d-DpWhWTrT.mjs";
3
+ import { M as Mysql2Like, S as SqlClient } from "./packem_shared/types.d-B2JdXSms.mjs";
4
4
  import { VectorMetric, VectorizeIndexLike } from '@lunora/platform';
5
5
  /**
6
6
  * Minimal row-returning client (e.g. `@lunora/hyperdrive`'s `fromPostgresJs`/`fromNodePg`
package/dist/global.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { DatabaseWriterLike } from '@lunora/shard-engine';
2
2
  import { SqlExec, SqlDialect, SqlCtxDbOptions } from '@lunora/sql-store';
3
- import { M as Mysql2Like, S as SqlClient } from "./packem_shared/types.d-DpWhWTrT.js";
3
+ import { M as Mysql2Like, S as SqlClient } from "./packem_shared/types.d-B2JdXSms.js";
4
4
  import { VectorMetric, VectorizeIndexLike } from '@lunora/platform';
5
5
  /**
6
6
  * Minimal row-returning client (e.g. `@lunora/hyperdrive`'s `fromPostgresJs`/`fromNodePg`
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { H as HyperdriveLike, a as HyperdriveConnection, M as Mysql2Like, S as SqlClient, N as NodePgLike, P as PostgresJsLike } from "./packem_shared/types.d-DpWhWTrT.mjs";
1
+ import { H as HyperdriveLike, a as HyperdriveConnection, M as Mysql2Like, S as SqlClient, N as NodePgLike, P as PostgresJsLike } from "./packem_shared/types.d-B2JdXSms.mjs";
2
2
  /**
3
3
  * Surface a Cloudflare Hyperdrive binding as a connection ready to feed a
4
4
  * user-supplied SQL driver.
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { H as HyperdriveLike, a as HyperdriveConnection, M as Mysql2Like, S as SqlClient, N as NodePgLike, P as PostgresJsLike } from "./packem_shared/types.d-DpWhWTrT.js";
1
+ import { H as HyperdriveLike, a as HyperdriveConnection, M as Mysql2Like, S as SqlClient, N as NodePgLike, P as PostgresJsLike } from "./packem_shared/types.d-B2JdXSms.js";
2
2
  /**
3
3
  * Surface a Cloudflare Hyperdrive binding as a connection ready to feed a
4
4
  * user-supplied SQL driver.
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{createHyperdrive as e,fromMysql2 as f,fromNodePg as m,fromPostgresJs as p}from"./packem_shared/createHyperdrive-DEXMfGd0.mjs";import{projectSourceRow as t,pullSourceRows as c}from"./packem_shared/projectSourceRow-DN8ywPRl.mjs";export{e as createHyperdrive,f as fromMysql2,m as fromNodePg,p as fromPostgresJs,t as projectSourceRow,c as pullSourceRows};
1
+ import{createHyperdrive as e,fromMysql2 as f,fromNodePg as m,fromPostgresJs as p}from"./packem_shared/createHyperdrive-BeXs5Dr6.mjs";import{projectSourceRow as t,pullSourceRows as c}from"./packem_shared/projectSourceRow-DN8ywPRl.mjs";export{e as createHyperdrive,f as fromMysql2,m as fromNodePg,p as fromPostgresJs,t as projectSourceRow,c as pullSourceRows};
@@ -0,0 +1 @@
1
+ const o=r=>({config:{database:r.database,host:r.host,password:r.password,port:r.port,user:r.user},connectionString:r.connectionString}),a=r=>({dbSystem:"postgresql",query:async(s,t=[])=>await r.unsafe(s,t)}),c=r=>({dbSystem:"postgresql",query:async(s,t=[])=>(await r.query(s,t)).rows}),n=r=>({dbSystem:"mysql",query:async(s,t=[])=>{const[e]=await r.execute(s,t);return Array.isArray(e)?e:[]}});export{o as createHyperdrive,n as fromMysql2,c as fromNodePg,a as fromPostgresJs};
@@ -69,6 +69,15 @@ interface HyperdriveConnection {
69
69
  * non-reactive — writes here are not tracked by Lunora live queries.
70
70
  */
71
71
  interface SqlClient {
72
+ /**
73
+ * The database system behind this client, as OTel names it in
74
+ * `db.system.name`. Stamped by the driver adapters ({@link import("./create-hyperdrive").fromPostgresJs | fromPostgresJs}
75
+ * / {@link import("./create-hyperdrive").fromNodePg | fromNodePg} → `"postgresql"`,
76
+ * {@link import("./create-hyperdrive").fromMysql2 | fromMysql2} → `"mysql"`) so `ctx.sql`'s automatic
77
+ * instrumentation reports the real system. Optional: a hand-built client may
78
+ * omit it and is then reported as `"other_sql"`.
79
+ */
80
+ readonly dbSystem?: "mysql" | "postgresql";
72
81
  /**
73
82
  * Run a parameterised SQL statement and return the result rows.
74
83
  *
@@ -69,6 +69,15 @@ interface HyperdriveConnection {
69
69
  * non-reactive — writes here are not tracked by Lunora live queries.
70
70
  */
71
71
  interface SqlClient {
72
+ /**
73
+ * The database system behind this client, as OTel names it in
74
+ * `db.system.name`. Stamped by the driver adapters ({@link import("./create-hyperdrive").fromPostgresJs | fromPostgresJs}
75
+ * / {@link import("./create-hyperdrive").fromNodePg | fromNodePg} → `"postgresql"`,
76
+ * {@link import("./create-hyperdrive").fromMysql2 | fromMysql2} → `"mysql"`) so `ctx.sql`'s automatic
77
+ * instrumentation reports the real system. Optional: a hand-built client may
78
+ * omit it and is then reported as `"other_sql"`.
79
+ */
80
+ readonly dbSystem?: "mysql" | "postgresql";
72
81
  /**
73
82
  * Run a parameterised SQL statement and return the result rows.
74
83
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lunora/hyperdrive",
3
- "version": "1.0.0-alpha.157",
3
+ "version": "1.0.0-alpha.159",
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",
@@ -51,9 +51,9 @@
51
51
  },
52
52
  "dependencies": {
53
53
  "@lunora/errors": "1.0.0-alpha.50",
54
- "@lunora/platform": "1.0.0-alpha.52",
55
- "@lunora/shard-engine": "1.0.0-alpha.108",
56
- "@lunora/sql-store": "1.0.0-alpha.161",
54
+ "@lunora/platform": "1.0.0-alpha.54",
55
+ "@lunora/shard-engine": "1.0.0-alpha.110",
56
+ "@lunora/sql-store": "1.0.0-alpha.162",
57
57
  "drizzle-orm": "^0.45.2"
58
58
  },
59
59
  "peerDependencies": {
@@ -1 +0,0 @@
1
- const o=r=>({config:{database:r.database,host:r.host,password:r.password,port:r.port,user:r.user},connectionString:r.connectionString}),a=r=>({query:async(t,s=[])=>await r.unsafe(t,s)}),c=r=>({query:async(t,s=[])=>(await r.query(t,s)).rows}),n=r=>({query:async(t,s=[])=>{const[e]=await r.execute(t,s);return Array.isArray(e)?e:[]}});export{o as createHyperdrive,n as fromMysql2,c as fromNodePg,a as fromPostgresJs};