Commit graph

20 commits

Author SHA1 Message Date
Brian J. Cardiff
c106775ea9
Simplifications and performance improvements (#200)
* Add pool_concurrency_test manual spec

Add MT connection count without Mutex

* Drop checkout_some, simpler pool_prepared statement

* Make pool statement a struct

* Drop StringKeyCache mutex

The StringKeyCache is now only used inside a connection. It's assumed that connections are not used concurrently with multiple queries.

* Drop do_close in pool statements

* Add specs and update comment

* Fix typo
2023-12-08 19:06:41 -03:00
Brian J. Cardiff
285e865e3a
Allow prepared_statements_cache=false option to disable prepared statements cache (#194)
* Add prepared_statements_cache in connection to opt-out

* Honor prepared_statements_cache option in database also
2023-11-03 23:04:14 -03:00
Jamie Gaskins
167b55966e
Allow the use of enums (#168) 2022-10-26 16:06:14 +02:00
Stephen von Takach
a25f33611c
feat(error): close resources on resource lost (#155) 2021-09-10 08:36:01 -03:00
Johannes Müller
fad9e70353
Fix mutex deadlock in setup_connection (#128)
Adds auto_release = false in setup_connection to avoid trying to release
the connection to the pool before it has been added.
2020-09-14 10:55:18 -03:00
Brian J. Cardiff
ac083f430a Updates for crystal 0.24.0 2017-12-29 20:13:34 -03:00
Brian J. Cardiff
9b03aa6535 Release connection when unprepared statements can't be built
Add specs
Fix typo in docs
2017-09-07 19:21:36 -03:00
Brian J. Cardiff
3fa1eac6c5 Add Database#checkout, Connection#release for non block connection use (#38) 2017-02-12 16:30:32 -03:00
Brian J. Cardiff
09b8997636 Add before_checkout/after_release callbacks for resources in pool (#36)
add auto_release to DB::Connection (default true on each pool checkout).
fixes #35.
2017-01-16 16:47:58 -03:00
Brian J. Cardiff
4721ecbf6b make Connection#prepared_statements? readonly 2016-12-07 01:50:06 -03:00
Brian J. Cardiff
543592a337 make pool_prepared_statements always prepare statement in connection 2016-12-07 01:50:06 -03:00
Brian J. Cardiff
2cab0b37f5 refactor prepared and unprepared pool statements 2016-12-07 01:50:06 -03:00
Brian J. Cardiff
0593f63dbb add pool unprepared statements
unprepared statements are executed in any free connection of the pool at the moment of executing them
2016-12-07 01:50:06 -03:00
Brian J. Cardiff
9ef9d19d1d add prepared_statements option to database
* use ?prepared_statements=true|false on connection string (default: true)
* make inmutable state in database
* make mutable state in connection
* change Connection#build to use the current prepared_statements flag to build prepared or unprepared statements.
2016-12-07 01:50:06 -03:00
Brian J. Cardiff
fe0ed55ef9 introduce unprepared statements
* rename QueryMethods#prepare to QueryMethods#build
* rename Connection#build_statement to Connection#build_prepared_statement
* add Connection#build_unprepared_statement
* add Connection #prepared and #unprepared dsl methods
2016-12-07 01:50:06 -03:00
Brian J. Cardiff
3a7c801ece allow new connections right away if pool can be increased 2016-10-22 19:14:18 -03:00
Brian J. Cardiff
47e7d826e8 Add connection retry logic to connection pool 2016-08-31 17:32:01 -03:00
Brian J. Cardiff
f568e4506d add cache of pool statements per query
refactor/reuse connection statement cache
2016-08-30 16:20:18 -03:00
Brian J. Cardiff
75aa821f5f make Database return PoolStatement
create StatementMethods for common interface between Statement and PoolStatment.
2016-08-29 16:56:34 -03:00
Brian J. Cardiff
bed461c01b allow connection initialization 2016-08-18 00:55:43 -03:00