bolty-0.2.0.0: changelog.md
# Changelog for `bolty`
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to the
[Haskell Package Versioning Policy](https://pvp.haskell.org/).
## 0.2.0.0
- New `Database.Bolty.AccessMode` module: `AccessMode = ReadAccess | WriteAccess` with a single `PackStream` instance. Re-exported from `Database.Bolty`.
- New `Database.Bolty.Admin` module with gated transaction primitives for admin tools, CLIs, and migrations: `withReadOnlyTransaction` and `withConfirmedWriteTransaction` (plus pool variants), `ReadOutcome` / `WriteOutcome` types, `totalAffected`, `describeReadOutcome` / `describeWriteOutcome`.
- New transaction primitives in `Database.Bolty`: `withReadTransaction` and `withReadTransaction'` (un-gated read tx with cluster routing-to-follower and server-side enforcement), public `withTxMode :: AccessMode -> ...`, `withRetryTransactionMode :: AccessMode -> ...`.
- New public Aeson interop: `parsePs`, `psToAeson`, `propsToAeson`, `propsFromAeson`.
- New exports `renderPlan` (from `Database.Bolty.Plan`) and `formatStatsLine` (from `Database.Bolty.Stats`).
- New `Show QueryMeta` instance.
- **Breaking**: `Begin.mode`, `RunExtra.mode`, `RunAutoCommitTransaction.mode` are now `AccessMode` instead of `Char`. Use `ReadAccess` / `WriteAccess` instead of `'r'` / `'w'`.
- **Breaking**: `withTxMode` and `withRetryTransactionMode` take `AccessMode` instead of `Char`.
- **Breaking**: `Database.Bolty.Tx` module renamed to `Database.Bolty.Admin`. `totalAffected` moved from `Database.Bolty.Stats` to `Database.Bolty.Admin` (re-export from `Database.Bolty` is unchanged).
- **Breaking**: `AccessMode(..)` no longer re-exported from `Database.Bolty.Routing`. Import from `Database.Bolty.AccessMode` or `Database.Bolty`.
- **Breaking**: Internal helper `fromPsMode` removed.
- Fix: `Begin.fromPs`, `RunExtra.fromPs`, and the autocommit RUN decoder now accept wire dicts where the optional `mode` key is absent (defaulting to `WriteAccess` per the Bolt spec). Previously bolty rejected spec-compliant peers that omitted the default.
- Fix: `withReadOnlyTransaction` opens BEGIN with `mode='r'` (was `mode='w'`) for cluster read routing and server-side write rejection on Neo4j 5+.
- Fix: pool-variant transaction helpers capture pool-acquire failures in the returned `Either` instead of propagating them as exceptions.
- 15 new direct `AccessMode` unit tests covering encode/decode round-trips, rejection of invalid `Ps` shapes, `Bounded` / `Enum` exhaustion, and parent-message decoders for the spec-default and rejection paths on `Begin`, `RunExtra`, and the autocommit `RUN`. bolty-test: 320 → 335 passing.
## 0.1.0.2
- Fix pool crash on machines with more than 10 CPU cores (set numStripes to 1)
- Add `acquireConnection`, `releaseConnection`, `releaseConnectionOnError` for manual connection lifetime management
- Add `acquireRoutingConnection` for routing-aware manual connection acquisition
- Expose `Session(..)` and `SessionPool(..)` constructors
- Fix `sigLocalDateTime` tag (was 0x66, now 0x64)
- Send `patch_bolt: ["utc"]` in HELLO for BOLT 4.x connections
- Complete `psToBolt`/`boltToPs` for all 13 structure types
## 0.1.0.1
- Fix dependency name: packstream renamed to packstream-bolt
## 0.1.0.0
- Initial release
- BOLT protocol versions 4.4 through 5.4
- Connection pooling via resource-pool
- Routing support with TTL-based caching
- Transaction support with automatic retry logic
- All Neo4j graph types: Node, Relationship, Path
- All Neo4j temporal types: Date, Time, LocalTime, DateTime, DateTimeZoneId, LocalDateTime, Duration
- Spatial types: Point2D, Point3D
- Typed record decoding with FromBolt/ToBolt typeclasses
- ResultSet with groupByField
- Query plan and profile parsing
- TLS support via crypton-connection