* removes the lifetime from Row
* removes MySqlQueryAs, SqliteQueryAs, etc. (no longer needed)
* introduce query_scalar
* introduce Decode::accepts to allow overriding runtime type checking
per-type (replaces TypeInfo::compatible)
* introduce Encode::produces to allow overriding the encoded type per-value
* adds a lifetime to Arguments (and introduce the HRTB HasArguments)
to support zero-copy encoding with SQLite
* renames Database::RawBuffer to HasArguments::ArgumentBuffer
* introduce Connect::connect_with to provide an ConnectOptions type
explicitly to opt-out of connection string parsing
* introduce Value and ValueRef traits to allow decoding-deferred
extraction of values from Rows
* introduce Encode::encode_by_ref and change Encode::encode to take
by-value to try and re-use memory where possible
* use thiserror to generate sqlx::Error
* [!] temporarily removes query logging
* [!] temporarily removes transactions
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.
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.
* Adds tables for storing articles, tags, favorites, and comments.
* Implements all remaining web APIs (articles, tags, profiles, etc)
* Refactors `Provide` traits into
* `ProvideAuthn` is used to store/retrieve user info
* `ProvideData` is used to retrieve application data
* ` Provide` traits are now implemented on Connections instead of Pools
* Introduces `Db` trait that encapsulates DB connections
* Cleans up endpoint functions
**General**
* Moves `examples/postgres/realworld` to `examples/realworld`
* The app is now architected to support multiple DBs
* Adds feature flags for `sqlite` and `postgres` to allow user to choose
which backend to use
*NOTE* Currently it is not possible to compile with `postgres` and `sqlite`
enabled as we are using the `query!` and `query_as!` macros and they
seem to get unhappy.
* Adds CLI flags for picking the DB backend to use at runtime
* Adds schema file and implementation for SQLite for `/api/user` routes
* Adds stub routes and trait for articles and Articles entity
**Changes**
* We now use i32 instead of i64 as the user_id to get around some quirks
w/ the SQLite driver.
* Reimplements existing route handlers w/ an error handling shim so we can use
Try inside the biz logic
* *FIX* Adds a `user` key to the register user body to conform w/ realworld's
API specs
APIs were functionally tested using realworld's API test script
(https://github.com/gothinkster/realworld/tree/master/api#authentication)