class
CQL::Postgres::Driver
- CQL::Postgres::Driver
- DB::Driver
- Reference
- Object
Overview
Lets crystal-db open postgres:// and postgresql:// URLs with the wire
driver, so CQL::Schema and DB.open use it unless another PostgreSQL
driver (the pg shard) registered those names first. cockroachdb:// is
opt-in (.register_cockroachdb, or compile with
-Dcql_postgres_driver_cockroachdb) because only CockroachDB 24.3 was
checked against a real server.
crystal-db keeps its own pool; the options it owns are removed from the URL
before the rest is read as a Config.
Defined in:
postgres/driver.crConstant Summary
-
COCKROACHDB_NAME =
"cockroachdb" -
DB_OWNED_KEYS =
{"initial_pool_size", "max_pool_size", "max_idle_pool_size", "checkout_timeout", "retry_attempts", "retry_delay", "prepared_statements", "prepared_statements_cache"} -
NAMES =
{Connection::DRIVER_NAME, "postgresql"}
Class Method Summary
-
.register : Nil
Registers the driver under every default name nobody has claimed yet.
-
.register_cockroachdb : Nil
Opts
DB.open("cockroachdb://...")in to this driver. - .registered?(name : String) : Bool
Instance Method Summary
-
#connection_builder(uri : URI) : DB::ConnectionBuilder
Returns a new connection factory.
Class Method Detail
Instance Method Detail
Returns a new connection factory.
NOTE For implementors uri should be parsed once. If all the options are sound a ConnectionBuilder is returned.