Commit graph

876 commits

Author SHA1 Message Date
Ryan Leckey
50a9120efb mysql: use the correct integer width 2020-03-25 04:31:38 -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
ad2cf1676f mysql: tweak type equivalence rules to try and support both rust best practices but still be compatible with the loose types of mysql 2020-03-25 03:56:39 -07:00
Ryan Leckey
50928b06b8 mysql: implement type compatible checks 2020-03-25 03:24:43 -07:00
Ryan Leckey
985d62009c sqlite: adjust for recent changes with RawValue 2020-03-25 02:37:10 -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
Ryan Leckey
129efcd367 implement a runtime type compatibility check before decoding values 2020-03-25 02:07:17 -07:00
Ryan Leckey
1dc582edd0 postgres: have PgValue remember its type OID
this is in preparation of doing type compatibility checks
2020-03-25 01:46:13 -07:00
Ryan Leckey
918a797581 move HasX types into the module where X is 2020-03-25 01:44:00 -07:00
Ryan Leckey
63aa3e8f0f add support for VARCHAR and BPCHAR in postgres 2020-03-24 12:49:52 -07:00
Ryan Leckey
f83e0296cc don't use now private module runtime in tests 2020-03-24 03:13:12 -07:00
Ryan Leckey
dcea3f0586 fix FromRow derive to take &Row 2020-03-24 03:08:58 -07:00
Ryan Leckey
e71b969e78 remove nix files 2020-03-24 03:03:24 -07:00
Ryan Leckey
aa1cb24de9 remove DecodeOwned 2020-03-24 03:03:04 -07:00
Ryan Leckey
fa4138b25c add docs to explain the SQL <-> Rust mapping 2020-03-24 02:56:52 -07:00
Ryan Leckey
43a72657f9 add a hack so bigdecimal can be the package name and the feature name 2020-03-24 02:56:14 -07:00
Ryan Leckey
f2ca42256b Add more documentation for Connection and Transaction 2020-03-24 02:12:42 -07:00
Ryan Leckey
412f7125fb document Cursor 2020-03-24 01:53:56 -07:00
Ryan Leckey
1940b685d3 fix warnings from rustdoc 2020-03-24 01:36:17 -07:00
Ryan Leckey
792acdd554 audit Row, FromRow, and ColumnIndex
* tweak FromRow to accept Row by reference, should make it easier to compose FromRow impls
 * rename ColumnIndex::resolve to ColumnIndex::index
 * document behaviors
2020-03-24 01:24:10 -07:00
Ryan Leckey
0182ce92f2 make sqlx_core::runtime private and add a runtime module to sqlx-macros 2020-03-24 01:19:03 -07:00
Ryan Leckey
e2f90c8f85 Update dependencies 2020-03-23 22:07:38 -07:00
Ryan Leckey
d646a1d509 remove unused import in derives/row 2020-03-23 22:07:06 -07:00
Ryan Leckey
3ecc2e06ba Run rustfmt (small issue in a test) 2020-03-23 21:24:28 -07:00
Ryan Leckey
7bfd37e888 Add a test for #[derive(FromRow)] both with and without a declared lifetime 2020-03-23 21:22:25 -07:00
Ryan Leckey
ba86bc5555 Tweak doc on Cursor::next 2020-03-23 21:22:09 -07:00
Ryan Leckey
a0bf61cc4a Declare ColumnIndex over Row instead of over Database 2020-03-23 21:21:59 -07:00
Ryan Leckey
5ada3f3ae6 Implement #[derive(FromRow)] 2020-03-23 21:18:03 -07:00
Ryan Leckey
d8a793a766 Fix doctests 2020-03-21 03:44:38 -07:00
Ryan Leckey
cb2e3220e0 simplify lifetimes on Row 2020-03-21 03:25:17 -07:00
Ryan Leckey
fc6e6a65f7 only run gated time tests if both time features are not present 2020-03-21 03:20:38 -07:00
Ryan Leckey
4881e7dcee Update dependencies 2020-03-21 03:01:54 -07:00
Ryan Leckey
200d534b8a Fix time/chrono decode tests 2020-03-21 03:01:23 -07:00
Ryan Leckey
0ef1ef3c4f time: we need std feature 2020-03-21 02:42:32 -07:00
Ryan Leckey
db543f8391 clean up Time impl, impl for text modes 2020-03-21 02:34:21 -07:00
Ryan Leckey
4a98a51a19 Merge remote-tracking branch 'utter-step/time-rs' 2020-03-21 01:25:00 -07:00
Ryan Leckey
05d8ac2747 Finish up JSON/JSONB support for Postgres
* implement for &serde_json::RawValue

 * sqlx::types::Json<T> is a common type that all JSON-compatible databases can implement for,
   postgres implements Json<T> as JSONB

 * sqlx::postgres::types::PgJson<T> resolves to JSON

 * sqlx::postgres::types::PgJsonB<T> resolves to JSONB
2020-03-21 01:16:34 -07:00
Oliver Bøving
b7e53e885a First draft of JSON/JSONB support for postgres
This introduces two new wrapper types `Json` and `Jsonb`, currently
exported by `sqlx::postgres::{Json, Jsonb}` and adds serde and
serde_json as optional dependencies, under the feature flag `json`.
Wrapping types in `Json[b]` that implement `serde::Deserialize` and
`serde::Serialize` allows them to be decoded and encoded respectivly.
2020-03-20 23:59:25 -07:00
Daniel Akhterov
cbdc1bbfb2 Refactor the error to be generic over database 2020-03-20 23:51:45 -07:00
Ryan Leckey
f86f80d8b9 mysql: ping now follows the normal stream lifecycle
fixes test introduced by #142

Co-authored-by: Daniel Akhterov <daniel@launchbadge.com>
2020-03-20 20:47:30 -07:00
Ryan Leckey
f82c57e4b2 Merge branch 'Freax13-fetch-one-hang' 2020-03-20 20:10:10 -07:00
Ryan Leckey
476b9308f2 Merge branch 'fetch-one-hang' of https://github.com/Freax13/sqlx into Freax13-fetch-one-hang 2020-03-20 20:10:02 -07:00
Ryan Leckey
ec27b65b26 postgres: change types in macros
Co-authored-by: Oliver Bøving <oliverboving@gmail.com>
2020-03-20 20:07:52 -07:00
Ryan Leckey
e42a995fd9 Extract a PgSequenceDecoder from ArrayDecoder and RecordDecoder and improve to support mutual nesting 2020-03-20 19:56:25 -07:00
Ryan Leckey
13997ce957 Change HasSqlType to Type 2020-03-20 19:55:47 -07:00
Ryan Leckey
9973fa6357 Add decode_err! to help with formatted decode error generation 2020-03-20 19:55:00 -07:00