300 Commits

Author SHA1 Message Date
Julius de Bruijn
1a59d3308a Pg: Implementing BIT and VARBIT using BitVec 2020-07-27 03:36:44 -07:00
Ryan Leckey
27c67752f3 test(mysql): remove failing part of boolean describe test - not easily possible to fix in 0.4 2020-07-27 01:11:11 -07:00
Raphaël Thériault
ced09e0545
Support using both nullability and type overrides (#549)
* Make it possible to use both nullability and type overrides

* Fix override parsing lookahead logic

* Update column override tests

* Support nullability overrides with wildcard type overrides

* Fix tests

* Update query! overrides docs

* Remove last bits of macro_result!

* rustfmt
2020-07-27 00:43:35 -07:00
Ryan Leckey
d06de149a0 fix: get MatchBorrow type check working for references 3 deep 2020-07-26 23:07:12 -07:00
Ryan Leckey
3d7ac03e52 style: rustfmt 2020-07-26 22:30:45 -07:00
Ryan Leckey
4fec7db789 test(mysql, uuid): add some tests to prove UUIDs work in MySQL 2020-07-26 22:30:32 -07:00
Ryan Leckey
ec0e84d8ac feat(mysql): support reading and writing BIT via unsigned integers
e.g., BIT(64) is u64 and BIT(2) is u8
2020-07-26 19:42:32 -07:00
Ryan Leckey
7b132d1dbc refactor(mysql): store max_size in MySqlTypeInfo – prepare for an eventual future where emit bool for TINYINT(1) 2020-07-26 19:37:58 -07:00
Ryan Leckey
55f6c9a2e9 test: fix decode test in macros 2020-07-26 18:11:15 -07:00
Ryan Leckey
f298eb3cf1 Merge remote-tracking branch 'raftario/embedded-migrations' 2020-07-26 18:03:59 -07:00
Ryan Leckey
86d41f17aa Merge remote-tracking branch 'origin/ab/macro-refresh' 2020-07-26 17:54:23 -07:00
Ryan Leckey
b61c0821ab style: rustfmt 2020-07-24 08:07:44 -07:00
Ryan Leckey
3840d031c6 test: add a test case for YEAR support (as u16) 2020-07-24 08:07:07 -07:00
Ryan Leckey
08d2c79279 feat(postgres): expose PgTypeKind 2020-07-24 07:28:59 -07:00
Danny Weinberg
f0f93c4f79 Fix options in tests 2020-07-24 07:25:29 -07:00
Danny Weinberg
036bd2a05d Add SCREAMING_SNAKE_CASE rename_all option
This mirrors the addition of `uppercase` in https://github.com/launchbadge/sqlx/pull/304, but for all uppercase snake case.
2020-07-24 07:25:29 -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
c9c11c8302 2-tier cache for Postgres
This solves a problem when needing to describe a query before executing
it, in cases where the query is more of a dynamic nature and binding its
parameters require the type info.

In this case, the first describe doesn't know the input parameters, so
the parameter type info is inferred from the database. In cases of
`varchar(10)[]` or `json` column types, the parameter type is inferred
to the column type. Now if we then try to use `text[]` or `jsonb` as the
types, the database has already stored different types for these
parameters for the statement, and will error out.

So we'll now only store the statement to the cache when it comes from an
actual execution of the query.
2020-07-24 07:24:23 -07:00
Julius de Bruijn
0c9bea4ab2 Fixing panics for disabled statement cache 2020-07-24 07:24:23 -07:00
Julius de Bruijn
a27244b3c9 Make the test simpler for easier debug 2020-07-24 07:24:23 -07:00
Julius de Bruijn
a4dc3dfbd7 Add a test showing a bug in describe/execute combo 2020-07-24 07:24:23 -07:00
Julius de Bruijn
590f97df4a Caching describe 2020-07-24 07:24:23 -07:00
Raphaël Thériault
435445fbd0 Edit migrator to make it possible to create static instances 2020-07-23 17:54:05 -04:00
Raphaël Thériault
92646e00b8 Fix migrate! and add migration test 2020-07-23 17:46:27 -04:00
Austin Bonander
94aa698581
refactor(macros): remove ResultExt and macro_result!() 2020-07-21 21:19:31 -07:00
Ryan Leckey
ee4d9b5412 fix(postgres): use the element type info from the protocol if available for array element decoding
fixes #537
2020-07-20 23:53:18 -07:00
Ryan Leckey
ae8800ccc4 feat(postgres): add () for VOID in macro resolution 2020-07-20 23:12:43 -07:00
Ryan Leckey
cd4e8dc1cb feat(mysql): support configuring the active charset and collation (via an automatic SET NAMES) 2020-07-20 23:07:22 -07:00
Ryan Leckey
cf78472d6d fix(mysql): gate com_stmt_execute encode on non-empty params, not non-null params 2020-07-20 21:49:30 -07:00
Ryan Leckey
96b76dc737 update todo examples to 0.4 and use migrations
* update tests/x.py

 * add examples/x.py
2020-07-18 05:43:16 -07:00
Ryan Leckey
14ecf5cbc4 test: make --target a prefix match and add --target-exact the old exact match 2020-07-18 03:26:55 -07:00
Ryan Leckey
9400a81cb0 test: switch tests/x.py to use host rustc for running tests 2020-07-18 03:18:25 -07:00
Ryan Leckey
f345c23e51 fix(mssql): handle multi-chunk packets
fixes #523
2020-07-17 06:08:36 -07:00
Ryan Leckey
9befdc81bf test: add a regression test for the bugs discovered with #527 2020-07-17 04:56:58 -07:00
Ryan Leckey
fa40e9e55f implement support for postgres TIMETZ type
Co-authored-by: Julius de Bruijn <julius+github@nauk.io>
2020-07-17 03:22:40 -07:00
Ryan Leckey
f4eb968c8d test(sqlite): add DB parameter to Decode invocation 2020-07-17 03:22:40 -07:00
Ryan Leckey
6949b84e8c style: rustfmt 2020-07-15 02:31:57 -07:00
Ryan Leckey
9b956c0d2c fix(postgres): support the VOID type, as () 2020-07-15 02:16:08 -07:00
Ryan Leckey
25b8fc7c04 fix(sqlite): support column types changing per row 2020-07-15 02:05:00 -07:00
Ryan Leckey
1247daec83 test: fix spurious ? in sqlite test 2020-07-14 08:52:42 -07:00
Ryan Leckey
54c857b448 fix some remaining usage of PoolOptions 2020-07-14 06:33:36 -07:00
Ryan Leckey
793f247604 refactor: PoolOptions::new() takes no parameters and the final .connect method takes the URI 2020-07-14 06:07:29 -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
93cab2a197 test: more pool usage adjustments 2020-07-12 05:02:40 -07:00
Ryan Leckey
fc682fa991 fix: adjust pool usage in tests and examples 2020-07-12 04:42:48 -07:00
OriolMunoz
993352e9d4 Support for #[sqlx(default)] 2020-07-12 03:57:17 -07:00
Mike Ledger
e731836e48 rust fmt wibble 2020-07-09 12:34:19 -07:00
Mike Ledger
03fcfc8562 concat test 2020-07-09 12:34:19 -07:00
Julius de Bruijn
f246d41aed Fixed an overflow with a negative scale 2020-07-09 12:32:19 -07:00