Repository navigation
Releases: hyphatech/rowtype
Release list
0.9.0
SQLite joins Postgres as a backend, and migrating is one algorithm over a dialect, so one command migrates either.
Upgrading
Migrations
- Postgres's migrate functions move to
Rowtype_migrate_postgres, inrowtype-migrate.postgres:run,create,drop,apply,status,dump,squashanddefault_lock, signatures unchanged. - Install
rowtype-postgresbesiderowtype-migrateto migrate Postgres:rowtype-migratealone brings no backend. Rowtype_migrate.squashstays, as the proof of a baseline over a dialect's~dumped.- A
status'sedited,lateandbehindhold the migrations, not their versions. Rowtype_migrate_postgres.dumpandsquashtake no?lock; their~pg_dumpand~restrict_keyare optional.
The command
dumpandsquashtake no--lock.--lock,--pg-dumpand--restrict-keyare refused for asqlite:URL, where they were ignored.
New
rowtype-sqlite: the same statements and shapes on a SQLite file or in memory, each statement off the domain, with a pool, transactions, savepoints,verifyandcopy_in.rowtype-migratemigrates SQLite with the same files, record and command:--url sqlite:PATH; a dump and a squash need no server.Rowtype_migrate.refusalsays whyuprefuses a source;statusprints it inup's words.Rowtype_migrate.DialectandMakelet a dialect bring its own ways to the one algorithm.
Fixed
- A database that ran a migration named
baselineis no longer refused as edited after a squash. - A Postgres dump that leaves its scratch database on the server says so, naming it.
0.8.1
0.8.0
Migrate's database functions take the capabilities they use, as an Eio library should.
Upgrading
Rowtype_migrate.create,drop,dumpandsquashtake~sw,~netand~mono_clock, and~process_mgrfor the two that runpg_dump, where they tookenv.Rowtype_migrate.run env target f, the bracket a program opens, still takesenv.
0.7.0
postgres-eio 0.5, one word for one thing across the libraries, and migrations that stop rather than run without their lock.
Upgrading
rowtype
S.conv ty ~of_ ~to_→S.map ty ~parse ~print;S.parse's~parseanswers aresult, where it answered an option.Rowtype.errorgains`Unsent: work that never went out, a connection that could not be made among it, where it was`Db.
rowtype-postgres
- Needs postgres-eio 0.5.0;
Listener.connect's?heartbeat→?keep_alive. DateStyle,IntervalStyle,client_encodingandextra_float_digitsgiven as parameters are refused: the driver sets them.- A target is a
Pg.Conninfo.t:Rowtype_postgres.conninfo→Pg.Conninfo.of_string,on_database→Pg.Conninfo.with_database. Rowtype_postgres.erroranderror_to_stringcover every failure;Pool.error_to_stringandTransaction.error_to_stringare gone.Transaction.failuregains`Unsent.
rowtype-migrate
Rowtype_migrate.run→apply;with_connection→run env target f.create,drop,dumpandsquashtakeenvand aPg.Conninfo.t.- A database made from a baseline holds it to its text: an edited baseline is refused.
New
Rowtype_migrate.applyanswers`Lock `Lostwhen its connection drops between migrations, where it went on without the lock.
Fixed
- A cancelled statement is cancelled at the server once, not twice.
- A command's statements no longer run into the driver's 30 s read bound; only its connect is bounded.
- Text in a database not in UTF-8, and a float from a server set to
extra_float_digits=0, are read as they are. - A listener's call lost in flight is
`Lost, where it was`Db.
0.6.0
postgres-eio 0.4, a deferred constraint told as a conflict, and the record's refusals under one tag.
Upgrading
- Needs postgres-eio 0.4.0:
{ c with database = name }→Conninfo.with_database c name,{ c with connect_timeout = Some span }→Conninfo.with_connect_timeout c span. Transaction.withinanswers`Conflict, naming the constraint, for a deferred constraint that refused theCOMMIT, where it answered`Not_committed.Rowtype_migrate.error:`Behind,`Unknown,`Editedand`Late→ under`Record;`Failed→`Migration_failed;`Invalid→`Invalid_argument.
Fixed
- What a migration sets for its session ends with it, so a schema no longer depends on which migrations ran together.
0.5.0
A library ships its own migrations, applied as a history of their own.
Upgrading
- The record's table gains a
sourcecolumn, keyed with the version; a record made before is brought up on its nextup. Rowtype_migrate.statusanswers a status for each source, the application's last, with asourcefield.
New
rowtype-migrate --source <package>, or--source <name>=<dir>, applies a library's migrations before the application's, each source checked against its own.run,dumpandsquashtake?libraries;sourceandof_packagemake one; a squash leaves a library's tables out.rowtype-migrate newwrites one line, asking what the migration changes and why.
0.4.0
Every duration is an Mtime.Span.t, and a transaction is each backend's own.
Upgrading
commitleavesRowtype.Backend: a backend runs its own transactions.rowtype-postgres's durations areMtime.Span.t, named for what they bound:?timeout_s→?timeout,?heartbeat_s→?heartbeat,?wait_s→?wait,?max_lifetime_s→?max_lifetime,?idle_check_s→?idle_check; write~timeout:Mtime.Span.(10 * s).timeout_s→timeout;set_timeout_s conn t→set_timeout conn ~timeout:t.- Needs postgres-eio 0.3.0:
Conninfo.connect_timeout_s→connect_timeout : Mtime.Span.t option.
0.3.0
Errors grouped by what failed, OCaml 5.5, and fixes for cancellation, passwords and stray columns.
Upgrading
- OCaml 5.5 or later.
`Closed→`Connection `Closed;Pool.use's`Busy→`Pool `Busy, and a closed pool is`Pool `Closedat once.commitleavesRowtype.SandRowtype_postgres: a transaction isTransaction.within's.- A row with more columns than its shape is refused; a statement whose rows are not read is an
exec. - A migration that ends its own transaction is refused: it says
-- rowtype-migrate: no transactionon its first line. - Needs postgres-eio 0.2.0:
Conninfo.protocol_minoris gone.
New
Transaction.error_to_string,Pool.error_to_stringanderror_to_stringtell every failurerowtype-postgresanswers.rowtype-postgrespins postgres-eio itself, so pinning rowtype is the whole install.
Fixed
- A fiber cancelled inside
Transaction.withinbetween statements closes the connection, where it left the transaction and its locks open. - A cancelled
Pool.usestops at once, and a listener waits out a server that restarts. - A password with an unquoted space is refused without repeating it.
- A value its scalar cannot hold is refused naming what reads it.
- A record's table named from a digit is refused with words that say why.
0.2.0
Reads as strict as verify, enums, batches, and failures that tell lost work from work never sent.
Upgrading
- A read accepts exactly the types
verifydoes; an enum read asS.textneedsS.enumor a::textcast. - An array's element is read as its own type is.
Rowtype.errorgains`Closedand`Lost, which were`Db.Transaction.failuregains`Lost: aCOMMITlost in flight, which may have committed.- For a backend:
EnumjoinsRowtype.scalar, andbatchis required.
New
S.enum label valuesreads and writes an enum through your own type;verifychecks its labels.run_manyruns anexeconce for each value, in one round trip, all or nothing.Listener.unlisten;Listener.connecttakes?parameters.
Fixed
- A cancelled statement on a connection of its own is cancelled at the server.
0.1.0
First release: a query described once, a Postgres backend, and plain SQL migrations.
New
rowtype: a query's parameters and rows described once, binding and decoding both, every failure a polymorphic variant;foldover a result without holding it.rowtype-postgres: a backend over postgres-eio, with a pool, a listener, transactions with serializable retries, statements checked against the database, andcopy_in.rowtype-migrate: plain SQL migrations, forward only, under an advisory lock and known by their digests; a schema dump, and a squash into a baseline.