Gevorg Hindoyan
5835bc4951
Fix NaiveDate parse_from_str argument order
...
The [documentation](https://docs.rs/chrono/0.4.13/chrono/naive/struct.NaiveDate.html#method.parse_from_str ) specifies that `NaiveDate::parse_from_str` takes two arguments: value and format, in respective order.
Due to this, `DATE` fields could not be read into `NaiveDate`... and I have ptsd.
2020-10-16 14:40:50 -07:00
Patryk Wychowaniec
ca07158949
sqlite: Fix #616
2020-10-13 09:54:50 -07:00
Andrew Whitehead
9cd9209aa3
add support for pooling in-memory sqlite DB, enabling shared cache
2020-09-02 22:51:03 -07:00
Julius de Bruijn
ae2e5db4b2
SQLite: Allow setting busy_timeout in options
2020-08-04 19:16:31 -07:00
foldu
bd1d9f45f3
Fix create_if_missing docs
2020-07-27 04:03:30 -07:00
Ryan Leckey
7bc3133f70
feat: add an optional query logger (using log)
2020-07-26 23:55:36 -07:00
Ryan Leckey
b61c0821ab
style: rustfmt
2020-07-24 08:07:44 -07:00
Ryan Leckey
e575501a39
feat: add Executor::prepare, a hook into the automatic statement preparation life-cycle
2020-07-24 07:24:23 -07:00
Julius de Bruijn
e8a4c54ac7
Allow setting caching per-query
2020-07-24 07:24:23 -07:00
Julius de Bruijn
590f97df4a
Caching describe
2020-07-24 07:24:23 -07:00
Martin Risell Lilja
eba6f3973d
Remove sneaky 'println!' in sqlite chrono.
2020-07-23 03:36:27 -07:00
Ryan Leckey
820618f396
test: fix some doctests under runtime-tokio
2020-07-18 03:27:05 -07:00
Ryan Leckey
25b8fc7c04
fix(sqlite): support column types changing per row
2020-07-15 02:05:00 -07:00
Ryan Leckey
dc5fc1b6c1
fix: do not enforce type equality if matching against the NULL type
2020-07-15 02:04:32 -07:00
Ryan Leckey
63f37a78c3
feat(sqlite): add SqliteConnectOptions::filename
2020-07-14 08:45:30 -07:00
Ryan Leckey
47d566f5b6
feat: support Done for Any
2020-07-14 04:41:27 -07:00
Ryan Leckey
00137d4a04
feat: add sqlx::Done and return from Executor::execute()
...
+ Done::rows_affected()
+ Done::last_insert_id()
2020-07-14 04:31:25 -07:00
Ryan Leckey
d10f299c55
test: tweak in-code examples for latest refactors
2020-07-12 04:30:10 -07:00
Ryan Leckey
61e4a4f566
feat: finish v1 of both cli and embedded migrations
2020-07-12 03:43:55 -07:00
Ryan Leckey
e765287dba
refactor: restructure relationship between Pool, Connection, and Options
...
* Pool::new -> Pool::connect
* Add Pool::connect_lazy
* Pool::builder -> PoolOptions::new
* PoolConnection no longer implements Connection
* Transaction no longer implements Connection
* Add ConnectOptions::connect
* Add Acquire - abstract between &Pool and &mut Connection within one function
* Remove Connect, move connect to Connection
Co-authored-by: Austin Bonander <austin@launchbadge.com>
2020-07-12 03:43:55 -07:00
Ryan Leckey
15fc837366
fix: sqlite chrono type match after column metadata changes
2020-07-05 04:29:52 -07:00
Ryan Leckey
250b4d8e10
feat(any): update Any to support the new column metadata
2020-07-05 04:23:10 -07:00
Ryan Leckey
8d188c5f1a
feat: expose column information on Row
...
- add database-specific Column types: MySqlColumn, PgColumn, etc.
- add Row::columns() -> &[DB::Column]
- add Row::column(I) and Row::try_column(I)
2020-07-05 03:48:36 -07:00
Ryan Leckey
3b503a7764
feat(sqlite): clean up chrono support, add support for NaiveTime and NaiveDate
2020-07-04 05:51:46 -07:00
Ryan Leckey
7d22c0917f
Merge remote-tracking branch 'meteficha/felipesere-rebased'
2020-07-04 04:37:11 -07:00
agentsim
7810f7dcdd
Sqlite Collation Support ( #446 )
...
* Sqlite Collation Support
Adds a method create_collation to SqliteConnection.
Adds a unit test confirming the collation works as expected.
* Fix formatting
* Address feedback
Co-authored-by: Ryan Leckey <ryan@launchbadge.com>
2020-07-04 04:30:40 -07:00
Ryan Leckey
d112c4d807
feat(sqlite): support expressions and multiple no-data statements in the macros
2020-07-04 04:06:43 -07:00
Ryan Leckey
d209c60eb7
feat(sqlite): add read_only to SqliteConnectionOptions
2020-07-04 02:55:01 -07:00
Ryan Leckey
3c3356675e
fix(sqite): emit REAL for float columns in SQLite as the docs use that word a lot more
2020-07-04 02:54:41 -07:00
Ryan Leckey
0b2844bf39
feat(any): implement ColumnIndex<AnyRow> for &str to enable FromRow for the Any driver
...
closes #464
2020-07-02 23:28:53 -07:00
Ryan Leckey
222cd688a4
feat(sqlite): enable configuration of journal_mode and foreign_keys and default to WAL and ON
2020-07-02 23:18:14 -07:00
Ryan Leckey
5d6516da68
fix: re-add MapRow and TryMapRow to fix HRTB normalization when more than one driver is in-use
2020-07-02 23:00:46 -07:00
Ryan Leckey
c7c46f237b
fix(sqlite): argument bind for sqlite is 1-indexed
...
fixes #467
2020-07-02 22:52:33 -07:00
Julius de Bruijn
24d626b883
Reveal SQLite's extended error code
2020-07-01 09:33:18 -07:00
Ryan Leckey
cfa833fa0d
fix(sqlite): fallback to storage class when typing expressions and infer INTEGER as i64
2020-06-27 19:17:46 -07:00
Ryan Leckey
0b34545608
Revert "refactor: remove several blanket impls to allow more customization"
...
This reverts commit eb26e9f557bdefc2baa9eb4a89717dfabb55e5a1.
2020-06-27 18:54:50 -07:00
Felipe Lessa
c827c72808
FixedOffset for SQLite + Local test.
2020-06-27 21:59:49 +01:00
Felipe Lessa
30faf73208
Use DATETIME for Sqlite chrono, fix parsing and docs.
...
The name DATETIME is used as an example by the SQLite documentation
(https://sqlite.org/datatype3.html#affinity ).
2020-06-27 12:22:27 +01:00
Felipe Lessa
f0adeae39e
Add sqlite chrono tests.
2020-06-27 12:08:16 +01:00
Felipe Lessa
516af07713
Sqlite support for DateTime<{Utc,Local}>.
2020-06-27 12:08:00 +01:00
Ryan Leckey
b7ec7bbd3e
refactor: allow non-Send adding to arguments crate-local
2020-06-27 04:06:22 -07:00
Ryan Leckey
eb26e9f557
refactor: remove several blanket impls to allow more customization
2020-06-27 04:05:23 -07:00
Felipe Lessa
4254735dcf
Update sqlite chrono support so it compiles.
2020-06-27 09:12:33 +01:00
Felipe Sere
333803c1ff
Correct table headings and only list types that are actually implemented
2020-06-27 08:25:07 +01:00
Felipe Sere
7c27065c09
First attempt at roundtripping chrono types through SQLite
2020-06-27 08:25:05 +01:00
Ryan Leckey
991c0ba155
fix(sqlite): double negative in sqlite connection prepare
2020-06-25 05:34:14 -07:00
Ryan Leckey
8d1368f163
fix(sqlite): with caching disabled force persistent to false
...
additionally, set persistent to true for a cached statement and
correctly only reset the statement when its being reused
2020-06-25 03:44:26 -07:00
Julius de Bruijn
363dbfb81e
No need to reset the statement when dropping.
2020-06-25 12:38:20 +02:00
Julius de Bruijn
f969798cb6
Document new connection string params
2020-06-25 11:57:55 +02:00
Julius de Bruijn
2c2a277666
Caching methods in Connection
2020-06-25 10:44:05 +02:00