shard-crystal-db/spec
Brian J. Cardiff f13846b133
Refactor connection factory (#181)
* Start moving out URI from ConnectionContext

Create connections with an initial context. Database will set itself as context after connection has been created

* Migrate to simpler/decoupled factory in driver

This allows more freedom on how the connection is created. It will no longer need to have an explicit reference to the connection URI

* Introduce DB::Connection::Options

Move prepared_statements out from ConnectionContext

* Delegate options parsing to driver

DRY parsing connection options for database

* Introduce DB::Pool::Options

* Rename Driver#connection_pool_options to pool_options

* Drop driver getter from database

* Drop uri getter from database

* Add public Database#initialize method

* Drop :nodoc: Database#initialize

* Pass spec helper explicitly (to access methods within each spec)

* Update docs

* Update src/db/pool.cr

Co-authored-by: Beta Ziliani <beta@manas.tech>

* Use ConnectionBuilder instead of procs

* Fix inferred type when there is a single concrete connection type

* Update src/db/driver.cr

Co-authored-by: Beta Ziliani <beta@manas.tech>

---------

Co-authored-by: Beta Ziliani <beta@manas.tech>
2023-06-22 22:03:08 -03:00
..
support Allow DB::Pool to be used a generic connection pool (#131) 2020-09-14 10:49:00 -03:00
custom_drivers_types_spec.cr Refactor connection factory (#181) 2023-06-22 22:03:08 -03:00
database_spec.cr Allow the use of enums (#168) 2022-10-26 16:06:14 +02:00
db_spec.cr Refactor connection factory (#181) 2023-06-22 22:03:08 -03:00
disposable_spec.cr fix #1. avoid marking as closed if do_close raise exception 2016-06-24 10:54:30 -03:00
dummy_driver.cr Refactor connection factory (#181) 2023-06-22 22:03:08 -03:00
dummy_driver_spec.cr Use DB::NoResultsError on QueryMethods (#125) 2020-04-06 18:36:37 -03:00
http_client_pool_spec.cr Refactor connection factory (#181) 2023-06-22 22:03:08 -03:00
mapping_spec.cr Updates for crystal 0.24.0 2017-12-29 20:13:34 -03:00
pool_spec.cr Refactor connection factory (#181) 2023-06-22 22:03:08 -03:00
result_set_spec.cr Add `ResultSet#column_names`. Fixes #11 2016-07-17 21:50:52 -03:00
save_point_transaction_spec.cr specs to ensure connection is not returned to pool in nested transaction 2016-12-14 10:57:12 -03:00
serializable_spec.cr Allow the use of enums (#168) 2022-10-26 16:06:14 +02:00
spec_helper.cr move spec and src files to a shardy way 2016-02-25 22:37:10 -03:00
statement_spec.cr Add logging for executing queries (#134) 2020-09-25 14:49:50 -03:00
transaction_spec.cr Close a transaction when `return`ing from within its block (#167) 2022-10-27 18:35:57 +02:00