399 Commits

Author SHA1 Message Date
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
George Kaplan
7df6d4dbcf undo URL percent-encoding for SQLite connection strings 2020-04-17 18:23:33 -07:00
meh
2fb38dd0c1 Derive all traits and impl Deref and AsRef for types::Json 2020-04-16 11:00:31 -07:00
Austin Bonander
80eb2cc7d2 make the stream returned from Map::fetch() Unpin
closes #244
2020-04-11 03:04:21 -07:00
Ryan Leckey
90fd35745c Prepare v0.3.4 2020-04-10 15:56:13 -07:00
xiaopengli89
5711e1cc94 refactor: mysql decimal value is just ascii str 2020-04-10 15:35:58 -07:00
xiaopengli89
229635771a fix: test 2020-04-10 15:35:58 -07:00
xiaopengli89
771d423c6f fix: change u8::MAX to std::u8::MAX 2020-04-10 15:35:58 -07:00
xiaopengli89
401ffd19e6 add test_encode_decimal, test_decode_decimal 2020-04-10 15:35:58 -07:00
xiaopengli89
b354ed430d implement DECIMAL type support for mysql 2020-04-10 15:35:58 -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
Ryan Leckey
cd6735b5d7 fix(sqlite): handle empty statements, fixes #231 2020-04-08 02:13:37 -07:00
Ryan Leckey
72bd933e41 add MapRow impls; closes #228 2020-04-08 01:24:57 -07:00
Kristy Brambila
0e61642165 Make postgres type name resolution case-insensitive 2020-04-08 01:22:37 -07:00
kosyak
6c9241a3a9 Fixed types of variables that interact with libsqlite3 2020-04-07 04:10:47 -07:00
Ryan Leckey
e7ace2adc7 Prepare v0.3.3 2020-04-01 18:24:08 -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
Ryan Leckey
283f0ef6d8
Merge pull request #216 from Ace4896/must-use-types
Mark several types as #[must_use]
2020-03-31 11:49:05 -07:00
Jon Pacheco
ccc2bfa0a6 Mark several types as #[must_use] 2020-03-31 14:39:29 +01:00
Neeraj Jaiswal
c29fc5cccd Remove matches dependency and use matches macro from std 2020-03-31 18:01:06 +05:30
Ryan Leckey
a9fc05378e Prepare v0.3.2 2020-03-31 03:02:01 -07:00
Ryan Leckey
371e843bb2 mysql: remove random println 2020-03-31 03:00:31 -07:00
Ryan Leckey
a84e1f6626 Prepare v0.3.1 2020-03-30 18:53:03 -07:00
Ryan Leckey
b65602d842 postgres: remove unused import 2020-03-30 18:52:52 -07:00
Ryan Leckey
d820763bb9 mysql: infer empty password to mean no password 2020-03-30 18:42:25 -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
Ryan Leckey
670265f103 docs: fix link to db types 2020-03-29 16:34:05 -07:00
Ryan Leckey
fc3d06bf9b Prepare v0.3.0 2020-03-29 16:27:41 -07:00
Ryan Leckey
6de52567d7 docs: fix link to db types 2020-03-29 16:00:51 -07:00
Ryan Leckey
4ec9e9fce2 mysql: remove MySqlTypeInfo from mysql::types 2020-03-29 16:00:02 -07:00
Ryan Leckey
4b9a615b32 sqlite: remove SqliteTypeInfo from sqlite::types 2020-03-29 15:57:59 -07:00
Ryan Leckey
b8537d0a87 sqlite: condense allow(unsafe_code) 2020-03-29 15:55:09 -07:00
Ryan Leckey
2b06386bf1 sqlite: remove two unused imports 2020-03-29 15:53:04 -07:00
Ryan Leckey
b6d87a4cc7 require Rows to be Sync 2020-03-29 15:52:49 -07:00
Austin Bonander
73a9155b46 fix import of from_utf8_unchecked() 2020-03-28 17:50:27 -07:00
Austin Bonander
4ffa7f0e01 SQLite: implement column nullability checking 2020-03-28 17:50:27 -07:00
Austin Bonander
fe00c0d619 sqlite/statement.rs: lift #[allow(unsafe_code)] to module 2020-03-28 17:50:27 -07:00
Austin Bonander
6fde5a2579 implement nullability on macro output, test postgres 2020-03-28 17:50:27 -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