Skip to content

Releases: hyphatech/rowtype

0.9.0

Choose a tag to compare

@zaiev zaiev released this 21 Oct 12:49

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, in rowtype-migrate.postgres: run, create, drop, apply, status, dump, squash and default_lock, signatures unchanged.
  • Install rowtype-postgres beside rowtype-migrate to migrate Postgres: rowtype-migrate alone brings no backend.
  • Rowtype_migrate.squash stays, as the proof of a baseline over a dialect's ~dumped.
  • A status's edited, late and behind hold the migrations, not their versions.
  • Rowtype_migrate_postgres.dump and squash take no ?lock; their ~pg_dump and ~restrict_key are optional.

The command

  • dump and squash take no --lock.
  • --lock, --pg-dump and --restrict-key are refused for a sqlite: 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, verify and copy_in.
  • rowtype-migrate migrates SQLite with the same files, record and command: --url sqlite:PATH; a dump and a squash need no server.
  • Rowtype_migrate.refusal says why up refuses a source; status prints it in up's words.
  • Rowtype_migrate.Dialect and Make let a dialect bring its own ways to the one algorithm.

Fixed

  • A database that ran a migration named baseline is 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

Choose a tag to compare

@zaiev zaiev released this 16 Oct 10:01

Installs from Hypha's opam repository.

Upgrading

  • opam repo add hypha https://github.com/hyphatech/opam-repository.git, then opam install rowtype rowtype-postgres rowtype-migrate; the pins are gone.
  • rowtype-postgres takes postgres-eio 0.5.x.

0.8.0

Choose a tag to compare

@zaiev zaiev released this 14 Oct 15:02

Migrate's database functions take the capabilities they use, as an Eio library should.

Upgrading

  • Rowtype_migrate.create, drop, dump and squash take ~sw, ~net and ~mono_clock, and ~process_mgr for the two that run pg_dump, where they took env.
  • Rowtype_migrate.run env target f, the bracket a program opens, still takes env.

0.7.0

Choose a tag to compare

@zaiev zaiev released this 14 Oct 14:17

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 ~parse answers a result, where it answered an option.
  • Rowtype.error gains `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_encoding and extra_float_digits given 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.error and error_to_string cover every failure; Pool.error_to_string and Transaction.error_to_string are gone.
  • Transaction.failure gains `Unsent.

rowtype-migrate

  • Rowtype_migrate.run → apply; with_connection → run env target f.
  • create, drop, dump and squash take env and a Pg.Conninfo.t.
  • A database made from a baseline holds it to its text: an edited baseline is refused.

New

  • Rowtype_migrate.apply answers `Lock `Lost when 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

Choose a tag to compare

@zaiev zaiev released this 13 Oct 21:18

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.within answers `Conflict, naming the constraint, for a deferred constraint that refused the COMMIT, where it answered `Not_committed.
  • Rowtype_migrate.error: `Behind, `Unknown, `Edited and `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

Choose a tag to compare

@zaiev zaiev released this 12 Oct 16:08

A library ships its own migrations, applied as a history of their own.

Upgrading

  • The record's table gains a source column, keyed with the version; a record made before is brought up on its next up.
  • Rowtype_migrate.status answers a status for each source, the application's last, with a source field.

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, dump and squash take ?libraries; source and of_package make one; a squash leaves a library's tables out.
  • rowtype-migrate new writes one line, asking what the migration changes and why.

0.4.0

Choose a tag to compare

@zaiev zaiev released this 11 Oct 21:59

Every duration is an Mtime.Span.t, and a transaction is each backend's own.

Upgrading

  • commit leaves Rowtype.Backend: a backend runs its own transactions.
  • rowtype-postgres's durations are Mtime.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

Choose a tag to compare

@zaiev zaiev released this 11 Oct 20:11

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 `Closed at once.
  • commit leaves Rowtype.S and Rowtype_postgres: a transaction is Transaction.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 transaction on its first line.
  • Needs postgres-eio 0.2.0: Conninfo.protocol_minor is gone.

New

  • Transaction.error_to_string, Pool.error_to_string and error_to_string tell every failure rowtype-postgres answers.
  • rowtype-postgres pins postgres-eio itself, so pinning rowtype is the whole install.

Fixed

  • A fiber cancelled inside Transaction.within between statements closes the connection, where it left the transaction and its locks open.
  • A cancelled Pool.use stops 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

Choose a tag to compare

@zaiev zaiev released this 06 Oct 15:33

Reads as strict as verify, enums, batches, and failures that tell lost work from work never sent.

Upgrading

  • A read accepts exactly the types verify does; an enum read as S.text needs S.enum or a ::text cast.
  • An array's element is read as its own type is.
  • Rowtype.error gains `Closed and `Lost, which were `Db.
  • Transaction.failure gains `Lost: a COMMIT lost in flight, which may have committed.
  • For a backend: Enum joins Rowtype.scalar, and batch is required.

New

  • S.enum label values reads and writes an enum through your own type; verify checks its labels.
  • run_many runs an exec once for each value, in one round trip, all or nothing.
  • Listener.unlisten; Listener.connect takes ?parameters.

Fixed

  • A cancelled statement on a connection of its own is cancelled at the server.

0.1.0

Choose a tag to compare

@zaiev zaiev released this 05 Oct 23:59

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; fold over 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, and copy_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.