Blaine Bublitz
168ce9bed0
Attempt to add integration tests
2020-05-20 20:33:03 -07:00
Blaine Bublitz
33915ae3ad
Add uppercase support for Type macro
2020-05-20 20:33:03 -07:00
吴翱翔
77cdafe08a
Fix a misspelling in MySQL types document
2020-05-15 12:46:35 -07:00
PumpkinSeed
19edb73ffc
Add meaningful errors
2020-05-15 12:45:32 -07:00
Ryan Leckey
cbccd68963
chore: prepare v0.3.5
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
Milan Zivkovic
a034df87c4
fix issue with project name
2020-04-30 21:16:45 -07:00
Milan Zivkovic
3edf84ae3d
Todo API example using Actix-web and SQLx with PostgreSQL database
2020-04-30 21:16:45 -07:00
Walther Chen
c9c82b06c1
readme example typo
...
I believe `.build()` takes `&str`, but `env:var()` returns ` Result<String, VarError>`
2020-04-30 21:15:33 -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
Austin Bonander
a7d039931c
fix UI tests
...
looks like the `.stderr` file for a SQLite UI test never got added, and notes on errors in other tests changed slightly
2020-04-27 19:43:54 -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
Dan B
e7c1486005
Add support for crate specific .env files
...
This change will attempt to load an .env file from CARGO_MANIFEST_DIR, if it exists.
For backwards compatibility, if the .env file does not exist, we will fall back to default dotenv behaviour.
Resolves #267
2020-04-24 15:40:20 -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
Jesper Axelsson
38892c1012
Use dialoger for prompt
2020-04-19 16:29:34 -07:00
Jesper Axelsson
f491198891
List migrations
2020-04-19 16:29:34 -07:00
Jesper Axelsson
70654ff2db
Use text instead of varchar
2020-04-19 16:29:34 -07:00
Jesper Axelsson
c58b15ce83
Add mysql as default feature
2020-04-19 16:29:34 -07:00
Jesper Axelsson
ccf630fa62
Use sqlite connection to create database
2020-04-19 16:29:34 -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
Jesper Axelsson
f1c1d9ae07
Formatting
2020-04-17 23:03:46 -07:00
Jesper Axelsson
19f086cc23
Add alias 'mig' for migration
2020-04-17 23:03:46 -07:00
Jesper Axelsson
cbac531a63
Changed from db_creator to migrator
2020-04-17 23:03:46 -07:00
Jesper Axelsson
cf3d8c295e
Make sure user really want to drop their database
2020-04-17 23:03:46 -07:00
Jesper Axelsson
18800b6e2a
Only set features from features...
2020-04-17 23:03:46 -07:00
Jesper Axelsson
c1f17c75d2
Add suport for sqlite
2020-04-17 23:03:46 -07:00
Jesper Axelsson
961ade18d0
Moved all migration code for postgres behind traits
2020-04-17 23:03:46 -07:00
Jesper Axelsson
b20c6a2e09
Move migration code to their own files
2020-04-17 23:03:46 -07:00
Jesper Axelsson
93135c51f4
Start supporting more databases
2020-04-17 23:03:46 -07:00
Jesper Axelsson
42213b9937
Add feature check for database
2020-04-17 23:03:46 -07:00
Jesper Axelsson
5295389fdf
Setup features
2020-04-17 23:03:46 -07:00
Jesper Axelsson
36301f6698
Started to abstract the postgres database
2020-04-17 23:03:46 -07:00
Ryan Leckey
145218f116
Merge branch 'shssoichiro-snake-case-support'
2020-04-17 22:52:11 -07:00
Ryan Leckey
230eeef940
Merge branch 'snake-case-support' of git://github.com/shssoichiro/sqlx into shssoichiro-snake-case-support
2020-04-17 22:51:52 -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
Samani G. Gikandi
45744e8033
Updates CI workflow for realworld
...
* Moves realworld into a separate file since it's long
* Adds checkout, db provisioning, and build steps for postgres and
sqlite
2020-04-17 12:42:22 -07:00
Samani G. Gikandi
841d9a7f45
Changes PKs in realworld postgres to SERIAL
...
`GENERATED` was added in Postgres 12 and we test as far back as 9
2020-04-17 12:42:22 -07:00
Samani G. Gikandi
9fb523d4e8
Runs rustfmt across realworld
2020-04-17 12:42:22 -07:00