Commit graph

367 commits

Author SHA1 Message Date
Julius de Bruijn
2b6f242a22 LRU statement cache for MySQL 2020-06-24 16:57:06 +02:00
Austin Bonander
36a53b44cd fix(macros): don't emit typechecking code for explicit type overrides on bind params 2020-06-21 06:06:53 -07:00
Austin Bonander
f2515e2472 feat(macros): support nullable column override 2020-06-21 06:06:53 -07:00
Austin Bonander
029ba24cad chore(macros): add tests for bind parameter overrides 2020-06-21 06:06:53 -07:00
Austin Bonander
7d3d708d92 chore(macros): add test for column overrides for SQLite 2020-06-21 06:06:53 -07:00
Austin Bonander
1a250976ba chore(macros): add test for column overrides for MySQL 2020-06-21 06:06:53 -07:00
Austin Bonander
eb831382e5 feat(macros): type override annotations for columns 2020-06-21 06:06:53 -07:00
Ryan Leckey
efc4df3eea test: state only version 3 for docker-compose 2020-06-21 04:35:28 -07:00
Ryan Leckey
8800a40979 test: tokio or actix should import tokio in pool_smoke_test 2020-06-21 04:34:29 -07:00
Ryan Leckey
9abdd7e408 style: rustfmt 2020-06-21 04:08:17 -07:00
Ryan Leckey
7c4c185698 chore: update dependencies 2020-06-21 03:55:31 -07:00
Ryan Leckey
e7e2f5b37a fix: implement transparent Serialize and Deserialize for Json<_> 2020-06-21 03:55:31 -07:00
Peter Maatman
90242494a8 test: expose missing trait bounds for Json<Vec<x>> 2020-06-21 03:55:31 -07:00
Ryan Leckey
6cfe5ac811 refactor: tweak type name display to use TypeInfo::name 2020-06-21 03:55:31 -07:00
Daniel Akhterov
639e10248e
feat: add boolean support to sqlx-macros/mssql 2020-06-16 13:40:53 -07:00
Daniel Akhterov
80d545109b
feat: implement BIT support in MSSQL 2020-06-15 22:49:33 -07:00
Ryan Leckey
c9f3e1adca feat(postgres): add support for built-in range types and allow derives to handle custom range types
Co-authored-by: Caio <c410.f3r@gmail.com>
2020-06-12 15:33:19 -07:00
Caio
d4329e98d4 refactor: prepare to support postgres ranges
- Remove Type bound from Encode + Decode which removes the defaults 
   for produces() and accepts(). This allows custom type implementations
   to be more flexible.
2020-06-12 15:33:19 -07:00
Ryan Leckey
a2c55b9f31 fix(mysql): tweak JSON type so it accepts BINARY in addition to CHAR (and make tests pass in MySQL 5.5) 2020-06-10 00:43:14 -07:00
Peter Maatman
2a5ea2f71b mysql: always use column alias when available
If a query has a column alias available we should use that name instead
of the column name.

Fixes #385
2020-06-10 00:42:58 -07:00
Ryan Leckey
e1d22a1840 fix(core): async-stream crate seems to lose the stream if the stream owns the object we are streaming
hand-rolled a copy of the idea behind AsyncStream and things seem to work
2020-06-09 02:16:47 -07:00
Peter Maatman
2677046a3b test: add test case for fetch_all bug with pool 2020-06-08 02:36:17 -07:00
Ryan Leckey
e54d030381 fix(mysql): str should produce VARCHAR not BLOB 2020-06-08 02:30:21 -07:00
Ryan Leckey
e001815a18 test: fix non-repeatable postgres macro test 2020-06-08 00:18:53 -07:00
Ryan Leckey
f2885f84a7 fix(mssql): handle NULL values 2020-06-07 16:30:07 -07:00
Ryan Leckey
6497d67b6a feat(mssql): add macro support 2020-06-07 16:29:46 -07:00
Ryan Leckey
a0ccc135aa style(mssql): rename MsSql to Mssql as MSSQL is not written MsSQL 2020-06-07 05:39:12 -07:00
Ryan Leckey
55a59121ee test: small fix to sql in json test 2020-06-07 04:07:33 -07:00
Ryan Leckey
53c074130f Merge remote-tracking branch 'origin/ab/macro-fixes' 2020-06-07 02:35:12 -07:00
Ryan Leckey
ef2527ff3e feat(mssql): fix a few bugs and implement Connection::describe 2020-06-07 02:00:31 -07:00
Ryan Leckey
559169cc79 refactor(mssql): clean up unused imports and other warnings 2020-06-07 02:00:13 -07:00
Ryan Leckey
18ae43aae8 test: fix docker-compose file for postgres 2020-06-07 02:00:13 -07:00
Ryan Leckey
12c1137d91 feat(mssql): add support for f32 and f64 2020-06-07 02:00:13 -07:00
Ryan Leckey
2a272bdd59 feat(mssql): setup type tests for MSSQL and add support for all the int types 2020-06-07 02:00:13 -07:00
Ryan Leckey
434bfaa76a feat(mssql): handle stream flushing 2020-06-07 02:00:13 -07:00
Ryan Leckey
c64122c03f feat(mssql): implement parameterized queries 2020-06-07 02:00:13 -07:00
Ryan Leckey
9a701313bc feat(mssql): implement enough to get simple queries working
Co-authored-by: Daniel Akhterov <akhterovd@gmail.com>
2020-06-07 02:00:12 -07:00
Ryan Leckey
8c42d7fcc0 chore: setup MSSQL and DB2 in docker-compose 2020-06-07 02:00:12 -07:00
Austin Bonander
0652864315
fix(macros): reintroduce and fix test for macros in SQLite 2020-06-05 21:16:14 -07:00
Austin Bonander
80b4e2fca6
fix(macros): reintroduce and fix macro tests for MySQL 2020-06-05 21:02:24 -07:00
Austin Bonander
bddb2e560f
fix(macros): fix macros for Postgres 2020-06-05 20:28:21 -07:00
Austin Bonander
e3dbd58bf2 PgConnection: use more obvious/safer query for ping() 2020-06-05 20:13:20 -07:00
Ryan Leckey
0c80aa4f2c test: add a test to prove #363 works 2020-06-01 16:58:48 -07:00
Ryan Leckey
884b523d43 fix: tests/x.py doesn't need to worry about user permissions on windows 2020-06-01 05:23:31 -07:00
Ryan Leckey
e08f05b879
feat: re-introduce error downcasting 2020-05-30 17:51:56 -07:00
Ryan Leckey
e5b6047009
feat: introduce docker-compose based testing for running locally against many database combinations 2020-05-30 17:51:55 -07:00
Blaine Bublitz
28c639fd84 Seems like postgres needs tests like this 2020-05-20 20:33:03 -07:00
Blaine Bublitz
03ba5ca434 I think postgres needs this 2020-05-20 20:33:03 -07:00
Blaine Bublitz
2ffbe2f06e More copy-paste errors 2020-05-20 20:33:03 -07:00
Blaine Bublitz
84f4ab5799 Attempt to fix copy-paste errors 2020-05-20 20:33:03 -07:00
Blaine Bublitz
e5b6754ac6 fix failures 2020-05-20 20:33:03 -07:00
Blaine Bublitz
7283e690ff rustfmt 2020-05-20 20:33:03 -07:00
Blaine Bublitz
168ce9bed0 Attempt to add integration tests 2020-05-20 20:33:03 -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
30d13174ea mysql: Add JSON support 2020-04-19 15:58:47 -07:00
Austin Bonander
f00b7b48e1 add regression test for Map::fetch() being Unpin 2020-04-13 14:17:37 -07:00
xiaopengli89
d50405743b add integration tests mysql-types.rs/decimal 2020-04-10 15:35:58 -07:00
Ryan Leckey
52408f3cbf test(postgres): make test_enum_type more resilient 2020-04-10 14:22:18 -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
b3fd720aad test(sqlite): add failing test to illustrate #231 2020-04-08 01:28:30 -07:00
sid
012c186069 support rename attribute in FromRow macro 2020-04-07 14:49:34 -07:00
Ryan Leckey
4dc634f8b5 postgres: add a test to prove Type derive works for structs and fix the issue with it
fixes #219
2020-04-01 16:40:04 -07:00
sid
40f11ebb77 Process keyword fields correctly in FromRow macro
This PR fixes the the incorrect handling of keywords fields of a struct in the FromRow macro.
Currently a struct with a field like 'r#type' will try to read values from a column with the exact same name with r# prefix. With this change this field will now map to a database column with the correct name 'type' without the r# prefix.
2020-03-30 19:30:50 +05:30
Ryan Leckey
5fa11da353 use sqlx_test over connect fn in test 2020-03-29 14:40:02 -07:00
Ryan Leckey
c59d7aeebe macro tests: update for null inferrence 2020-03-29 01:33:12 -07:00
Austin Bonander
fb50968ec7 update schema in SQLite test DB 2020-03-28 17:50:27 -07:00
Austin Bonander
4b51c16cce MySQL: tweak macro test a bit 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
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
Ryan Leckey
2f80621279 Add query_as_unchecked! and query_file_as_unchecked! to use the macro system with unchecked input and output 2020-03-27 16:37:28 -07:00
Austin Bonander
e594a7fdca Postgres: don't cache failed statement 2020-03-27 15:54:28 -07:00
Ryan Leckey
3103d50be8 postgres: implement PgTypeInfo::with_name
- remove PgTypeInfo::with_oid
 - use a new PgRawBuffer type instead of Vec<u8> for encoding
2020-03-26 19:29:49 -07:00
Ryan Leckey
c6db69574b postgres: remove PgTypeInfo::type_name() 2020-03-26 19:16:54 -07:00
Austin Bonander
3436ede2d3 fix some remaining fallout from Result refactor 2020-03-25 22:33:03 -07:00
Ryan Leckey
2274b69556 postgres: support "CHAR" and OID 2020-03-25 04:46:17 -07:00
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
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
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
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
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
fc6e6a65f7 only run gated time tests if both time features are not present 2020-03-21 03:20:38 -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
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
Tom Dohrmann
b36bda1fc9 add test for fetch one messing up stream states 2020-03-20 21:05:25 +01:00
Ryan Leckey
f562e919b7 Merge branch '1d-array-pg-support' of https://github.com/oeb25/sqlx into oeb25-1d-array-pg-support 2020-03-20 10:11:02 -07:00
Ryan Leckey
50c3e5fefb
Merge pull request #138 from PoiScript/master
postgres: ipnetwork support
2020-03-20 09:54:43 -07:00
Tom Dohrmann
a944d99c1c support derives for sqlite 2020-03-20 10:21:15 +01:00
PoiScript
fb66cfa665 add ui tests for ipnetwork 2020-03-20 11:26:13 +08:00
PoiScript
9b6e1e089b add type test for ipnetwork 2020-03-20 11:10:58 +08:00
Ryan Leckey
9be1512833 mysql: use double literals in test 2020-03-18 23:16:56 -07:00
Ryan Leckey
1fc18460b0 transaction: document, test, and fix operation of nested transactions 2020-03-18 22:46:44 -07:00
Austin Bonander
33677e86a8 move PgNumeric[Sign], PgRecord[Encoder,Decoder] to hidden postgres::types::raw
fix errors
2020-03-18 19:36:54 -07:00
Austin Bonander
3a43e939e3 refactor PgNumeric so NaN can't be misinterpreted, document types 2020-03-18 19:06:14 -07:00
Ryan Leckey
63f5592ecf postgres: be explicit about an expression type for a test 2020-03-18 19:06:14 -07:00
Austin Bonander
94c40b3eb7 Postgres: implement numeric and BigDecimal support 2020-03-18 19:06:14 -07:00
Ryan Leckey
ebda944581 mysql: unwrap type infos 2020-03-17 22:02:20 -07:00
Ryan Leckey
d380f4b4a8 remove is_null_type and use Option<TypeInfo> 2020-03-17 21:43:41 -07:00
Ryan Leckey
1da6feac56 postgres: use inventory_item from fixture ( still need type name resolution for the test to work reliably ) 2020-03-17 21:33:51 -07:00
Ryan Leckey
a3f7029346 sqlite: assert what we get back from the db (it is a fixture) 2020-03-17 21:33:29 -07:00
Ryan Leckey
ec97dfb884 tweak fixtures to add more columns and add some initial for postgres/mysql 2020-03-17 21:32:57 -07:00
Austin Bonander
6cea7e2c1b macros: add proper test for sqlite using database file 2020-03-17 21:10:19 -07:00
Austin Bonander
8328e07c97 macros + sqlite: fix error for null-typed columns 2020-03-17 21:10:19 -07:00
Ryan Leckey
fb5db48c52 Don't test custom records until we have some kind of fixtures 2020-03-17 19:42:23 -07:00
Ryan Leckey
ff722d0e62 Run rustfmt 2020-03-17 19:35:01 -07:00
Ryan Leckey
d77b2b1e97 derives: update for new Decode/Encode traits and extensively test in usage 2020-03-17 19:26:59 -07:00
Ryan Leckey
4fc5e65f5d derives: update transparent 2020-03-17 03:24:08 -07:00
Ryan Leckey
602e61ab27 postgres: add support for decoding anonymous tuples and more fully test encoding/decoding records 2020-03-17 02:47:37 -07:00
Tom Dohrmann
a600b5b856 add tests for postgres struct field encoding 2020-03-16 22:58:31 -07:00
Tom Dohrmann
d3cb84b893 fix db type 2020-03-16 22:58:25 -07:00
Tom Dohrmann
c3aeb275c2 add derive macros for weak & strong enums and structs 2020-03-16 22:58:25 -07:00
Ryan Leckey
68d4a0d258 sqlite: produce connection specific errors
postgres, mysql: use derive for Debug for error types
2020-03-15 02:14:23 -07:00
Ryan Leckey
63ef32189d sqlite: implement support for multiple statements 2020-03-14 17:43:44 -07:00
Ryan Leckey
0130fe1479 sqlite: implement describe 2020-03-14 17:43:44 -07:00
Ryan Leckey
5f27026459 sqlite: implement remainder of query API 2020-03-14 17:43:44 -07:00
Ryan Leckey
a3799c3496 sqlite: implement command execution 2020-03-14 17:43:44 -07:00
Ryan Leckey
444ffff127 Run rustfmt 2020-03-14 17:43:44 -07:00
Ryan Leckey
1a48cf3b2c Reduce some duplication in type parsing 2020-03-14 17:43:44 -07:00
Ryan Leckey
7ab07016da sqlite: initial work in connection 2020-03-14 17:43:44 -07:00
Ryan Leckey
7a98253840 postgres: clean up protocol 2020-03-14 17:43:06 -07:00
Ryan Leckey
c7d416a1c3 Add Connection::begin 2020-03-14 17:43:06 -07:00
Austin Bonander
a9f0fca1b2 fix Postgres UI tests for 1.41 stable 2020-03-11 15:43:07 -07:00
Ryan Leckey
76431141e5 postgres: add type test for NULL 2020-03-11 03:34:23 -07:00
Ryan Leckey
a165615f53 row: Row::get panics, Row::try_get is fallible, Query::map panics, Query::try_map is fallible 2020-03-11 03:32:52 -07:00
Ryan Leckey
17f52a819b Fix doctests for macros 2020-03-11 02:01:48 -07:00
Ryan Leckey
c9df8acc41 Add zero-allocation to MySQL query execution
WIP mysql compiles with types and executor commented out
2020-03-11 01:47:29 -07:00
Ryan Leckey
672f83c00e use pin-project and fix impl of GuardedFlush 2020-03-11 01:47:29 -07:00
Austin Bonander
800af574c5 query_macros: allow Option<&str> to be passed in place of String
closes #93
2020-03-11 01:47:16 -07:00
Austin Bonander
4163388298 add nullability info to Describe
implement nullability check for Postgres as a query on pg_attribute

implement type name fetching for Postgres as part of `describe()`

add nullability for describe() to MySQL

improve errors with unknown result column type IDs in `query!()`

run cargo fmt and fix warnings

improve error when feature gates for chrono/uuid types is not turned on

workflows/rust: add step to UI-test missing optional features

improve error for unsupported/feature-gated input parameter types

fix `PgConnection::get_type_names()` for empty type IDs list

fix `tests::mysql::test_describe()` on MariaDB 10.4

copy-edit unsupported/feature-gated type errors in `query!()`

Postgres: fix SQL type of string array

closes #107
closes #17

Co-Authored-By: Anthony Dodd <Dodd.AnthonyJosiah@gmail.com>
2020-03-11 01:46:06 -07:00
Ryan Leckey
81bf390678 postgres: remove old commented out test 2020-03-11 01:44:41 -07:00
Ryan Leckey
f337f1c602 postgres: implement text mode for chrono and clean up type tests 2020-03-11 01:44:41 -07:00
Ryan Leckey
47f3d77e59 query_as: fully implement query_as, required a db-specific ext trait 2020-03-11 01:44:41 -07:00
Ryan Leckey
f18ab2fecb tweak type decoding in text mode for floats 2020-03-11 01:44:06 -07:00
Ryan Leckey
8e8cf6db20 postgres: fix various issues and add more tests 2020-03-11 01:44:06 -07:00
Ryan Leckey
433aab1e5b postgres: use RawValue in Decode and implement row-returning simple queries 2020-03-11 01:44:06 -07:00
Austin Bonander
0cb7bd1185 make macros work again 2020-03-11 01:43:27 -07:00
Ryan Leckey
7404708bab adjust Cursor::map to work through black magic hacks and hope we get GATs soon 2020-03-11 01:43:17 -07:00
Ryan Leckey
a374c18a18 postgres: rewrite protocol in more iterative and lazy fashion 2020-03-11 01:43:17 -07:00
Vlad Stepanov
2082ce15e5 [fix] move one use behind the cfg-flag, as it is used conditionally 2020-03-01 13:44:03 +03:00
Vlad Stepanov
a3160d2bae [fix] query usage in postgres ITs 2020-03-01 13:31:29 +03:00
Vlad Stepanov
0656c880cc cargo fmt 2020-03-01 13:23:57 +03:00
Vlad Stepanov
b2f50de16f review fixes: change test attributes, fix tests, add time encoding-decoding tests 2020-03-01 13:20:24 +03:00
Vlad Stepanov
1975486baa cargo fmt 2020-03-01 00:05:14 +03:00
Vlad Stepanov
084add9cdb #115: implement time-rs support 2020-02-29 22:38:48 +03:00
Oliver Bøving
0de4b5186b Add the array types to the query! macro
This still needs some work, as the inferance and error messages are not
quite where we want them to be
2020-02-25 21:56:07 +01:00
Oliver Bøving
c9c87b6081 Implement support for 1-dim arrays for PostgreSQL 2020-02-21 14:10:12 +01:00
Tim Harding
f0b276ea86 Added tests for trailing commas on query_file! and query_file_as! 2020-02-09 20:41:16 -08:00
timmythetiny
cefd377020 Fix #105, allow trailing commas in query macros 2020-02-08 16:14:50 -08:00
Ryan Leckey
7201f637bf Fix #104, need to advance buffer index to account for the null (one 32-bit length val of -1) 2020-02-01 00:33:59 -08:00
Austin Bonander
eff7c9e125
fix Pool to remove possibility of "leaking" connections (#84)
* fix `Pool` to reduce possibility of "leaking" connections

now uses RAII guards to control `SharedPool::size`

* add smoke test for `Pool` to both Postgres and MySQL tests

add `Pool::is_closed()`

* fix documentation re: pool

* refactor pool implementation to not use futures oneshot channels

https://github.com/launchbadge/sqlx/pull/84#issuecomment-580476223

* run cargo fmt

* Pool: remove superfluous guard struct, document some internal methods
2020-01-31 23:33:42 -08:00
Austin Bonander
2349978417 fix and test floats in MySQL 2020-01-30 12:17:32 -08:00
Austin Bonander
02075c74bd fix tests/mysql-macros.rs 2020-01-28 19:53:39 -08:00
Jane Lusby
ff731ce503 Enable raw ident support 2020-01-28 18:56:25 -08:00
Austin Bonander
f0c88da152
Merge pull request #71 from Freax13/master
add derives for Encode and Decode
2020-01-24 13:13:06 -08:00
Tom Dohrmann
1e9e816fab add proper encode/decode test 2020-01-24 18:36:04 +01:00
Austin Bonander
efed9b3d6d sqlx-macros: fix handling of invalid idents
add regression test with Trybuild

fix lint warnings as otherwise Trybuild wanted to include them
2020-01-21 01:52:57 -08:00
Tom Dohrmann
24007b143a fix tests for decode derive 2020-01-18 13:39:49 +01:00
Tom Dohrmann
bb933decb7 add derives for Encode and Decode 2020-01-18 13:30:16 +01:00
Ryan Leckey
60d45ac44b Fix (again) the handling of nulls in mysql and add an integration test for it 2020-01-18 01:20:26 -08:00
Ryan Leckey
d00c18ec75 Fix query! for the no results case in Postgres and MySQL 2020-01-18 00:43:59 -08:00
Ryan Leckey
3a2a34381f
Streamline CI to run build _then_ db checks (#68)
* Streamline CI to run build _then_ db checks

* Run rustfmt

* Test the sqlx-core manifest explicitly for unit tests

* Fix incorrect feature enabled in CI

* Make doctests conditional on runtime

* Clean up CI file a bit more

* Tweak CI file one more last time
2020-01-16 18:14:47 -08:00
Ryan Leckey
f1b37b9bc2 Add support for unsigned integers and binary in query! for mysql 2020-01-16 12:51:33 -08:00
Ryan Leckey
809bc3964c Run rustfmt 2020-01-15 01:34:20 -08:00
Ryan Leckey
92f12e11aa Add support for Tokio 2020-01-15 01:17:33 -08:00
Austin Bonander
0fdb875c20 support arbitrary numbers of bind parameters in query!() et al 2020-01-15 00:05:34 -08:00
Austin Bonander
da5c538d22 strip out proc-macro-hack 2020-01-15 00:05:09 -08:00
Ryan Leckey
306ed9752d Add i8, date, time, and datetime (chrono) in query! for MySQL and remove bool 2020-01-14 23:32:30 -08:00
Austin Bonander
638852a2dd implement TLS support for Postgres 2020-01-13 11:52:09 -08:00
Daniel Akhterov
db230e2ce0 Resolve Comments
- Remove `hex` from root `Cargo.toml`
    - Make `hmac` crate optional
    - Clean up checking mechanisms for "SCRAM-SHA-256"
    - Use `str::from_utf8` instead of `String::from_utf8_lossyf
    - Update `Sasl*Response` structs be tuple structs
    - Factor out `len` in `SaslInitialResponse.encode()`
    - Use `protocol_err` instead of `expect` when constructing `Hmacf
      instances
    - Remove `it_connects_to_database_user` test as it was too fragile
    - Move `sasl_auth` function into `postgres/connection` as it more
      related to `Connection` rather than `protocl`
    - Return an error when decoding base64 salt rather than panicing
      in `Authentication::SaslContinue`
2020-01-11 03:33:38 -08:00
Daniel Akhterov
507d988fc4 Implememnt SASL Authentication 2020-01-11 03:33:21 -08:00
Ryan Leckey
1350bfb822 Add test for issue #40 2020-01-11 01:00:13 -08:00
Ryan Leckey
92f3f8cf6f Finish reallocation strategy for BufStream
Fixes #30
2020-01-06 10:53:56 -08:00
Austin Bonander
43f1164823 fix macro examples and tests 2020-01-03 19:02:31 -08:00
Ryan Leckey
19e38ab8d3 [MySQL] [Postgres] Add support for BLOB and BYTEA types 2019-12-30 02:10:09 -08:00
Ryan Leckey
1d2240848b [Postgres] Add integration test for Chrono + Postgres 2019-12-30 02:10:09 -08:00
Ryan Leckey
2a42ff9f0d [MySQL] Add an integration tests for chrono + MySQL and fix issues 2019-12-30 02:10:09 -08:00
Ryan Leckey
5e719917c0 Run rustfmt 2019-12-28 03:45:47 -08:00
Austin Bonander
2c424b6d63 allow slices to be passed to query!()
capture args by ref
2019-12-27 23:30:06 -08:00
Ryan Leckey
9b0f34b0ce Fix a couple minor nits with Pool and run rustfmt 2019-12-27 22:47:25 -08:00
Austin Bonander
7d745f98ea implement query_as!() et al, document query macros 2019-12-27 21:45:31 -08:00
Ryan Leckey
56a82346f2 Run cargo fmt 2019-12-27 20:44:03 -08:00
Ryan Leckey
d76b1357da Audit MySql and Postgres protocols 2019-12-27 17:31:01 -08:00
Austin Bonander
56875a8931 finish discussed refactors 2019-12-18 23:02:01 -08:00
Austin Bonander
8aa931356f WIP implement statement caching for MySQL, perform discussed refactors 2019-12-18 23:02:01 -08:00
Austin Bonander
d8d93867b7 implement prepared statement caching for postgres 2019-12-18 23:02:01 -08:00
Austin Bonander
6e2e3bcb49 use dotenv in integration tests 2019-12-11 19:59:23 -08:00