Repository navigation
v3.1.0.rc1
Pre-releaseAdded
Hanami::DB::SQLite::Pragmas: a value class holding a set of SQLite pragmas with sensible defaults, user overrides, and validation againstPRAGMA pragma_list. Exposes#connect_sqls, an array ofPRAGMAstatements suitable for Sequel's per-connectionconnect_sqlsoption.Hanami::DB::UnknownPragmaErroris raised when an override names a pragma the linked SQLite doesn't recognise.foreign_keysis not among the defaults, since Sequel's SQLite adapter already enables it on every connection; it can still be set as an override. Passreadonly: trueto drop the defaults that write to the database file (journal_mode), for use with read-only connections. Requires SQLite 3.30+, wherepragma_listis available by default. (@cllns in #21, @timriley in #28)Hanami::DB::Error: the base class for all hanami-db errors. (@parndt in #27)Hanami::DB::InvalidURLError: raised for database URLs that cannot be parsed. Its message includes only the URL's scheme, since the URL may contain credentials. (@parndt in #27)Hanami::DB::UnsupportedSchemeError: raised byHanami::DB::DatabaseURL.adapter!for database URLs whose scheme is not one hanami-db supports. (@parndt in #29)
Changed
- Require rom-sql 3.8 or later, for plain SQL migrations.
Fixed
-
Hanami::DB::Testing.database_urlnow transformsjdbc:database URLs. Previously it returned them unchanged, so withHANAMI_ENV=testthe test database URL still pointed at the development database, and running the test suite truncated or migrated development data. This affected JRuby applications, which are the only ones that must usejdbc:URLs. (@afomera in #22)The
jdbc:postgresql:,jdbc:mysql:andjdbc:sqlite:subprotocols are transformed, in both thejdbc:sqlite://db/app.dband single-colonjdbc:sqlite:db/app.dbforms, including SQLite's Windows drive-letter (jdbc:sqlite:C:/db/app.db) andfile:URI filename (jdbc:sqlite:file:db/app.db?mode=ro) paths. Other subprotocols —jdbc:sqlserver:,jdbc:h2:,jdbc:derby:and the rest — name their databases in ways this transformation does not understand, and continue to be returned untouched. In-memory SQLite databases (sqlite::memory:,jdbc:sqlite:file::memory:?cache=private,jdbc:sqlite:file:app?mode=memory) are also left alone. -
Hanami::DB::Testing.database_urlnow transforms the single-colonsqlite:db/development.sqlite3form on CRuby too, not only behind ajdbc:prefix. Previously it was returned unchanged. (@afomera in #22)