rpc_data_postgres 2.3.0 copy "rpc_data_postgres: ^2.3.0" to clipboard
rpc_data_postgres: ^2.3.0 copied to clipboard

PostgreSQL adapter and repository for rpc_data — CRUD, querying and change streams over a Postgres database.

2.3.0 #

Changed #

  • Requires rpc_data 5.2.0, and through it rpc_dart 6 — see its changelog.

2.2.0 #

Changed #

  • Requires rpc_data 5.1.0, which stops read-only journal calls materialising collection state and keeps the cause on an internal error.

2.1.1 #

  • A dropped table no longer fails the OTHER processes that had cached it. _knownTables records a fact about the database inside one process, and deleteCollection can only evict it where it ran — so with more than one replica the rest keep answering "that table exists" about a table that is gone, and the next statement fails on a name resolving to no relation. 2.1.0 covered the collection that was never cached; this covers the one that was. The cache stays an optimisation but is no longer treated as proof: a statement reporting 42P01 corrects it and the operation recovers — a read returns no rows, a write recreates the table and retries once.

2.1.0 #

  • Collection teardown is one transaction. deleteCollection dropped the table and cleared the registry as separate statements — behind a Pool, on separate connections — so an interruption between them left a registration pointing at a table that no longer existed.
  • ensureReady no longer throws on such a registration. It could only be raised at startup, which scoped the damage backwards: one dropped table failed every boot from then on, taking down every other collection with it. The registration is now reported through the new onIntegrityIssue callback and skipped — the collection reads as empty, and the next write recreates its table.
  • A read on a collection whose table is gone returns nothing instead of failing on a name that resolves to no relation.

2.0.0 #

Breaking — cursors issued by 1.x are rejected by this version. They are short-lived, so the practical cost is one restarted page walk.

  • Pagination cursors are self-contained tokens carrying the boundary (sort value + id) instead of the boundary record's id. The old cursor was re-read on the next page, which made paging depend on that row surviving unchanged: deleting it failed the next page with invalidArgument, and updating it moved the boundary so rows in between were silently skipped or repeated. Both are covered by tests now.
  • The keyset tiebreaker is id rather than ctid. Postgres rewrites ctid on every UPDATE and on VACUUM FULL, so it could never anchor an order.
  • Two queries per page are gone with the re-read (_cursorExists and the boundary lookup); full-text search paged the same way and got the same fix.
  • writeRecords no longer compares against versions read before the upsert. A concurrent writer landing in between made a refused row look like it applied, so the batch reported success for a write it had dropped. The upsert now reports which ids landed (RETURNING id) and only the refused ones are re-read.
  • Documented what the adapter does not push down: RecordFilter.containsTerms compiles to LOWER(payload::text) LIKE '%term%', a full scan no index serves. The class comment previously claimed the opposite — that queries were materialised in Dart — which had not been true for some time.
  • Tests take the connection URL from RPC_PG_URL, so they can run against a throwaway instance instead of whatever holds the default port.

4.0.0 #

  • Initial extraction from rpc_data with PostgreSQL JSONB adapter and repository.
0
likes
150
points
323
downloads

Documentation

API reference

Publisher

verified publisherrpc.nogipx.dev

Weekly Downloads

PostgreSQL adapter and repository for rpc_data — CRUD, querying and change streams over a Postgres database.

Homepage
Repository (GitHub)
View/report issues

Topics

#rpc #database #postgresql

License

MIT (license)

Dependencies

postgres, rpc_data

More

Packages that depend on rpc_data_postgres