Commit graph

169 commits

Author SHA1 Message Date
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
Brian J. Cardiff
a62c90d092 remove connection from pool if explicitly closed 2016-09-13 01:36:49 -03:00
Brian J. Cardiff
ea2a107069 allow releasing connections of the pool from pool_statements
remove old connections from PoolStatement::@connections either disposed or closed connections
2016-09-12 14:35:21 -03:00
Brian J. Cardiff
4ddaf9df53 Merged branch ci-format-check into master 2016-09-06 13:26:33 -03:00
Brian J. Cardiff
2db12d99f5 fix formatting issues 2016-09-06 13:24:57 -03:00
Brian J. Cardiff
17ed0829b4 enforce tool format in .travis.yml 2016-09-06 12:58:40 -03:00
Brian J. Cardiff
6745ea956f migrate to crystal 0.19
* select keyword hangs so Channel.select is used still
2016-09-04 20:11:50 -03:00
Brian J. Cardiff
d3606831f3 Use select to distinguish between timeout and resource availability 2016-09-02 17:27:22 -03:00
Brian J. Cardiff
47e7d826e8 Add connection retry logic to connection pool 2016-08-31 17:32:01 -03:00
Brian J. Cardiff
dbf7c94ef4 release references to resources in pool. 2016-08-31 14:45:32 -03:00
Brian J. Cardiff
598aca50af Merged branch feature/pool_statement into feature/pool 2016-08-30 16:42:23 -03:00
Brian J. Cardiff
9c9176608d avoid caching statements in pool_statement
Only the connections where it was prepared need to be cached.
The connections already have a statement cache based on the query
2016-08-30 16:40:52 -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
09b3b4bc01 minor code cleanup 2016-08-30 15:22:27 -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
6a0a450622 make statement_specs run over a single connection 2016-08-29 16:50:37 -03:00
Brian J. Cardiff
6e94536a91 clean up forward declaration of Database and Statement 2016-08-29 16:48:59 -03:00
Brian J. Cardiff
8d891a5a4e changes needed due to 3c91978d36
add posibility to inspect availability of a resource in a pool (testing only)
allow access to internal connection pool of db (testing only)
2016-08-29 13:14:47 -03:00
Brian J. Cardiff
3c91978d36 Merged branch master into feature/pool 2016-08-29 12:57:42 -03:00
Brian J. Cardiff
325fa9d4ae ensure the connection is released after exec
avoid releasing connection twice on exec.
avoid releasing connection when QueryMethod#query is blockless called.
2016-08-29 01:23:20 -03:00
Brian J. Cardiff
bed461c01b allow connection initialization 2016-08-18 00:55:43 -03:00
Ary Borenszweig
b5112d9a48 Add ResultSet#column_names. Fixes #11 2016-07-17 21:50:52 -03:00
Ary Borenszweig
1a4622ee59 Allow passing named arguments to DB.mapping 2016-07-15 11:54:09 -03:00