turbine-orm 0.64.0 → 0.64.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.
@@ -459,20 +459,17 @@ function orderByEntryFingerprint(qi, d, targetTable) {
459
459
  return String(d);
460
460
  }
461
461
  function buildOrderBy(qi, orderBy, params, lateralSink) {
462
- // Dev-only: validate that orderBy fields exist in the table schema. Relation
463
- // orderBy keys (object values that are neither a vector nor an OrderBySpec)
464
- // are validated in the relation branch below, so skip them here.
465
- if (process.env.NODE_ENV !== 'production') {
466
- for (const [key, value] of (0, filters_js_1.orderByEntries)(orderBy)) {
467
- if (isRelationOrderByValue(qi, value) && (0, utils_js_1.ownLookup)(qi.tableMeta.relations, key))
468
- continue;
469
- const snakeKey = (0, schema_js_1.camelToSnake)(key);
470
- if (!qi.tableMeta.columns.some((c) => c.name === snakeKey) && !Object.hasOwn(qi.tableMeta.columnMap, key)) {
471
- console.warn(`[turbine] Unknown orderBy field "${key}" for table "${qi.tableMeta.name}". ` +
472
- 'This will cause a runtime error.');
473
- }
474
- }
475
- }
462
+ // There used to be a dev-only pre-scan here that printed `Unknown orderBy
463
+ // field "x" for table "y". This will cause a runtime error.` and then let
464
+ // compilation continue into the code below, which throws for the same key
465
+ // with a better message (it names the table, suggests the closest column and
466
+ // lists the valid relations). Every unknown-key shape was measured: plain
467
+ // direction, OrderBySpec, JSON path, both relation-shaped values, and array
468
+ // form. All six warn-and-then-throw; none reaches the end of this function.
469
+ // A warning whose entire content is a prediction of the exception on the next
470
+ // line is noise in dev logs and a second place to keep the key-resolution
471
+ // rules in step, so it is gone. See orderby-unknown-field.test.ts, which pins
472
+ // the refusal itself across that surface.
476
473
  const meta = qi.schema.tables[qi.table];
477
474
  let relOrdCounter = 0;
478
475
  return (0, filters_js_1.orderByEntries)(orderBy)
@@ -381,20 +381,17 @@ export function orderByEntryFingerprint(qi, d, targetTable) {
381
381
  return String(d);
382
382
  }
383
383
  export function buildOrderBy(qi, orderBy, params, lateralSink) {
384
- // Dev-only: validate that orderBy fields exist in the table schema. Relation
385
- // orderBy keys (object values that are neither a vector nor an OrderBySpec)
386
- // are validated in the relation branch below, so skip them here.
387
- if (process.env.NODE_ENV !== 'production') {
388
- for (const [key, value] of orderByEntries(orderBy)) {
389
- if (isRelationOrderByValue(qi, value) && ownLookup(qi.tableMeta.relations, key))
390
- continue;
391
- const snakeKey = camelToSnake(key);
392
- if (!qi.tableMeta.columns.some((c) => c.name === snakeKey) && !Object.hasOwn(qi.tableMeta.columnMap, key)) {
393
- console.warn(`[turbine] Unknown orderBy field "${key}" for table "${qi.tableMeta.name}". ` +
394
- 'This will cause a runtime error.');
395
- }
396
- }
397
- }
384
+ // There used to be a dev-only pre-scan here that printed `Unknown orderBy
385
+ // field "x" for table "y". This will cause a runtime error.` and then let
386
+ // compilation continue into the code below, which throws for the same key
387
+ // with a better message (it names the table, suggests the closest column and
388
+ // lists the valid relations). Every unknown-key shape was measured: plain
389
+ // direction, OrderBySpec, JSON path, both relation-shaped values, and array
390
+ // form. All six warn-and-then-throw; none reaches the end of this function.
391
+ // A warning whose entire content is a prediction of the exception on the next
392
+ // line is noise in dev logs and a second place to keep the key-resolution
393
+ // rules in step, so it is gone. See orderby-unknown-field.test.ts, which pins
394
+ // the refusal itself across that surface.
398
395
  const meta = qi.schema.tables[qi.table];
399
396
  let relOrdCounter = 0;
400
397
  return orderByEntries(orderBy)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "turbine-orm",
3
- "version": "0.64.0",
3
+ "version": "0.64.1",
4
4
  "description": "Postgres-native TypeScript ORM, runs on Neon, Vercel Postgres, Cloudflare, Supabase. Streaming cursors, typed errors, single-query nested relations. One dependency, no WASM engine",
5
5
  "type": "module",
6
6
  "//exports": "Each subpath declares its types PER CONDITION. A single shared top-level \"types\" resolves to the ESM declarations for `require` too, which is TS1479 (\"is an ES module ... cannot be require()d\") for any CJS consumer on moduleResolution node16/nodenext. The require condition points at dist/cjs, which ships its own {\"type\":\"commonjs\"} package.json, so those declarations are CJS declarations. Gated in CI by publint + @arethetypeswrong/cli + a real .cts consumer typecheck (see the package-types job in ci.yml).",