@lunora/d1 1.0.0-alpha.103 → 1.0.0-alpha.105
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/dialect.d.mts +28 -1
- package/dist/dialect.d.ts +28 -1
- package/dist/dialect.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/packem_shared/OCC_VERSION_COLUMN-ByC64Jgx.mjs +1 -0
- package/dist/packem_shared/{exportGlobalRows-BjvA5Ow_.mjs → exportGlobalRows-DJHnVfLg.mjs} +1 -1
- package/dist/packem_shared/{facetGlobalColumn-DC1jYCrB.mjs → facetGlobalColumn-EeEbDTka.mjs} +1 -1
- package/dist/packem_shared/{wire-codec-C2Avu56N.mjs → wire-codec-Cgm2xFo4.mjs} +1 -1
- package/package.json +5 -5
package/dist/dialect.d.mts
CHANGED
|
@@ -1,3 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The optimistic-concurrency row version every global table carries alongside
|
|
3
|
+
* `id`/`_creationTime`.
|
|
4
|
+
*
|
|
5
|
+
* The CAS used to bind one parameter per physical column of the snapshot, so an
|
|
6
|
+
* `UPDATE` on a wide table bound `2N+2` parameters — over D1's 100-per-statement
|
|
7
|
+
* ceiling (workerd's `SQLITE_LIMIT_VARIABLE_NUMBER`) from 50 declared fields up,
|
|
8
|
+
* while `INSERT` at the same width stayed under it. The table provisioned, rows
|
|
9
|
+
* inserted, and the first `patch`/`replace`/soft-`delete` died with a raw
|
|
10
|
+
* `too many SQL variables` that redacts to "Internal error" on the way out.
|
|
11
|
+
*
|
|
12
|
+
* Guarding on this one column instead makes the CAS cost two parameters at any
|
|
13
|
+
* width. Every guarded write bumps it in SQL (`COALESCE(<col>, 0) + 1`), which
|
|
14
|
+
* costs no parameter of its own; `INSERT` leaves it NULL, and the NULL-safe
|
|
15
|
+
* comparison handles both that and rows written before the column existed.
|
|
16
|
+
*
|
|
17
|
+
* Not decoded into documents — `decodeGlobalRow` builds its result from the
|
|
18
|
+
* declared shape, so an undeclared physical column is invisible to callers.
|
|
19
|
+
*
|
|
20
|
+
* Bundler-inlined rather than owned by one package because BOTH producers of
|
|
21
|
+
* global-table DDL name it: `@lunora/sql-store`'s auto-provisioner (which runs
|
|
22
|
+
* the CAS) and `@lunora/d1/dialect`, which `lunora migrate generate` derives its
|
|
23
|
+
* `CREATE TABLE` from. Importing `@lunora/sql-store` would pull drizzle into the
|
|
24
|
+
* dependency-free dialect module the CLI reads; a second copy of the string is
|
|
25
|
+
* how the two shapes drift.
|
|
26
|
+
*/
|
|
27
|
+
declare const OCC_VERSION_COLUMN = "_version";
|
|
1
28
|
/**
|
|
2
29
|
* Canonical SQL identifier quoter shared by `@lunora/d1` and `@lunora/do`.
|
|
3
30
|
*
|
|
@@ -48,4 +75,4 @@ declare const frameworkColumnDdl: () => ReadonlyArray<string>;
|
|
|
48
75
|
declare const columnRef: (field: string) => string;
|
|
49
76
|
/** Physical index identifier — `<table>_<name>`, so two tables' like-named indexes don't collide in SQLite's flat index namespace. */
|
|
50
77
|
declare const physicalIndexName: (tableName: string, indexName: string) => string;
|
|
51
|
-
export { MAX_D1_TABLE_COLUMNS, SqlAffinity, columnRef, frameworkColumnDdl, physicalIndexName, quoteIdentifier, sqlAffinityForKind };
|
|
78
|
+
export { MAX_D1_TABLE_COLUMNS, OCC_VERSION_COLUMN, SqlAffinity, columnRef, frameworkColumnDdl, physicalIndexName, quoteIdentifier, sqlAffinityForKind };
|
package/dist/dialect.d.ts
CHANGED
|
@@ -1,3 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The optimistic-concurrency row version every global table carries alongside
|
|
3
|
+
* `id`/`_creationTime`.
|
|
4
|
+
*
|
|
5
|
+
* The CAS used to bind one parameter per physical column of the snapshot, so an
|
|
6
|
+
* `UPDATE` on a wide table bound `2N+2` parameters — over D1's 100-per-statement
|
|
7
|
+
* ceiling (workerd's `SQLITE_LIMIT_VARIABLE_NUMBER`) from 50 declared fields up,
|
|
8
|
+
* while `INSERT` at the same width stayed under it. The table provisioned, rows
|
|
9
|
+
* inserted, and the first `patch`/`replace`/soft-`delete` died with a raw
|
|
10
|
+
* `too many SQL variables` that redacts to "Internal error" on the way out.
|
|
11
|
+
*
|
|
12
|
+
* Guarding on this one column instead makes the CAS cost two parameters at any
|
|
13
|
+
* width. Every guarded write bumps it in SQL (`COALESCE(<col>, 0) + 1`), which
|
|
14
|
+
* costs no parameter of its own; `INSERT` leaves it NULL, and the NULL-safe
|
|
15
|
+
* comparison handles both that and rows written before the column existed.
|
|
16
|
+
*
|
|
17
|
+
* Not decoded into documents — `decodeGlobalRow` builds its result from the
|
|
18
|
+
* declared shape, so an undeclared physical column is invisible to callers.
|
|
19
|
+
*
|
|
20
|
+
* Bundler-inlined rather than owned by one package because BOTH producers of
|
|
21
|
+
* global-table DDL name it: `@lunora/sql-store`'s auto-provisioner (which runs
|
|
22
|
+
* the CAS) and `@lunora/d1/dialect`, which `lunora migrate generate` derives its
|
|
23
|
+
* `CREATE TABLE` from. Importing `@lunora/sql-store` would pull drizzle into the
|
|
24
|
+
* dependency-free dialect module the CLI reads; a second copy of the string is
|
|
25
|
+
* how the two shapes drift.
|
|
26
|
+
*/
|
|
27
|
+
declare const OCC_VERSION_COLUMN = "_version";
|
|
1
28
|
/**
|
|
2
29
|
* Canonical SQL identifier quoter shared by `@lunora/d1` and `@lunora/do`.
|
|
3
30
|
*
|
|
@@ -48,4 +75,4 @@ declare const frameworkColumnDdl: () => ReadonlyArray<string>;
|
|
|
48
75
|
declare const columnRef: (field: string) => string;
|
|
49
76
|
/** Physical index identifier — `<table>_<name>`, so two tables' like-named indexes don't collide in SQLite's flat index namespace. */
|
|
50
77
|
declare const physicalIndexName: (tableName: string, indexName: string) => string;
|
|
51
|
-
export { MAX_D1_TABLE_COLUMNS, SqlAffinity, columnRef, frameworkColumnDdl, physicalIndexName, quoteIdentifier, sqlAffinityForKind };
|
|
78
|
+
export { MAX_D1_TABLE_COLUMNS, OCC_VERSION_COLUMN, SqlAffinity, columnRef, frameworkColumnDdl, physicalIndexName, quoteIdentifier, sqlAffinityForKind };
|
package/dist/dialect.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{quoteIdentifier as
|
|
1
|
+
import{quoteIdentifier as r}from"./packem_shared/quoteIdentifier-CObIFRhb.mjs";import{OCC_VERSION_COLUMN as T}from"./packem_shared/OCC_VERSION_COLUMN-ByC64Jgx.mjs";const o=e=>{switch(e){case"boolean":return"INTEGER";case"bytes":return"BLOB";case"date":case"number":case"timestamp":return"REAL";default:return"TEXT"}},i=100,c=()=>[`${r("id")} TEXT PRIMARY KEY`,`${r("_creationTime")} REAL NOT NULL`],a=e=>e==="_id"||e==="id"?r("id"):e==="_creationTime"?r("_creationTime"):r(e),s=(e,t)=>r(`${e}_${t}`);export{i as MAX_D1_TABLE_COLUMNS,T as OCC_VERSION_COLUMN,a as columnRef,c as frameworkColumnDdl,s as physicalIndexName,r as quoteIdentifier,o as sqlAffinityForKind};
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{exportGlobalRows as o,importGlobalRows as t,selectGlobalTables as a}from"./packem_shared/exportGlobalRows-
|
|
1
|
+
import{exportGlobalRows as o,importGlobalRows as t,selectGlobalTables as a}from"./packem_shared/exportGlobalRows-DJHnVfLg.mjs";import{D1Client as i,D1Session as n}from"./packem_shared/D1Client-CzS0Qfa6.mjs";import{backfillD1SearchIndexes as D,createD1CtxDb as b,readD1CdcChanges as p,runD1AggregateMigrations as x,runD1CdcMigration as c,runD1GlobalTableMigrations as g,runD1RankMigrations as f,runD1SearchMigrations as m,sweepD1CdcRetention as C}from"./packem_shared/backfillD1SearchIndexes-V-i_kEvG.mjs";import{facetGlobalColumn as d,listGlobalTables as G,readGlobalTablePage as M}from"./packem_shared/facetGlobalColumn-EeEbDTka.mjs";import{MigrationRunner as T}from"./packem_shared/MigrationRunner-SadkIbU5.mjs";import{D1TimeoutError as w,isTransientD1Error as S,retryingExec as y,withD1Retry as E}from"./packem_shared/D1TimeoutError-D4YUqZPk.mjs";import{default as q}from"./packem_shared/sqliteDialect-J6_WTDHg.mjs";import{applyCdcChanges as I}from"@lunora/shard-engine";import{createSqlCtxDb as j}from"@lunora/sql-store";export{i as D1Client,n as D1Session,w as D1TimeoutError,T as MigrationRunner,I as applyCdcChanges,D as backfillD1SearchIndexes,b as createD1CtxDb,j as createSqlCtxDb,o as exportGlobalRows,d as facetGlobalColumn,t as importGlobalRows,S as isTransientD1Error,G as listGlobalTables,p as readD1CdcChanges,M as readGlobalTablePage,y as retryingExec,x as runD1AggregateMigrations,c as runD1CdcMigration,g as runD1GlobalTableMigrations,f as runD1RankMigrations,m as runD1SearchMigrations,a as selectGlobalTables,q as sqliteDialect,C as sweepD1CdcRetention,E as withD1Retry};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const o="_version";export{o as OCC_VERSION_COLUMN};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{toErrorBody as p}from"@lunora/errors";import{n as E,e as m,d as g}from"./wire-codec-
|
|
1
|
+
import{toErrorBody as p}from"@lunora/errors";import{n as E,e as m,d as g}from"./wire-codec-Cgm2xFo4.mjs";import{runD1GlobalTableMigrations as w}from"./backfillD1SearchIndexes-V-i_kEvG.mjs";import{quoteIdentifier as u}from"./quoteIdentifier-CObIFRhb.mjs";import{decodeGlobalRow as R}from"@lunora/sql-store";const O=200,k=(t,e)=>{const o=r=>t.tables[r]?.shardMode?.kind==="global";return e&&e.length>0?e.filter(r=>o(r)):Object.keys(t.tables).filter(r=>o(r))},h=(t,e,o)=>{const r=t.tables[e];return r?R(r,o):{_creationTime:o._creationTime,_id:o.id}},y=t=>E(t)?m(t):t,F=async function*(t,e,o){const r=k(e,o.tables),i=o.batchSize??O;await w(t,e);for(const s of r){const n=u(s);let a,l=!0;for(;l;){const c=a===void 0?await t.all(`SELECT * FROM ${n} ORDER BY "id" LIMIT ?`,[i]):await t.all(`SELECT * FROM ${n} WHERE "id" > ? ORDER BY "id" LIMIT ?`,[a,i]);for(const f of c)yield{doc:y(h(e,s,f)),table:s};const d=c.at(-1);d!==void 0&&(a=String(d.id)),l=c.length===i}}},b=t=>t?._meta?.column?.notNull===!1,I=(t,e)=>{const o=new Set;for(const[r,i]of Object.entries(t.shape)){if(e[r]!==null||i.kind!=="optional"||b(i))continue;const s=i._meta?.inner;b(s)||o.add(r)}return o.size===0?e:Object.fromEntries(Object.entries(e).filter(([r])=>!o.has(r)))},T=new Set(["_creationTime","_id"]),_=(t,e)=>Object.keys(e).find(o=>!T.has(o)&&!Object.hasOwn(t.shape,o)),S=(t,e,o)=>{const r=t.tables[e];if(!r)return`unknown table: ${e}`;const i=_(r,o);if(i!==void 0)return`unexpected field "${i}": not declared in table "${e}"`;for(const[s,n]of Object.entries(r.shape)){const a=o[s],l=n.kind==="optional";if(a===void 0&&l)continue;const c=n.parse;if(typeof c=="function")try{c(a)}catch(d){const f=d instanceof Error?d.message:String(d);return`field "${s}": ${f}`}}},v=async(t,e,o,r)=>{try{return e?(await e.all(`SELECT 1 AS hit FROM ${u(o)} WHERE "id" = ? LIMIT 1`,[r])).length>0:await t.get(r)!==null}catch{return!1}},A=async(t,e,o,r,i)=>{const{doc:s,table:n}=r;if(typeof n!="string"||n.length===0)return{error:{code:"BAD_ROW",line:i,message:"row is missing `table`",table:n},kind:"error"};if(e.tables[n]?.shardMode?.kind!=="global")return{kind:"skip"};if(!s||typeof s!="object"||Array.isArray(s))return{error:{code:"BAD_ROW",line:i,message:"row is missing or malformed `doc`",table:n},kind:"error"};let a;try{a=g(s)}catch(d){return{error:{code:"BAD_ROW",line:i,message:d instanceof Error?d.message:String(d),table:n},kind:"error"}}a=I(e.tables[n],a);const l=S(e,n,a);if(l!==void 0)return{error:{code:"VALIDATION_ERROR",line:i,message:l,table:n},kind:"error"};const c=typeof a._id=="string"?a._id:void 0;if(c!==void 0&&await v(t,o.exec,n,c))return{kind:"conflict"};try{return await t.insert(n,a,{allowExplicitId:!0}),{inserted:n,kind:"inserted"}}catch(d){const{body:f}=p(d,{fallbackCode:"INSERT_FAILED"});return{error:{code:f.code,line:i,message:f.message,table:n},kind:"error"}}},$=async(t,e,o)=>{const r=[],i={};let s=0,n=(o.startLine??1)-1;for(const a of o.rows){n+=1;const l=a.line??n,c=await A(t,e,o,a,l);switch(c.kind){case"conflict":{s+=1;break}case"error":{r.push(c.error);break}case"inserted":{i[c.inserted]=(i[c.inserted]??0)+1;break}}}return{conflicts:s,errors:r,inserted:i}};export{F as exportGlobalRows,$ as importGlobalRows,k as selectGlobalTables};
|
package/dist/packem_shared/{facetGlobalColumn-DC1jYCrB.mjs → facetGlobalColumn-EeEbDTka.mjs}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{LunoraError as E}from"@lunora/errors";import{sqliteEncode as I,decodeGlobalRow as $}from"@lunora/sql-store";import{n as M,e as v}from"./wire-codec-
|
|
1
|
+
import{LunoraError as E}from"@lunora/errors";import{sqliteEncode as I,decodeGlobalRow as $}from"@lunora/sql-store";import{n as M,e as v}from"./wire-codec-Cgm2xFo4.mjs";import{runD1GlobalTableMigrations as S}from"./backfillD1SearchIndexes-V-i_kEvG.mjs";import{quoteIdentifier as i}from"./quoteIdentifier-CObIFRhb.mjs";const C=50,g=500,y=30,U=200,h=(t,o,n)=>Math.min(Math.max(t,o),n),F=/^sqlite_|^_cf_|^d1_|^__cdc|^__lunora_|__agg_|__rank_|__fts_/u,k=t=>F.test(t),N=/password|secret|token|hash|salt|credential/iu,p=async t=>(await t.all("SELECT name FROM sqlite_master WHERE type = 'table' ORDER BY name",[])).map(n=>String(n.name)).filter(n=>!k(n)),A=async(t,o,n)=>{if(await S(t,o),!(await p(t)).includes(n))throw new E("UNKNOWN_TABLE",`unknown table: ${n}`,{status:404})},T=async(t,o,n="",a=[])=>{const e=await t.all(`SELECT COUNT(*) AS c FROM ${o}${n}`,a);return Number(e[0]?.c??0)},L=(t,o,n)=>t.tables[o]!==void 0&&n==="_id"?"id":n,O=(t,o,n,a)=>{const e=[],r=[];for(const s of a??[]){if(!n.includes(s.column))throw new E("UNKNOWN_COLUMN",`unknown column: ${s.column}`,{status:404});if(t.tables[o]===void 0&&N.test(s.column))throw new E("FORBIDDEN",`cannot filter on a redacted column: ${s.column}`,{status:403});const l=i(L(t,o,s.column));s.value===null||s.value===void 0?e.push(`${l} IS NULL`):(e.push(`${l} = ?`),r.push(I(s.value)))}return{params:r,where:e.length>0?` WHERE ${e.join(" AND ")}`:""}},q=(t,o,n)=>{const a=t.tables[o];if(a)return $(a,n);const e={};for(const[r,s]of Object.entries(n))e[r]=s!=null&&N.test(r)?"•••":s;return e},R=async(t,o,n)=>{const a=o.tables[n];return a?["_id","_creationTime",...Object.keys(a.shape)]:(await t.all(`PRAGMA table_info(${i(n)})`,[])).map(r=>String(r.name))},G=async(t,o,n)=>{if(o.tables[n])return;const a=await t.all(`PRAGMA foreign_key_list(${i(n)})`,[]);if(a.length===0)return;const e={};for(const r of a){const s=String(r.from),l=String(r.table);e[s]??=l}return e},K=async(t,o)=>{await S(t,o);const n=await p(t);return Promise.all(n.map(async a=>({name:a,rowCount:await T(t,i(a))})))},Y=async(t,o,n)=>{const{table:a}=n;await A(t,o,a);const e=h(Math.trunc(n.limit??C),1,g),r=Math.max(0,Math.trunc(n.offset??0)),s=i(a),l=await R(t,o,a),{params:w,where:u}=O(o,a,l,n.filters),f=await T(t,s,u,w),m=(await t.all(`SELECT * FROM ${s}${u} LIMIT ? OFFSET ?`,[...w,e,r])).map(d=>{const c=q(o,a,d);return M(c)?v(c):c}),b=await G(t,o,a);return b===void 0?{columns:l,rows:m,total:f}:{columns:l,refs:b,rows:m,total:f}},H=async(t,o,n)=>{const{column:a,table:e}=n;await A(t,o,e);const r=await R(t,o,e);if(!r.includes(a))throw new E("UNKNOWN_COLUMN",`unknown column: ${a}`,{status:404});const s=i(e),{params:l,where:w}=O(o,e,r,n.filters);if(o.tables[e]===void 0&&N.test(a)){const c=await T(t,s,w,l);return{truncated:!1,values:c===0?[]:[{count:c,value:"•••"}]}}const u=h(Math.trunc(n.limit??y),1,U),f=i(L(o,e,a)),_=await t.all(`SELECT ${f} AS value, COUNT(*) AS count FROM ${s}${w} GROUP BY ${f} ORDER BY count DESC LIMIT ?`,[...l,u+1]),m=_.length>u,d=(m?_.slice(0,u):_).map(c=>({count:Number(c.count),value:c.value}));return{truncated:m,values:M(d)?v(d):d}};export{H as facetGlobalColumn,K as listGlobalTables,Y as readGlobalTablePage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const w=r=>{let t="";for(let o=0;o<r.length;o+=32768)t+=String.fromCharCode(...r.subarray(o,o+32768));return btoa(t)},l=r=>{const t=atob(r),s=new Uint8Array(t.length);for(let o=0;o<t.length;o+=1)s[o]=t.codePointAt(o)??0;return s},i="$lunora.wire$";const m="__proto__",g={BigInt64Array,BigUint64Array,Float32Array,Float64Array,Int8Array,Int16Array,Int32Array,Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array},A={Error,EvalError,RangeError,ReferenceError,SyntaxError,TypeError,URIError},E=r=>{if(r===null||typeof r!="object")return!1;const t=Object.getPrototypeOf(r);return t===null||t===Object.prototype},p=(r,t=0)=>{if(t>64)return!0;if(r===null)return!1;const s=typeof r;if(s==="string"||s==="boolean")return!1;if(s==="number")return!Number.isFinite(r);if(s!=="object")return!0;if(Array.isArray(r))return r.length>0&&r[0]===i?!0:r.some(o=>o===void 0||p(o,t+1));if(!E(r)||Object.hasOwn(r,m))return!0;for(const o of Object.keys(r)){const c=r[o];if(c!==void 0&&p(c,t+1))return!0}return!1},u=(r,t=0)=>{if(t>64)throw new RangeError("wire-codec: value nesting exceeds the 64-level limit");if(r===void 0)return[i,"undefined"];if(r===null)return null;const s=typeof r;if(s==="bigint")return[i,"bigint",r.toString()];if(s==="number"){const e=r;return Number.isNaN(e)?[i,"nan"]:e===1/0?[i,"inf"]:e===-1/0?[i,"-inf"]:e}if(s!=="object")return r;if(r instanceof Date)return[i,"date",u(r.getTime(),t+1)];if(r instanceof Error){const e=r,n={};for(const a of Object.keys(e))e[a]!==void 0&&(n[a]=u(e[a],t+1));const f=[i,"error",e.name,e.message,n];return e.cause!==void 0&&f.push(u(e.cause,t+1)),f}if(r instanceof URL)return[i,"url",r.href];if(r instanceof Map)return[i,"map",[...r.entries()].map(([e,n])=>[u(e,t+1),u(n,t+1)])];if(r instanceof Set)return[i,"set",[...r].map(e=>u(e,t+1))];if(r instanceof ArrayBuffer)return[i,"bytes",w(new Uint8Array(r)),"ArrayBuffer"];if(ArrayBuffer.isView(r)){const e=r,n=e.constructor.name,f=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return n==="Uint8Array"?[i,"bytes",w(f)]:[i,"bytes",w(f),n]}if(Array.isArray(r)){const e=r.map(n=>u(n,t+1));return e.length>0&&e[0]===i?[i,"arr",e]:e}if(!E(r)){const e=r.constructor?.name??"value";throw new TypeError(`wire-codec: cannot encode a ${e} over the Lunora wire — only plain objects, arrays, and the supported built-ins (Date, Error, URL, Map, Set, ArrayBuffer/typed arrays, bigint) round-trip`)}const o=r,c={};for(const e of Object.keys(o)){const n=o[e];if(n===void 0)continue;const f=u(n,t+1);e===m?Object.defineProperty(c,e,{configurable:!0,enumerable:!0,value:f,writable:!0}):c[e]=f}return c},y=(r,t=0)=>{if(t>64)throw new RangeError("wire-codec: value nesting exceeds the 64-level limit");if(r===null||typeof r!="object")return r;if(Array.isArray(r)){if(r[0]===i)switch(r[1]){case"-inf":return-1/0;case"arr":return r[2].map(e=>y(e,t+1));case"bigint":{const e=r[2];if(typeof e!="string"||e.length>1024||!/^-?\d+$/.test(e))throw new RangeError("wire-codec: invalid or over-long bigint (max 1024 digits)");return BigInt(e)}case"date":{const e=y(r[2],t+1);if(typeof e!="number")throw new TypeError("wire-codec: malformed date — epoch must be a number");return new Date(e)}case"map":{const e=r[2];return new Map(e.map(n=>{if(!Array.isArray(n)||n.length!==2)throw new TypeError("wire-codec: malformed map entry — expected a [key, value] pair");return[y(n[0],t+1),y(n[1],t+1)]}))}case"set":return new Set(r[2].map(e=>y(e,t+1)));case"url":{const e=r[2];if(typeof e!="string")throw new TypeError("wire-codec: malformed url — href must be a string");return new URL(e)}case"error":{const e=r[2],n=r[3],f=(Object.hasOwn(A,e)?A[e]:void 0)??Error,a=new f(n);a.name!==e&&Object.defineProperty(a,"name",{configurable:!0,value:e,writable:!0});const b=y(r[4],t+1);if(b===null||typeof b!="object"||Array.isArray(b))throw new TypeError("wire-codec: malformed error — props must be an object");for(const d of Object.keys(b))d===m?Object.defineProperty(a,d,{configurable:!0,enumerable:!0,value:b[d],writable:!0}):a[d]=b[d];return r.length>5&&Object.defineProperty(a,"cause",{configurable:!0,value:y(r[5],t+1),writable:!0}),a}case"bytes":{const e=r[2];if(typeof e!="string")throw new TypeError("wire-codec: malformed bytes — payload must be a base64 string");const n=l(e),f=r[3]??"Uint8Array";if(f==="ArrayBuffer")return n.buffer.byteLength===n.byteLength?n.buffer:n.slice().buffer;const a=Object.hasOwn(g,f)?g[f]:void 0;return a?new a(n.slice().buffer):n}case"inf":return 1/0;case"nan":return Number.NaN;case"undefined":return;default:return r.map(e=>y(e,t+1))}return r.map(c=>y(c,t+1))}const s=r,o={};for(const c of Object.keys(s)){const e=y(s[c],t+1);c===m?Object.defineProperty(o,c,{configurable:!0,enumerable:!0,value:e,writable:!0}):o[c]=e}return o};export{y as d,u as e,p as n};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lunora/d1",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.105",
|
|
4
4
|
"description": "D1 adapter for Lunora .global() tables, wrapping the Sessions API for read-your-writes",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare",
|
|
@@ -50,10 +50,10 @@
|
|
|
50
50
|
"access": "public"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@lunora/errors": "1.0.0-alpha.
|
|
54
|
-
"@lunora/platform": "1.0.0-alpha.
|
|
55
|
-
"@lunora/shard-engine": "1.0.0-alpha.
|
|
56
|
-
"@lunora/sql-store": "1.0.0-alpha.
|
|
53
|
+
"@lunora/errors": "1.0.0-alpha.30",
|
|
54
|
+
"@lunora/platform": "1.0.0-alpha.25",
|
|
55
|
+
"@lunora/shard-engine": "1.0.0-alpha.54",
|
|
56
|
+
"@lunora/sql-store": "1.0.0-alpha.107",
|
|
57
57
|
"drizzle-orm": "^0.45.2"
|
|
58
58
|
},
|
|
59
59
|
"engines": {
|