Ryan Leckey
bb7c064bec
fix: error handling in main options examples
2020-06-01 05:35:13 -07:00
Ryan Leckey
3fcd4cd80e
style(core): apply more clippy suggestions
2020-05-30 18:28:55 -07:00
Ryan Leckey
35bf560481
fix(core): tweak serialization impls to fix offline mode
2020-05-30 18:17:51 -07:00
Ryan Leckey
9b299d9f09
style(core): apply future-incompatible suggestions
2020-05-30 18:06:21 -07:00
Ryan Leckey
e08f05b879
feat: re-introduce error downcasting
2020-05-30 17:51:56 -07:00
Ryan Leckey
e5b6047009
feat: introduce docker-compose based testing for running locally against many database combinations
2020-05-30 17:51:55 -07:00
Ryan Leckey
0a04abdb3e
feat: Pool is now generic over Database, as opposed to Connection
...
this fixes an unfortunate interaction with HRTBs where the compiler would
produce infinitely nested PoolConnection<PoolConnection<....
2020-05-30 17:51:55 -07:00
Ryan Leckey
cf7606be1b
fix: Transaction now to rollbacks on drop (again)
2020-05-30 17:51:55 -07:00
Ryan Leckey
bb3b571a57
fix: tweak lifetimes in Executor to limit the scope for the borrow on the query to the single execution
2020-05-30 17:51:55 -07:00
Ryan Leckey
cc9d443434
feat: re-introduce Transaction
...
* Transaction now wraps `&mut Connection` instead of `Connection`
2020-05-30 17:51:55 -07:00
Ryan Leckey
9d2a0141cb
feat: introduce IntoArguments, query_with, query_as_with, and query_scalar_with
2020-05-30 17:51:55 -07:00
Ryan Leckey
88532ffc28
refactor: clean up warnings
2020-05-30 17:51:49 -07:00
Ryan Leckey
a54b1267f6
refactor(macros): adapt to the 0.4.x core refactor
2020-05-30 17:51:49 -07:00
Ryan Leckey
eaa7fba9d4
refactor(postgres): adapt to the 0.4.x core refactor
2020-05-30 17:49:30 -07:00
Austin Bonander
6913695588
add support for building in "decoupled" mode
2020-05-30 16:02:37 -07:00
Austin Bonander
c285e28670
fix and test handling of 0 for BigDecimal in Postgres/MySQL
...
closes #283
2020-04-28 11:54:41 -07:00
Peter Maatman
1b04829c46
json: Refactor Encode/Decode for serde values to be generic for DB
...
Since the implementation of Encode and Decode for both mysql and
postgres on serde's Value and RawValue were practically the same they
were moved to the generic json module.
2020-04-19 15:58:47 -07:00
Peter Maatman
30d13174ea
mysql: Add JSON support
2020-04-19 15:58:47 -07:00
Felix Wiedemann
57f52ffbc4
postgres: Use $USER as default for the username
2020-04-18 14:31:31 -07:00
Felix Wiedemann
f3fe41ebdb
postgres: Use username as default for database name
2020-04-18 14:31:31 -07:00
Felix Wiedemann
a2673f7880
postgres: Add support for postgres:///?host=... connection strings
2020-04-18 14:31:31 -07:00
Felix Wiedemann
fc78f15ebf
postgres: Add support for non-default socket paths
2020-04-18 14:31:31 -07:00
Felix Wiedemann
5628658d3f
postgres: Add unix domain socket support
2020-04-18 14:31:31 -07:00
Felix Wiedemann
49f15713d6
Move empty host handling to the DB specific code
2020-04-18 14:31:31 -07:00
Josh Holmer
16229fd0ad
Add basic query logging
...
Prints each query performed at DEBUG level,
along with a timing of how long the query took
to execute.
Slow queries will be printed at WARN level.
Currently the slow query threshold is
hardcoded to 1 second.
2020-04-17 22:49:33 -07:00
Ryan Leckey
d360f682f8
fix(postgres): guarantee the type name on a PgTypeInfo to always be set
...
fixes #241
2020-04-10 13:37:08 -07:00
Kristy Brambila
0e61642165
Make postgres type name resolution case-insensitive
2020-04-08 01:22:37 -07:00
Ryan Leckey
2a9774d84f
use cow::borrowed to remove a minor allocation in postgres/startup
...
refs #214
2020-03-31 21:41:29 -07:00
Ryan Leckey
3a997f06ab
Merge pull request #214 from jamwaffles/encoded-connection-string
...
Decode username on read
2020-03-31 21:38:33 -07:00
James Waples
f05f6bedd9
Decode username on read
2020-03-31 23:03:17 +01:00
Neeraj Jaiswal
c29fc5cccd
Remove matches dependency and use matches macro from std
2020-03-31 18:01:06 +05:30
Ryan Leckey
b65602d842
postgres: remove unused import
2020-03-30 18:52:52 -07:00
Ryan Leckey
d3eb9c7800
postgres: use PgStream::receive over PgStream::read to handle errors
...
* PgStream::read should probably be named better; maybe PgStream::raw_receive
Fixes #203
2020-03-30 18:38:31 -07:00
Ryan Leckey
bbbc1811ce
postgres: tweak DataRow::read
2020-03-30 18:31:05 -07:00
Oliver Bøving
bcb3959379
Add array of uuid, chrono, time, bigdecimal, and ipnetwork as well as JsonValue to query macro ( #154 )
...
* Add array of uuid, chrono, time, bigdecimal, and ipnetwork to query macro
* Comment out tests for arrays of BigDecimal
Currently arrays of BigDecimal doesn't in query macros compile.
As all of the other types work just fine, BigDecimal is simply omitted.
* Add serde_json::Value to query macros
This also adds serde_json as an optional dependency to sqlx_macros along
side a new json feature flag.
2020-03-28 17:28:47 -07:00
Ryan Leckey
dddaefec41
postgres: capitalize the W in handling the WHERE field for notice
...
Fixes #120
2020-03-27 16:43:15 -07:00
Austin Bonander
e594a7fdca
Postgres: don't cache failed statement
2020-03-27 15:54:28 -07:00
Ryan Leckey
3103d50be8
postgres: implement PgTypeInfo::with_name
...
- remove PgTypeInfo::with_oid
- use a new PgRawBuffer type instead of Vec<u8> for encoding
2020-03-26 19:29:49 -07:00
Ryan Leckey
2409c2b042
postgres: indicate that we do not support CITEXT right now
2020-03-26 19:16:54 -07:00
Austin Bonander
e99a863288
remove now-unused imports and reformat
2020-03-25 21:37:11 -07:00
Austin Bonander
6e3fa49ad5
add unit tests for DatabaseError downcasting
2020-03-25 18:26:57 -07:00
Austin Bonander
673f133cab
un-generify Error and support downcasting in DatabaseError
2020-03-25 18:13:56 -07:00
Ryan Leckey
41608c3f60
rename {DB}Error -> {DB}DatabaseError
2020-03-25 04:50:27 -07:00
Ryan Leckey
2274b69556
postgres: support "CHAR" and OID
2020-03-25 04:46:17 -07:00
Ryan Leckey
6049f976f9
opt out of compatible type check for null values
2020-03-25 04:25:38 -07:00
Ryan Leckey
7ab772ea80
postgres: simplify JSON support to just Json<T>
2020-03-25 04:20:35 -07:00
Ryan Leckey
8454fa4e96
fix tests and ensure all types are being tested in CI
2020-03-25 04:06:14 -07:00
Ryan Leckey
2f6bab396a
Add PartialEq for PgTypeInfo and SqliteTypeInfo
2020-03-25 03:59:29 -07:00
Ryan Leckey
fbd1a0435f
postgres: support NAME and UNKNOWN types (compatible to TEXT)
2020-03-25 02:28:30 -07:00
Ryan Leckey
6ebd5c8c1e
postgres: test type compatibility for record fields
2020-03-25 02:28:10 -07:00