Reylo v0.10.0 shrinks bundled query runtimes by up to 4.6×, runs programmatic migrations directly on your Postgres, MySQL, and SQLite clients without the CLI binary, lints unindexed queries with reylo lint, and adds support for Turso's own engine, Amazon Aurora DSQL, Effect SQL, Postgres 19, migrate.schema, and migrate.exclude.
Several breaking changes from v0.9.0 require updates in existing projects, listed in Upgrading from v0.9.0.
Smaller bundles
Bundled apps now ship only the runtime code, drivers, column readers, and value checks their compiled .sql modules actually use (#551, #642, fixes #543). Measured with esbuild 0.28 across four .run() queries minified into one CommonJS bundle:
| Dialect | Before | After | Reduction |
|---|---|---|---|
Postgres (pg)
| 104.7 KB | 30.0 KB | 3.5× |
MySQL (mysql2)
| 154.2 KB | 33.3 KB | 4.6× |
SQLite (better-sqlite3)
| 84.5 KB | 30.8 KB | 2.7× |
ClickHouse (@clickhouse/client)
| 104.1 KB | 39.5 KB | 2.6× |
Gzipped, the Postgres bundle drops from 37.3 KB to 12.3 KB and the MySQL bundle from 50.0 KB to 12.8 KB. What changed in the output:
- Installed drivers only: bundler plugins inspect runtime dependencies across the app's
package.json, the.sqlfile's package, workspace dependencies, and the workspace root, bundling only those drivers (Node's preload, Jest, andreylo generate typescriptkeep every driver). - Per-query readers and checks: each compiled module imports only the Postgres column readers, JSON helpers, parameter value checks, and array-dimension checks its statement needs.
- Opt-in error name maps: errors from
.try()carry database codes alone; importpostgresErrors,mysqlErrors, orclickhouseErrorsfromreyloonly when you need human-readable error names.
Programmatic migrations on your own client
The migrate() function now runs directly on an app's own Postgres, MySQL, or SQLite client, so production containers no longer need the reylo CLI binary installed (#653, #611, #680, #709, #710).
import postgres from "postgres";
import { migrate } from "reylo";
const sql = postgres(process.env.DATABASE_URL!);
const ran = await migrate(sql); // names of the migrations it ranWhat it supports:
- Postgres and MySQL clients: accepts
postgres.js4+,pg(PoolorClient), andmysql2(PoolorConnection), running Reylo Migrate's deploy engine compiled to WebAssembly (about 700 KB gzipped, tree-shaken out whenmigrateisn't imported; Cloudflare Workers and Durable Objects resolve an empty stand-in). - SQLite and Turso connections: accepts
@tursodatabase/database, its synchronous compatDatabase,better-sqlite3,node:sqlite, andbun:sqlite, running the same WebAssembly deploy engine with full drift and lock checks,BEGIN IMMEDIATEwrite locking, and Tursoforeign_keysguards (Durable Objectsmigrate(ctx.storage)keeps its synchronous runner) (#611, #710). - Bundled or on-disk files: Reylo's Vite, Rollup, Rolldown, esbuild, Next.js (
withReyloon Turbopack and webpack), and webpack/Rspack (rule()fromreylo/webpack) adapters bundle migration files into the build; plain Node readsreylo/(ordir) from the working directory at runtime (#709). - Safety and diagnostics: refuses transaction poolers (Neon
-poolerhosts, Supabase port 6543) and connections inside an open transaction, and reports broken constraints with the offending-row query just likereylo migrate deploy(#680).
Unindexed query linting
The reylo lint command reports filters and joins that scan every row of a table where a B-tree index could narrow the read (#706).
$ reylo lint q
q/calls_by_status.sql:1:20: Postgres reads every row of calls: no index serves its filter status = :status
select id, at from calls where status = :status
^^^^^
q/workspace_calls.sql:2:6: Postgres reads every row of workspaces: no index serves its filter name = :workspace
from workspaces w
^^^^^^^^^^
✗ 2 of 4 statements read every row of a table that an index could narrow
What it covers:
- CLI and CI:
reylo lint <paths> [--url <url>]exits 1 on a finding or query diagnostic and 2 when the database can't be reached;reylo analyzealso prints findings as warnings on stderr without changing stdout or its exit code. - Type check and codegen: findings appear as notes in type-check hovers and
reylo generate typescriptdoc comments without failing the type check. - Dialects: checks Postgres (14+), MySQL, and SQLite from query plans without running statements or needing rows in the tables.
Turso's own engine
Reylo now type-checks and migrates local databases built with Turso's own engine (@tursodatabase/database), including full-text indexes, MVCC journals, and Turso-specific SQL functions (#610, #611, #637, #641, closes #513 and #514).
create index docs_fts on docs using fts (title, body);
select id, title, fts_score(title, body, :q) as score
from docs
where fts_match(title, body, :q)
order by score descWhat it covers:
- Type checking: reads files containing
create index … using ftsandbacking_btreeindexes without failing on SQLite's parser, and types Turso built-ins (fts_match,fts_score,fts_highlight,uuid4_str,uuid7_str,time_*,dur_*, and vector functions) whenever@tursodatabase/databaseis inpackage.json. - Migrations: the
reylo migrateandreylo dbcommands run target and shadow databases through the project's installed@tursodatabase/databasewhenever a schema, migration, or file uses Turso index methods or an MVCC journal; apps can also migrate in-process viamigrate(db). - Engine-aware types: with
@tursodatabase/databaseor@tursodatabase/syncinstalled,uuid4()anduuid7()inferUint8Array(orunknownalongside@libsql/client, which returns strings), andregexpinfersboolean | null.
Amazon Aurora DSQL
Reylo now supports Amazon Aurora DSQL natively as a Postgres platform—including AWS IAM token signing, query type checking, and migrations under DSQL's one-DDL-per-transaction rules (#639, contributed by @ivanbarlog).
DATABASE_URL=postgres://abc123.dsql.us-east-1.on.aws/postgresFor runtime queries, pass a pg pool whose password option signs a fresh token per connection:
import { DsqlSigner } from "@aws-sdk/dsql-signer";
import pg from "pg";
import getUser from "./get_user.sql";
const hostname = "abc123.dsql.us-east-1.on.aws";
const signer = new DsqlSigner({ hostname, region: "us-east-1" });
const db = new pg.Pool({
host: hostname,
user: "admin",
database: "postgres",
ssl: true,
password: () => signer.getDbConnectAdminAuthToken(),
});
const user = await getUser.run(db, { id });What it covers:
- Automatic IAM login: the
reyloCLI signs fresh tokens for*.dsql.*.on.awsURLs over TLS using your AWS environment credentials,AWS_PROFILE, or SSO session. - DSQL-aware migrations:
reylo migrate newwrites one DDL statement per file, places new tables' foreign keys inline, builds indexes withcreate index async, waits for async index builds duringdeploy, and manages temporary shadow clusters automatically. - Upfront refusals: unsupported
schema.sqlfeatures (serial, array columns, enums, triggers, plaincreate index) fail immediately before creating a shadow cluster.
Effect SQL
Queries now run inside Effect SQL through effect(query, params) from reylo/effect, pulling SqlClient from context and joining active transactions inside sql.withTransaction() (#549).
import { Effect } from "effect";
import { SqlClient } from "effect/sql";
import { effect } from "reylo/effect";
import getUser from "./get_user.sql";
const program = Effect.gen(function* () {
const sql = yield* SqlClient.SqlClient;
return yield* sql.withTransaction(effect(getUser, { id: 1 }));
});What it covers:
- Supported clients: Postgres (
@effect/sql-pg), MySQL (@effect/sql-mysql2, cancelling interrupted queries viaKILL QUERY), and SQLite (@effect/sql-sqlite-node,@effect/sql-sqlite-bun,@effect/sql-sqlite-do,@effect/sql-d1,@effect/sql-libsql). - Errors and defects: database and driver errors fail the Effect with
SqlError; refused parameter values and row-count mismatches are defects. - Minimum version: requires
effect^4.1.6(optional peer dependency).
Postgres 19
Reylo now parses Postgres statements with Postgres 19.0's grammar and tracks Postgres 19 publication syntax in Reylo Migrate, while keeping Postgres 14–18 statements unchanged (#554, #567).
insert into kv (k, v) values (:k, :v) on conflict (k) do select returning k, v;
create publication cdc for all tables except (table audit_log), all sequences;What it covers:
- New 19 SQL typed: statements using
ON CONFLICT … DO SELECT RETURNINGinferonerow (at_most_onewithWHERE),IGNORE NULLSandRESPECT NULLSwindow clauses parse without breaking bareignore/respectaliases from Postgres 14–18, andREPACKruns outside migration transactions. - Publications in Migrate: publications using
FOR ALL SEQUENCESandFOR ALL TABLES EXCEPT (…)are introspected, diffed, and dumped accurately instead of being dropped or misread as published tables.
Schema from a command
Projects can now declare their desired schema in .reylo.yaml under migrate.schema instead of reylo/schema.sql, pulling SQL from a command, multiple files, or inline SQL (#714, closes #572).
migrate:
schema: $(cat schema/tables.sql schema/generated.sql)
# or: $(npx drizzle-kit export)What it covers:
- Schema commands: every command that reads
schema.sql(migrate new,dev,status,lock,deploy --dry-run,history push, anddb push) runs the command in memory and checksums its output inreylo.lock;db push --watchre-runs it when non-git-ignored files change. - Standalone deploys:
reylo migrate deployand bundled migrations never run the command, whilereylo migrate deploy --dry-runin CI does. - Strict validation: refuses having
reylo/schema.sqlalongsidemigrate.schema, as well as commands that exit non-zero or print nothing.
Excluding objects in migrations
Projects can now exclude custom tool-managed objects from Reylo Migrate in .reylo.yaml using glob patterns (* and ?), alongside expanded built-in exclusions for third-party tools (#654, #612, #598, closes #594).
migrate:
exclude:
tables: [public.sync_state, public.etl_*]
triggers: [public.orders.audit_*]What it covers:
- Per-dialect keys: supports
schemas,tables,triggers,functions,procedures,publications, andevent_triggerson Postgres;tables,triggers,functions,procedures, andeventson MySQL; andtableson SQLite. - Expanded built-in exclusions: automatically leaves out Cloudflare D1
_cf_*tables, Wranglerd1_migrations, Litestream tables, Hasurahdb_catalog, AWS DMS and Qlik tables, Bucardo, Slony, Zero, Neonneon_migration, PlanetScale/Vitess_vt_*tables, gh-ost tables, and leftover pt-osc/LHM triggers. - Dependency checks:
reylo migrate initrefuses when a project object (such as a view, foreign key, function, or publication) depends on an excluded object, naming each one.
Faster postgres.js 4.2 decoding
On postgres 4.2 and later, Reylo now reads rows through per-query .parsers() and .transform(false) instead of .raw(), cutting decoding overhead and enabling clients configured with transform.row (#658). Measured overhead over postgres.js defaults (16 columns, Node 24, postgres 4.2.0, idle 8-vCPU Linux VM, three runs):
| Rows | Before | After |
|---|---|---|
| 10,000 | +101% to +102% | +20% to +21% |
| 100 | +49% to +65% | +6% to +11% |
| 1 | +18% to +21% | +13% to +19% |
What else changed on postgres 4.2+:
- Row transforms supported: clients configured with
transform.rownow run compiled queries instead of being refused. - Declared names preserved: the
transform.columnoption no longer renames declared columns on compiled queries, including after aselect *migration or inside transactions.
Upgrading from v0.9.0
These are the major breaking changes most upgrading projects can hit. Smaller typing refinements, edge-case refusals, and dialect fixes are listed in All changes.
Every dialect
- Files written by an earlier
reylo generate typescriptare refused at runtime until regenerated. Runreylo generate typescriptagain after upgrading. Modules produced by bundler plugins rebuild automatically (#551, #587, #642). - Errors from
.try()no longer carryconditionon Postgres orcodeon MySQL and ClickHouse. Compareerror.codeon Postgres ("23505"),error.errnoon MySQL (1062, which still narrowserror.key), orerror.numberon ClickHouse, and look up names withpostgresErrors,mysqlErrors, orclickhouseErrorsfromreylo(#642). - Queries no longer carry input or output JSON Schemas. The
query.inputSchema,query.outputSchema,query["~standard"].jsonSchema,query["~reylo"].json,AsJson, anddefineQuery'sjsonSchemaoption are removed; remove references to them. JSON SchemaCHECKconstraints and typed JSON parameters (:p::jsonb('…')) are unchanged (#587). - Bundled queries refuse drivers not listed in the app's dependencies. Add your database driver package to the app's
package.jsonor a workspace package it depends on (#551). - Some key lookups now infer
Row | nullinstead ofRow[]. Queries matching a unique key viain (subquery)or= (subquery), Postgres queries matching a composite key via row-value comparison ((a, b) = (:a, :b)), and MySQL queries qualifying a table with the connection's own database now return a single row ornull; the type checker points at every caller reading[0]or iterating (#589, #694, #724). - Windows
$(…)commands in.reylo.yamlnow run in a built-insh-syntax shell instead ofcmd. Rewrite any Windowsdirect_urlcommand that usescmdsyntax (%VAR%,type) toshsyntax ($VAR,cat); plain executables such asop read …work unchanged, and macOS and Linux keepsh -c(#714).
Postgres
-
Connections are read from
DATABASE_URLordirect_urlalone, without libpqPG*environment variables. Environment variables (PGHOST,PGPORT,PGUSER,PGPASSWORD,PGDATABASE,PGOPTIONS, andPGSSL*) no longer fill in missing URL parts, and an incomplete URL withPGHOST,PGPORT,PGUSER,PGDATABASE, orPGOPTIONSset is refused before connecting. Interpolate those variables intodirect_urlin.reylo.yamlinstead (#648):direct_url: postgres:///?host=${PGHOST}&user=${PGUSER}&password=${PGPASSWORD}&dbname=${PGDATABASE}
SQLite
- The type check now prepares queries against
node:sqlite,sql.js, and@sqlite.org/sqlite-wasm(defaulting tonode:sqlitewhenpackage.jsonlists no SQLite driver outside Bun). Statements calling functions missing from that engine (or custom functions registered viadb.function()) now fail type-checking; if your driver comes through an unrecognized wrapper package, list the driver inpackage.json(#705, closes #681).
Reylo Migrate
- The first
reylo migrate statusandreylo migrate deployafter upgrading print "This database can't be compared here with what its last migration left". The catalog reader version bumped; runreylo migrate deploy --dry-runto inspect, and the nextdeploywrites a new fingerprint (#567, #654). - On MySQL, shadow replays now refuse cross-database writes and unparseable statements naming another database. Set
shadow_urlto a separate MySQL server, or re-baseline from the database withreylo migrate initandreylo migrate history push --url <db>(#693). - On Postgres,
reylo migrate newnow refuses column type changes between types with no Postgres cast until--drop <table>.<column>names the column. Previously it wroteusing <col>::text::<new type>silently, which could corrupt rows or fail at deploy; enum-to-enum changes still convert by label (#707, closes #689).
All changes
Every substantive change since v0.9.0, grouped by area.
Core and runtime
- Bundle only the drivers, column readers, parameter checks, and error maps each compiled query uses, cutting bundle size up to 4.6× (#551, #642, fixes #543).
- Add
reylo/effectto run typed queries inside Effect SQL on the context'sSqlClient(#549). - Remove query
inputSchema,outputSchema,~standard.jsonSchema, andAsJson(#587). - Infer
oneorat_most_onecardinality for subquery key matches, SQLiteINSERT … SELECT … RETURNINGandUPDATE … FROM … RETURNING, andSELECTwithoutFROM, while stopping volatile calls in derived tables, CTEs, or views from pinning keys (#589). - Reject duplicate field names in row values and built JSON objects with
reylo14, drop key inference acrossINTERSECT/EXCEPT, and simplify inference rules across Postgres, MySQL, and SQLite (#646, #628, #632). - Refuse
::rows(…)and::row(…)member names containing\or"on MySQL and SQLite, or exceeding 63 UTF-8 bytes on Postgres (#675). - Keep 64-bit integers exact in built JSON (throwing
DecodeErrorpast 2^53 − 1) and acceptbigintforintegerfields in typed JSON parameters (#553). - Preserve
NaN,±Infinity, and-0across scalar and JSON parameter paths, refusing non-finite numbers where a dialect or column type cannot hold them (#558). - Preserve
NaN,±Infinity, and-0inside structured::row()/::rows()parameters (#530 by @smorimoto). - Check JSON Schema
multipleOfby exact decimal division instead of floating-point remainder (#531 by @smorimoto). - Move schema fingerprinting into the engine over every catalog fact it reads (#562).
- Key
reylo/.cache/entries by URL parameters that select a database (#525 by @smorimoto). - Write newly analyzed cache entries under the post-analysis fingerprint rather than a cached pre-migration one (#527, fixes #522).
- Stop caching cancelled describes and transient server errors as statement diagnostics (#507 by @smorimoto, #561).
- Unify placeholder, quote, and comment scanning behind one per-dialect lexical table (#566).
- Memoize nested statement cardinality checks in their parent scope, fixing nested
WITHscoping and speeding up deeply nested queries (#563). - Resolve shadowed function and
WITHnames as the database server does (#565). - Bound and speed up deeply chained
WITHqueries without overflowing the stack (#583 by @smorimoto). - Validate bound ordering and enum values inside type descriptor checks (#593 by @smorimoto).
- Read git-ignored directories when named directly or matched by a quoted glob in
reylo analyzeandreylo generate typescript, and list skipped git-ignored.sqlfiles when a directory search finds nothing else (#703, closes #682). - Add
reylo lint(plusreylo analyzestderr warnings and type-check notes) to report filters and joins that scan every row of a table where a B-tree index could narrow the read (#706). - Infer required (non-null) parameter types when writing to columns that feed
NOT NULLgenerated columns—including throughCASEexpressions whose results are allNULLwhen the column isNULL—and extend thatCASErule toWHERE-implied non-nullability (#695, #723).
Postgres
- Add native Amazon Aurora DSQL support for IAM login signing, query type checking, and migrations (#639 by @ivanbarlog).
- Parse statements with Postgres 19.0's grammar, supporting
ON CONFLICT … DO SELECT RETURNING,IGNORE/RESPECT NULLS, andREPACK(#554). - Read
postgres.js4.2+ rows through per-query.parsers()and.transform(false), cutting 10,000-row overhead from +101% to +20% and enablingtransform.rowclients (#658). - Report Postgres columns whose built-in type changed since the query was built via a
REYLO_COLUMN_RETYPEDwarning andchangedonreylo:querytrace events, using result OIDs with zero extra queries (#704, closes #685). - Pair Postgres result fields with declared columns by name when column order differs from the build (such as
select *after schema changes), decode row values and composite types in the live database's field order, and stop caching declared user-type kinds by OID across the client (#708, #715). - Pipeline Postgres catalog reads from ~55 round trips down to 2 (cutting
reylo migrate history pushon a 44-migration Postgres 17 project at 60 ms RTT from 176 s to 43 s oninit.sqland 446 s to 99 s on refusal) and scope extension relations incapabilitiesto extensions the statement actually uses (#711). - Tighten Postgres nullability and cardinality inference for casts over
COALESCEof aggregates and scalar subqueries,RETURNINGonUPDATE/DELETE/INSERT/MERGEwithLEFT JOINorUNION ALLinFROM(typingRETURNINGcolumns nullable underDO INSTEADrules), longUNION ALLqueries over CTEs, and row-value comparisons against composite keys (#724). - Read Postgres connections from
DATABASE_URLordirect_urlalone, ignoring libpqPG*environment variables and refusing incomplete URLs when they are set (#648). - Enforce declared array dimensions inside composite row fields and keep
json[]/jsonb[]one-dimensional (#590). - Serialize nested array parameters at the depth
.run()reads and fixmacaddr/bitdomains in::rows()(#556). - Type arrays of
bit,varbit,vector,halfvec,sparsevec,lseg, andpolygonasNestedArrayunderallow_nested_arrays: true(#528 by @smorimoto). - Decode arrays of a domain over an array type instead of returning nulls (#544).
- Preserve
-0on float parameters across Postgres drivers (#529 by @smorimoto). - Store
Uint8Arrayvalues for domains overbyteaas bytes rather than comma-joined text on PGlite (#517, fixes #512). - Refuse
pgclients configured withbinary: truebefore executing the query (#660). - Read non-ASCII identifiers and dollar-quote tags and end
--comments at bare carriage returns (#508 and #509 by @smorimoto). - Parse colons using Postgres's grammar so
json_object(k :v)and array slices no longer invent placeholders (#627, #636, closes #625). - Read unique expression indexes, collations, and
NOT ENFORCEDchecks from the catalog instead of text matching, preserving domain-cast expression keys (#650, #678). - Audit trusted built-in overloads and type casts from
timestamp/timestamptztotime/timetzas nullable (#656). - Type
path + pathas nullable (#630, closes #621). - Type values converted through a user
CREATE CAST … AS IMPLICITfunction as nullable (#635, closes #619). - Mark
array_agg(DISTINCT …),json_agg(DISTINCT …), andjsonb_agg(DISTINCT …)as distinct (#634). - Include aggregate support functions in schema fingerprints (#524 by @smorimoto).
- Stop duplicating CTE names in nested scopes and reuse exact row counts when bounding subqueries (#537 and #540 by @smorimoto).
- Report missing schema
USAGEpermissions as a statement diagnostic instead of an internal catalog error (#591).
MySQL
- Pipeline MySQL catalog reads down to 3 network round trips regardless of table or view count, speeding up remote schema reads and
reylo migrate history pushwhile falling back per statement on proxies that refuse multi-statement queries (#719). - Type tables, columns, and wildcards qualified with the connection's own database as bare names, restoring key cardinality and parameter types (#694).
- Keep
ENUMandSETlabels when reading through schema-qualified tables (#671). - Run
JSON_TABLEcolumns as written without injecting the database's collation, refusing comparisons, sorts, or groups on uncollated text columns until a collation is named (#647). - Stop silently turning out-of-charset characters into
?in::rows()on non-utf8mb4databases and compare::rows()insert text in the database's collation (#674, #690). - Bind parameters through
execute()onmariadb3 and guard text-escaped values onmariadb2 and Hyperdrive against session charset andsql_modemismatches (#568 by @smorimoto). - Stop routing parameterless
mariadbstatements toquery()based on words likewarningsorerrorsin the SQL or filename (#669). - Turn off
decimalNumbersper query onmysql23.25+ and keep full fractional digits on temporal columns (#659). - Derive
.readOnlyand.try()error narrowing from the parse tree, keeping value-errorerror.columnasstring | undefined(#651, #602). - Treat derived-table, CTE, and view columns calling stored functions as varying so they don't falsely pin keys (#597).
- Keep table, derived-table, and
WITHnames that differ only in case separate on case-sensitive servers (#570 by @smorimoto). - Resolve casts using the session's
sql_mode, fixing false rewrites underNO_BACKSLASH_ESCAPES(#662). - Report Vitess parse errors as statement diagnostics (#663).
- Include every readable database and stored function signature in the MySQL schema fingerprint (#546, fixes #538).
- Drop declared string lengths on
utf16andutf32columns inside JSON documents (#576 by @smorimoto). - Refuse parameters beside a bare
NULL(such asCOALESCE(:p1, NULL, 1)) whose prepared type flips between binary and text until explicitly cast (#695).
SQLite and Turso
- Type databases built with Turso's own engine (
@tursodatabase/database), includingUSING ftsindexes and Turso built-in functions (#610, closes #514). - Accept Drizzle connections over every supported SQLite driver (including
drizzle-orm/node-sqliteand@tursodatabase/database) and refuse@tursodatabase/serverlesswith aTypeError(#672, closes #666). - Prepare queries against
node:sqlite(default when no SQLite driver is listed outside Bun),sql.js,@sqlite.org/sqlite-wasm, and recognized wrapper packages during type-checking, watchingpackage.jsonfor driver changes (#705, closes #681). - Pass
-0and±Infinitydirectly to SQLite drivers instead of rewriting query text, refusing±Infinityon Cloudflare D1 before sending (#673). - Prevent integers past 2^53 from returning rounded on untyped columns and integer-or-real expressions like
ceil,floor, andtrunc, and type overflowing integer arithmetic (+,-,*,/, unary minus) as integer-or-REAL(#575 fixes #539, #697). - Type
unixepoch('subsec')and related sub-second date/time calls asREAL(#626, closes #620). - Derive
NULL-strictness from one measured table covering every SQLite built-in (#555). - Stop treating
replace()'s third argument as rejectingNULLinWHERE, and end block comments at the first*/(#502 and #510 by @smorimoto). - Read SQLite triggers, virtual-table modules, and pragmas directly from SQLite's parser (#652).
- Memoize subquery cardinality checks so deeply nested derived tables no longer take exponential time (#547, fixes #541).
- Find Cloudflare D1 bindings by name past Worker service bindings in Wrangler configs (#596, fixes #595).
ClickHouse (preview)
- Type
Variantcolumns as the full union of their member types, including arrays, tuples, maps, and enum labels (#578 by @smorimoto). - Quote tuple member names and enum labels as ClickHouse writes them (#573 by @smorimoto).
- Read
SETTINGS, un-AScolumn aliases, and parameters from ClickHouse's query tree, fixing false refusals oncast_keep_nullable = 0and refusingSETTINGS limit/offsetoverrides (#649). - Prevent stale analyses from lagging replicas behind a load balancer from entering
reylo/.cache/(#592). - Type scalar subqueries inside ClickHouse branches that a parameter value can fold away as nullable (reading
EXPLAIN QUERY TREE run_passes = 0) and stop inferring exactly-one-row cardinality for ungrouped aggregates inside constant-foldableif/multiIf/CASE/AND/OR/coalescebranches (#723).
Reylo Migrate
- Run
migrate(client)on an app's ownpostgres.js,pg,mysql2, SQLite, or Turso connection through the WebAssembly deploy engine without thereylobinary, with CLI-parity drift checks,BEGIN IMMEDIATESQLite locking, and broken-constraint diagnostics (#653, #611, #680, #710). - Bundle migration files at build time for Next.js (
withReyloon Turbopack and webpack) and webpack/Rspack viarule()fromreylo/webpack(#709). - Run
reylo migrateandreylo dbon Turso files with full-text/vector indexes or MVCC journals through@tursodatabase/database(#637, #641, refs #513). - Add
migrate.schemain.reylo.yamlto declare a project's desired schema from a command, multiple files, or inline SQL, and run.reylo.yaml$(…)commands on Windows in a built-insh-syntax shell instead ofcmd(#714, closes #572). - Add
migrate.excludein.reylo.yamlto exclude custom tool-managed objects by glob pattern, and point drift refusals on unmanaged objects towardmigrate.exclude(#654, #702, refs #594). - Automatically exclude tool-managed objects from Cloudflare D1, Wrangler, Litestream, Hasura, AWS DMS, Qlik, Bucardo, Slony, Zero, Neon, PlanetScale/Vitess, gh-ost, pt-osc, and LHM (#598, #612, closes #594).
- Warn and run nothing instead of failing when deploying older code against a database or Durable Object that has already applied every migration in the project plus newer ones (as after a rollback), replaying those newer migrations from history in
deploy --dry-run -- <build>shadows while continuing to refuse edited migrations or split histories (#713). - Prepend a lock-free
DO $$row pre-check before split PostgresCHECKandSET NOT NULLmigrations by default (migrate.strict_checks: true, overridable with--no-strict-checksor--strict-checks), rolling back cleanly with the offending-row query on violating rows, and print a backfill-ordering note when strict checks are skipped or disabled (#712, #698). - Refuse Postgres column type changes between types with no Postgres cast in
reylo migrate newuntil--dropnames the column (instead of emitting an unflagged::text::cast), resolve extension casts directly, refusetimetz→timeoffset loss, and convert domain columns through their base type (#707, closes #689). - Run
ANALYZE <table> (<columns>)on Postgres after migrations that retype, re-collate, or rewrite columns, refreshing planner statistics without blocking reads or writes (#718). - Keep MySQL shadow replays inside their shadow database (refusing cross-database writes and unparseable statements naming another database) and harden Postgres lock-check quoting (#693).
- Introspect, diff, and dump Postgres 19
FOR ALL SEQUENCESandFOR ALL TABLES EXCEPT (…)publications (#567). - Continue checking remaining constraints in
reylo migrate deploy --dry-runafter a pending data change (#545). - Treat only ASCII whitespace as spacing in lock checksums (#523, closes #518).
- Match multi-line string line endings consistently between
reylo.lockandstatus/deploy(#532 by @smorimoto). - Detect longer Jujutsu (
jj) and custom-width git merge conflict markers across migration and lock checks, namingjjcommands beside git in conflict messages (#716). - Write explicit
schema.sqlgrants for Supabase roles even when local default privileges imply them (#511). - Copy Supabase platform schemas into shadows without
pg_dumpand ignore Supabase-managed extension grants (#521, #609). - Allow shadow databases to create
pg_cron(#579, closes #542). - Pin
__reylo_migrationsto one schema regardless ofsearch_path(#559). - Drop only the specific invalid index left by an interrupted Postgres concurrent index build (#608).
- Create user-defined Postgres casts before objects that depend on them and refuse stale cast removals (#686).
- Safely drop and re-add MySQL foreign keys around
AUTO_INCREMENTand collation changes without leaving partial state (#584 by @smorimoto, #601). - Read MySQL view bodies via
SHOW CREATE VIEWso comma-joinedJSON_TABLEviews compare cleanly (#586). - Refuse to auto-rerun a MySQL migration interrupted between DDL commit and history recording (#614, closes #535).
- Report what MySQL changes under
LOCK TABLESblock (including standaloneCREATE INDEXandDROP INDEX), warn on MyISAM key rebuilds, and require--blockingwhen enforcing aCHECKunderLOCK TABLES(#665, #668, #677, #692). - Try MySQL
ALTER TABLEchanges withALGORITHM=INPLACEas well asINSTANTand track table checks, table options, andold_alter_tableon the lock-check copy, stoppingreylo migrate newfrom refusing in-place changes underLOCK TABLES(lengthening aVARCHARwithin its length bytes, changing an unindexed column's collation, making an index invisible, and updating column or table comments) (#725). - Group and order SQLite table rebuilds by target foreign-key references so cyclical and multi-table rebuilds preserve rows and changes with foreign keys enabled (#585 by @smorimoto, #603, #645).
- Preserve structured error kinds and codes across host and migration errors, including translated Postgres messages (#644).
Contributors
Thanks to everyone outside the core repository who contributed code or filed reports that shipped in v0.10.0.
Pull requests:
- @ivanbarlog — native Amazon Aurora DSQL support (#639).
- @smorimoto — 31 shipped pull requests across Postgres, MySQL, SQLite, ClickHouse, and Reylo Migrate, plus 15 bug reports resolved in this release.
- @X6TXY — Postgres 14 and 15 compatibility fix in the dynamic filtering docs example (#684).
Issue reports:
- @wilau2 — bundle size reduction (#543).
- @cr101 — Turso's own engine in the type check and Migrate (#513, #514), Drizzle over
node:sqlite(#666),node:sqlitedriver checking (#681), and git-ignored.sqldirectory handling (#682). - @franciscohermida — D1 table exclusions,
migrate.exclude, and Wrangler service bindings (#594, #595). - @bduff9 —
pg_cronin shadow databases (#542). - @X6TXY — Postgres runtime column-retype warnings (#685).
- @jgburet — schema from multiple files or a command via
migrate.schema(#572). - @aniravi24 — Postgres type changes with no cast in
reylo migrate new(#689).
Full Changelog: v0.9.0...v0.10.0