@crvouga/mockingbird-service-postgres 3.4.0 → 3.4.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.
@@ -26967,7 +26967,7 @@ function readSlabCell(column, rowIndex, intern, rowCount) {
26967
26967
  }
26968
26968
  if (pack === PACK_INT) {
26969
26969
  const integer2 = view.getBigInt64(nonNullIndex * 8, true);
26970
- return integer2 <= BigInt(Number.MAX_SAFE_INTEGER) && integer2 >= BigInt(Number.MIN_SAFE_INTEGER) ? Number(integer2) : integer2;
26970
+ return !column.integerBigInt && integer2 <= BigInt(Number.MAX_SAFE_INTEGER) && integer2 >= BigInt(Number.MIN_SAFE_INTEGER) ? Number(integer2) : integer2;
26971
26971
  }
26972
26972
  if (pack === PACK_TEXT_INTERN) {
26973
26973
  const id = view.getUint32(nonNullIndex * 4, true);
@@ -27528,7 +27528,8 @@ function decodeInner(snapshot, prng, clock) {
27528
27528
  if (meta.stats) state.tableStats.set(table.oid, meta.stats);
27529
27529
  const rowCount = readVarintU32(r);
27530
27530
  const slabColumns = [];
27531
- for (let c = 0; c < meta.columns.length; c++) slabColumns.push(readPackedColumn(r, rowCount, intern));
27531
+ for (let c = 0; c < meta.columns.length; c++)
27532
+ slabColumns.push(readPackedColumn(r, rowCount, intern, meta.columns[c].type.id));
27532
27533
  table.attachSlab(new ColumnarSlab(snapshot, rowCount, slabColumns, intern));
27533
27534
  schema.tables.set(table.name, table);
27534
27535
  }
@@ -27541,7 +27542,7 @@ function decodeInner(snapshot, prng, clock) {
27541
27542
  const matRowCount = readVarintU32(r);
27542
27543
  const width = readVarintU32(r);
27543
27544
  const cols = [];
27544
- for (let c = 0; c < width; c++) cols.push(readPackedColumn(r, matRowCount, intern));
27545
+ for (let c = 0; c < width; c++) cols.push(readPackedColumn(r, matRowCount, intern, meta.matColumns?.[c]?.type));
27545
27546
  const slab = new ColumnarSlab(snapshot, matRowCount, cols, intern);
27546
27547
  matRows = slab.materialize();
27547
27548
  }
@@ -27813,7 +27814,7 @@ function writePackedColumn(w, rows, col, internId, forceId) {
27813
27814
  writeTaggedDatum(w, rows[i][col], internId, forceId);
27814
27815
  }
27815
27816
  }
27816
- function readPackedColumn(r, n, intern) {
27817
+ function readPackedColumn(r, n, intern, type) {
27817
27818
  const pack = r.u8();
27818
27819
  if (pack === PACK_NULL) return { pack, nullBitmap: null, payload: new Uint8Array(0) };
27819
27820
  const bits = r.raw(n + 7 >> 3);
@@ -27826,7 +27827,8 @@ function readPackedColumn(r, n, intern) {
27826
27827
  r.skipAlign4();
27827
27828
  const width = 8;
27828
27829
  const payload = r.raw(nonNull * width);
27829
- return { pack, nullBitmap: bits, payload };
27830
+ const integerBigInt = type !== void 0 && ["int8", "money", "time", "timestamp", "timestamptz"].includes(type);
27831
+ return { pack, nullBitmap: bits, payload, integerBigInt };
27830
27832
  }
27831
27833
  if (pack === PACK_TEXT_INTERN) {
27832
27834
  r.skipAlign4();