turbine-orm 0.64.1 → 0.65.0

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/sqlite.js CHANGED
@@ -453,6 +453,22 @@ export const sqliteDialect = {
453
453
  castAggregate(expr, target) {
454
454
  return `CAST(${expr} AS ${target === 'int' ? 'INTEGER' : 'REAL'})`;
455
455
  },
456
+ // SQLite's grammar only allows OFFSET after LIMIT, so `offset` without
457
+ // `limit` (valid on Postgres, which the default path is written for) is a
458
+ // syntax error here. A negative LIMIT is SQLite's documented "no upper
459
+ // bound", so that shape becomes `LIMIT -1 OFFSET n`. The other shapes emit
460
+ // byte-identically to the default path.
461
+ buildLimitOffset(input) {
462
+ const { limitPlaceholder, offsetPlaceholder } = input;
463
+ if (limitPlaceholder === undefined && offsetPlaceholder === undefined)
464
+ return '';
465
+ if (limitPlaceholder === undefined)
466
+ return ` LIMIT -1 OFFSET ${offsetPlaceholder}`;
467
+ let s = ` LIMIT ${limitPlaceholder}`;
468
+ if (offsetPlaceholder !== undefined)
469
+ s += ` OFFSET ${offsetPlaceholder}`;
470
+ return s;
471
+ },
456
472
  // No `= ANY(array)` in SQLite. `json_each` expands a single JSON-array param
457
473
  // into a row set, keeping ONE placeholder (so the SQL cache stays valid
458
474
  // regardless of list length) and handling the empty-list case correctly.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "turbine-orm",
3
- "version": "0.64.1",
3
+ "version": "0.65.0",
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).",
@@ -111,7 +111,7 @@
111
111
  "README.md"
112
112
  ],
113
113
  "sideEffects": false,
114
- "//prepublishOnly": "The gate for a MANUAL LOCAL `npm publish`, which is the normal release flow here, so it is the ONLY gate on that path (release.yml runs on a pushed tag, and a local publish never triggers it). `check:package` joined it 2026-07-28: publint --strict + attw --pack, the two checks that catch a broken exports map or CJS declarations that resolve to ESM, which is a class of bug that shipped once already and is invisible to every other script here. `test:coverage:cli` joined at the same time (~3s) so a local publish cannot ship a Studio/migrate coverage regression. Still deliberately absent, because they need a live database or minutes of packing: the Postgres integration suite, the engine containers, and the tarball install smoke, all of which release.yml + ci.yml run.",
114
+ "//prepublishOnly": "The gate for a MANUAL LOCAL `npm publish`, which is the normal release flow here, so it is the ONLY gate on that path (release.yml runs on a pushed tag, and a local publish never triggers it). `check:package` joined it 2026-07-28: publint --strict + attw --pack, the two checks that catch a broken exports map or CJS declarations that resolve to ESM, which is a class of bug that shipped once already and is invisible to every other script here. `test:coverage:cli` joined at the same time (~3s) so a local publish cannot ship a Studio/migrate coverage regression. Still deliberately absent, because they need containers or minutes of packing: the non-Postgres engine suites and the tarball install smoke, which release.yml + ci.yml run. check:cycles joined 2026-08-02 (the query/->client.ts acyclicity rule as a build failure instead of CLAUDE.md prose). check:release-tests joined at the same time and runs LAST because it is the expensive one: outside CI it runs the full DB-backed `npm test` (refusing to publish when no DATABASE_URL is reachable, escape hatch TURBINE_PUBLISH_WITHOUT_DB=1), which closes the old gap where the release path never executed a query against a real Postgres; in CI it self-skips since release.yml/nightly.yml run that suite as dedicated jobs. Known double-coverage: `npm test` re-runs the unit-lane files serially, so a local publish executes them twice; accepted, the second pass is the one with a real database behind it.",
115
115
  "scripts": {
116
116
  "prebuild": "npm run gen:studio",
117
117
  "build": "rm -rf dist && tsc && tsc --project tsconfig.cjs.json && echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json",
@@ -136,8 +136,10 @@
136
136
  "format": "biome format --write src/",
137
137
  "check:error-codes": "tsx scripts/check-error-codes.ts",
138
138
  "check:changelog": "node scripts/check-changelog-headings.mjs",
139
+ "check:cycles": "node scripts/check-import-cycles.mjs",
140
+ "check:release-tests": "node scripts/check-release-tests.mjs",
139
141
  "check:package": "publint --strict && attw --pack . --profile node16",
140
- "prepublishOnly": "npm run build && npm run typecheck && npm run lint && npm run test:unit && npm run test:coverage:cli && npm run check:error-codes && npm run check:changelog && npm run check:package && npm run size",
142
+ "prepublishOnly": "npm run build && npm run typecheck && npm run lint && npm run test:unit && npm run test:coverage:cli && npm run check:error-codes && npm run check:changelog && npm run check:cycles && npm run check:package && npm run size && npm run check:release-tests",
141
143
  "prepack": "node scripts/strip-prepare.mjs",
142
144
  "postpack": "node scripts/restore-prepare.mjs",
143
145
  "size": "size-limit",