@syncular/typegen 0.15.6 → 0.15.8

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/query.js CHANGED
@@ -949,12 +949,17 @@ export function analyzeStatement(name, location, statementText, ir, db, naming =
949
949
  };
950
950
  }
951
951
  if (source !== null) {
952
- // Exact: IR column type + IR nullability. (decltype agrees; we prefer
953
- // the IR type so blob_ref/crdt/json semantic types survive.)
952
+ // Exact: app-facing queries read the decrypted local mirror. Encrypted
953
+ // columns therefore expose their pre-wire declaredType, while the schema
954
+ // IR and mutation codec continue to carry the bytes wire type.
955
+ const sourceType = source.column.encrypted === true &&
956
+ source.column.declaredType !== undefined
957
+ ? source.column.declaredType
958
+ : source.column.type;
954
959
  return {
955
960
  name: sqlName,
956
961
  langName,
957
- type: source.column.type,
962
+ type: sourceType,
958
963
  nullable: source.column.nullable,
959
964
  fidelity: 'exact',
960
965
  origin: { table: source.table, column: source.column.name },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syncular/typegen",
3
- "version": "0.15.6",
3
+ "version": "0.15.8",
4
4
  "description": "Syncular schema-to-TypeScript type generator and the `syncular` CLI",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Benjamin Kniffler",
@@ -48,7 +48,7 @@
48
48
  "!dist/**/*.test.d.ts"
49
49
  ],
50
50
  "devDependencies": {
51
- "@syncular/core": "0.15.6",
52
- "@syncular/server": "0.15.6"
51
+ "@syncular/core": "0.15.8",
52
+ "@syncular/server": "0.15.8"
53
53
  }
54
54
  }
package/src/query.ts CHANGED
@@ -1378,12 +1378,18 @@ export function analyzeStatement(
1378
1378
  };
1379
1379
  }
1380
1380
  if (source !== null) {
1381
- // Exact: IR column type + IR nullability. (decltype agrees; we prefer
1382
- // the IR type so blob_ref/crdt/json semantic types survive.)
1381
+ // Exact: app-facing queries read the decrypted local mirror. Encrypted
1382
+ // columns therefore expose their pre-wire declaredType, while the schema
1383
+ // IR and mutation codec continue to carry the bytes wire type.
1384
+ const sourceType =
1385
+ source.column.encrypted === true &&
1386
+ source.column.declaredType !== undefined
1387
+ ? source.column.declaredType
1388
+ : source.column.type;
1383
1389
  return {
1384
1390
  name: sqlName,
1385
1391
  langName,
1386
- type: source.column.type,
1392
+ type: sourceType,
1387
1393
  nullable: source.column.nullable,
1388
1394
  fidelity: 'exact',
1389
1395
  origin: { table: source.table, column: source.column.name },