Austin Bonander
6913695588
add support for building in "decoupled" mode
2020-05-30 16:02:37 -07:00
吴翱翔
77cdafe08a
Fix a misspelling in MySQL types document
2020-05-15 12:46:35 -07:00
Ryan Leckey
cbccd68963
chore: prepare v0.3.5
2020-05-06 03:30:35 -07:00
meh
7b1cc7fd09
Derive Serialize and Deserialize for Json
2020-05-06 00:13:19 -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
4122a3dbd9
mysql: Advance buffer to comply with protocol
...
Fixes #254
2020-04-27 16:47:38 -07:00
Hasan Ali
3e2ed00b60
Drop all statements before closing sqlite connection
2020-04-27 10:20:57 -07:00
Josh Holmer
581bcf0ceb
Extract slow query threshold to constant
2020-04-23 14:09:59 -07:00
Josh Holmer
627d8292f8
Log queries from sqlx::query
...
This will make logged queries show
as from `sqlx::query` instead of `sqlx::db_name::executor`.
Followup to #268
2020-04-23 14:09:59 -07:00
Josh Holmer
f73149a90f
Format SQL queries when printing them to the logs
...
Before, the query would be formatted equivalent to the input string:
```
[2020-04-18T23:47:32Z DEBUG sqlx_core::postgres::executor] SELECT id, queue, ..., elapsed: 2.320µs
SELECT id, queue, payload, status, priority, created_at, updated_at
FROM jobs
WHERE status = $1
ORDER BY priority ASC, created_at ASC
```
After, the query is formatted cleanly and consistently:
```
[2020-04-19T00:30:18Z DEBUG sqlx_core::postgres::executor] SELECT id, queue, ..., elapsed: 2.280µs
SELECT
id,
queue,
payload,
status,
priority,
created_at,
updated_at
FROM
jobs
WHERE
status = $1
ORDER BY
priority ASC,
created_at ASC
```
This uses the `sqlformat` crate, which was ported from the
Javascript `sql-formatter-plus` library specifically for this purpose.
2020-04-19 16:11:50 -07:00
Ryan Leckey
1cdfb8507c
fix: remove the clone on Encode for JsonValue
2020-04-19 16:05:37 -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
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