orez-sync-cf-host 0.9.7 → 0.10.1

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
@@ -113,7 +113,7 @@ every socket attempt, including reconnects, so short-lived tokens are never
113
113
  reused after the wake connection drops:
114
114
 
115
115
  ```ts
116
- import { ensureHttpPullTransport } from 'orez/zero-http'
116
+ import { ensureHttpPullTransport } from 'orez-lite/client'
117
117
 
118
118
  ensureHttpPullTransport({
119
119
  origin: syncOrigin,
@@ -1,22 +1,8 @@
1
1
  import type { CompiledTransactionQueryPlan, TransactionQueryBudget } from './transaction-query.js';
2
2
  import type { SyncSql } from './types.js';
3
- import type { ApplicationTransaction, ExecResult, SqlStatementMetadata } from 'orez-sync-executor';
3
+ import type { ApplicationTransaction, ExecResult, SqlWireValue, SqlStatementMetadata } from 'orez-sync-executor';
4
4
  import type { TransactionQueryFormat } from 'orez-sync-executor';
5
- type WireValue = {
6
- kind: 'null';
7
- } | {
8
- kind: 'integer';
9
- value: string;
10
- } | {
11
- kind: 'real';
12
- value: number;
13
- } | {
14
- kind: 'text';
15
- value: string;
16
- } | {
17
- kind: 'blob';
18
- value: number[];
19
- };
5
+ type WireValue = SqlWireValue;
20
6
  type WireRow = {
21
7
  columns: string[];
22
8
  values: WireValue[];
@@ -1,3 +1,4 @@
1
+ import { encodeSqlValue } from 'orez-sync-executor';
1
2
  import { executeTransactionQueryPlan } from './transaction-query.js';
2
3
  import { trackBillableCursorRows } from './write-safeguards.js';
3
4
  // Match transaction control only as the statement itself. CREATE TRIGGER uses
@@ -87,25 +88,7 @@ export function decodeSqlParams(value) {
87
88
  return value.map((binding, index) => decodeBinding(binding, `params[${index}]`));
88
89
  }
89
90
  function encodeResult(value) {
90
- if (value === null)
91
- return { kind: 'null' };
92
- if (typeof value === 'number') {
93
- return Number.isInteger(value)
94
- ? { kind: 'integer', value: String(value) }
95
- : { kind: 'real', value };
96
- }
97
- if (typeof value === 'string')
98
- return { kind: 'text', value };
99
- if (value instanceof ArrayBuffer) {
100
- return { kind: 'blob', value: Array.from(new Uint8Array(value)) };
101
- }
102
- if (ArrayBuffer.isView(value)) {
103
- return {
104
- kind: 'blob',
105
- value: Array.from(new Uint8Array(value.buffer, value.byteOffset, value.byteLength)),
106
- };
107
- }
108
- throw new TypeError(`unsupported SqlStorage result: ${Object.prototype.toString.call(value)}`);
91
+ return encodeSqlValue(value);
109
92
  }
110
93
  /**
111
94
  * The sole JS SQL adapter used by wasm. It is synchronous, consumes every
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orez-sync-cf-host",
3
- "version": "0.9.7",
3
+ "version": "0.10.1",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -55,7 +55,7 @@
55
55
  "typecheck": "bun run build:dist:platform && tsc --noEmit"
56
56
  },
57
57
  "dependencies": {
58
- "orez-sync-executor": "0.9.7"
58
+ "orez-sync-executor": "0.10.1"
59
59
  },
60
60
  "devDependencies": {
61
61
  "@cloudflare/workers-types": "4.20260617.1",