Brian J. Cardiff
7253551849
Add logging for executing queries ( #134 )
...
* Add logging for executing queries
Arguments are translated to Log::Metadata::Value via DB::Statement#arg_to_log method.
DB::Statement#before_query_or_exec & after_query_or_exec protected methods can be used to hook and run around the statement execution
* Move the metadata converter to a module
* Replace before/after with def_around_query_or_exec macro
* Update src/db/enumerable_concat.cr
Co-authored-by: Ary Borenszweig <asterite@gmail.com>
Co-authored-by: Ary Borenszweig <asterite@gmail.com>
2020-09-25 14:49:50 -03:00
Johannes Müller
b3898ae2a2
Statement#exec and #query require named argument for array values ( #110 )
...
This change allows to use an array as single argument for #exec and
#query and #scalar methods. Before it was shadowed by the *args splat overload.
2019-09-20 17:23:09 -03:00
Brian J. Cardiff
adc755e5e4
Add type argument to QueryMethods module ( #108 )
2019-08-02 11:54:52 -03:00
Brian J. Cardiff
bb3203301b
Deal with unexpected ResultSet#read types during runtime.
2017-04-06 15:55:13 -03:00
Brian J. Cardiff
385cf70a8a
Introduce DB::ConnectionContext ( #44 )
...
* make Database a ConnectionContext.
* introduce SingleConnectionContext for independant connections.
* add `DB#connect` to create non pooled connections.
2017-03-20 15:08:30 -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
9c88f718e8
Require ResultSet to just implement `read`, optionally implementing `read(T.class)`. Fixes #5
2016-06-30 09:46:25 -03:00
Brian J. Cardiff
933014c1aa
fix bug related to Slice(T).new(0). It was messing with the data in the stack
2016-06-23 22:36:34 -03:00
Brian J. Cardiff
b2da4f3f6e
allow scalar to return custom types
2016-06-23 22:19:53 -03:00
Brian J. Cardiff
8025ecaa13
update Slice(UInt8) to Bytes
2016-06-22 14:10:09 -03:00
Brian J. Cardiff
11e24e1c65
#5 Make sure queries (insert and query) work with any type
2016-06-22 00:44:16 -03:00
Brian J. Cardiff
c5d7778a0d
update DB::ExecResult#rows_affected to Int64
2016-06-21 18:31:13 -03:00
Brian J. Cardiff
9f3f0a9836
#5 remove read_object. allow read / read? to receive any type
2016-06-21 12:10:09 -03:00
Brian J. Cardiff
76e3a35d59
allow exec to receive any object arguments
2016-06-21 10:55:44 -03:00
Brian J. Cardiff
d4b2046a65
refactor and add specs for query without blocks
2016-06-21 10:55:44 -03:00
Brian J. Cardiff
3464a1d1cc
allow query to receive any object arguments
2016-06-21 10:55:41 -03:00
Brian J. Cardiff
5b23114095
add ResultSet#read_object
2016-06-21 10:54:58 -03:00
Brian J. Cardiff
312609b722
allow specs to use multiple drivers
2016-06-21 10:54:56 -03:00