Commit graph

141 commits

Author SHA1 Message Date
Brian J. Cardiff
2886c207e0 Add support for nillables with T | Nil syntax. 2017-03-06 12:18:04 -03:00
RX14
0797ce72a3 Allow nilable types in DB.mapping
Previously, using a Nilable type in DB.mapping instead of nilable: true would
fail with a nil assertion error.
2017-02-15 16:09:01 +00: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
e3762eec46 update .gitignore 2016-12-26 11:09:19 -03:00
Brian J. Cardiff
c2c1f31a90 bump version 0.3.3 2016-12-24 20:43:32 -03:00
Brian J. Cardiff
eb82b96c0d update to crystal 0.20.3
* add missing forall annotations
2016-12-24 20:39:40 -03:00
Brian J. Cardiff
3acb5b8f39 Add documentation links in README.md 2016-12-21 18:17:45 -03:00
Paul Smith
8e3bb19b6d Add note about using $1, $2, etc. for pg driver (#31) 2016-12-16 15:31:24 -03:00
Brian J. Cardiff
7d30e9f50e bump version 0.3.2 2016-12-16 11:57:44 -03:00
Brian J. Cardiff
039035a397 fix #scalar queries where not handled with retry connection pool logic 2016-12-16 11:56:27 -03:00
Brian J. Cardiff
8e8d8024f9 bump version 0.3.1 2016-12-15 14:47:10 -03:00
Brian J. Cardiff
2ca60ba43f Add ConnectionRefused exception
* required to fix retry+connection initialization corner case.
2016-12-15 14:40:56 -03:00
Brian J. Cardiff
4c74e6c9da bump version 0.3.0 2016-12-14 15:22:23 -03:00
Brian J. Cardiff
683e020b85 update readme and changelog 2016-12-14 15:21:33 -03:00
Brian J. Cardiff
4e238f655f add Bool and Time to DB::Any fixes #4 closes #24 2016-12-14 15:17:40 -03:00
Brian J. Cardiff
ddd04da915 update readme/changelog 2016-12-14 12:25:32 -03:00
Brian J. Cardiff
8a1824ac23 Merge pull request #27 from crystal-lang/feature/nested-transactions
Feature/nested transactions
2016-12-14 12:15:30 -03:00
Brian J. Cardiff
d7ccecae9b minimal docs for transactions 2016-12-14 12:13:46 -03:00
Brian J. Cardiff
ed3ed71501 allow raise after explicit rollback within #transaction(&block) 2016-12-14 11:37:49 -03:00
Brian J. Cardiff
dc26498948 unwrap args 2016-12-14 11:32:53 -03:00
Brian J. Cardiff
c6b6517145 add connection.object_id to savepoint names.
s/crystal/cr/ to shorten a bit the name.
2016-12-14 11:07:17 -03:00
Brian J. Cardiff
882253bf4a specs to ensure connection is not returned to pool in nested transaction 2016-12-14 10:57:12 -03:00
Brian J. Cardiff
c491bd8962 add nested transaction with savepoints 2016-12-13 16:47:23 -03:00
Brian J. Cardiff
9bde76865e add todo for corner case of transaction(&block) 2016-12-13 16:47:23 -03:00
Brian J. Cardiff
751f8b26ac Transactions
* dsl, state checks
* define transaction sql commands in connection
2016-12-13 16:47:23 -03:00
Brian J. Cardiff
1049d95562 update readme and docs links to drivers 2016-12-13 16:46:44 -03:00
Brian J. Cardiff
825046e556 Merge pull request #25 from crystal-lang/feature/unprepared
Support non prepared statements
2016-12-13 16:45:51 -03:00
Brian J. Cardiff
cd871c970b update readme 2016-12-07 19:28:15 -03:00
Brian J. Cardiff
87a01fc83c update changelog 2016-12-07 13:09:37 -03:00
Brian J. Cardiff
da2831c17d validate boolean option in connection string. proper downcase. 2016-12-07 01:50:06 -03:00
Brian J. Cardiff
4721ecbf6b make Connection#prepared_statements? readonly 2016-12-07 01:50:06 -03:00
Brian J. Cardiff
d55b088216 Refactor Database and Connection dsl methods. Update docs. 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
Ary Borenszweig
73108c169e v0.2.2 2016-12-06 23:33:27 -03:00
Ary Borenszweig
2073a1de91 Use Slice.empty 2016-12-06 23:27:15 -03:00
Brian J. Cardiff
cd10dabba2 default max_pool_size to 0 = unlimited 2016-11-13 18:21:05 -03:00
Brian J. Cardiff
79ec638de4 update changelog. improve formatting 2016-10-22 21:52:15 -03:00
Brian J. Cardiff
df0ec5723f because it's never too late for a changelog 2016-10-22 20:05:15 -03:00
Brian J. Cardiff
3a7c801ece allow new connections right away if pool can be increased 2016-10-22 19:14:18 -03:00
Ary Borenszweig
56aa10c54d Better error message when requesting a driver that was not found. Fixes #21 2016-10-21 11:24:32 -03:00
Brian J. Cardiff
0735870418 bump version 0.2.0
version 0.1.1 should be yanked. it's not backward compatible with 0.1.0.
2016-10-20 18:41:57 -03:00
Gustavo Giráldez
d7fdf1eada Release DB connection if an exception occurs during execution of a query 2016-09-28 16:45:38 -03:00
Ary Borenszweig
4f724475e0 Fixed module reference inside macro 2016-09-28 14:46:34 -03:00
Ary Borenszweig
ae6a68f00e Use forall 2016-09-19 19:20:18 -03:00
Brian J. Cardiff
751be7aa6a Merge branch 'feature/pool'
Conflicts:
	src/db/error.cr
2016-09-13 01:42:24 -03:00