Commit graph

992 commits

Author SHA1 Message Date
Eamon Caton
b391d4878e Revert webpki version bump to keep compatability with tokio-rustls feature 2021-05-22 11:03:01 -07:00
Ryan Leckey
13f7c7124a release: v0.5.3 2021-05-21 17:27:15 -07:00
Ryan Leckey
2d38332137 fix: bring back accidentally removed methods on the Migrate trait as deprecated 2021-05-21 17:16:22 -07:00
Nathan Roach
db09cb61e5 Adding Any support for Local chrono datetime for MySQL 2021-05-21 16:46:41 -07:00
Guy Lapid
18acba2358 Added any types for binary blobs and chrono NaiveDateTime 2021-05-21 16:46:26 -07:00
Rafael Epplée
0acb0e5eff
Add docs for rename_all attribute for Type derive macro (#1212)
* add missing closing bracket in doctest

* document rename_all attribute for Type derive
2021-05-21 16:12:16 -07:00
Austin Bonander
8f1d8c7e2f
more pool fixes (#1211)
* a task that is marked woken but didn't actually wake before being cancelled will instead wake the next task in the queue

* a task that wakes but doesn't get a connection will put itself back in the queue instead of waiting until it times out with no way to be woken

* the idle reaper now won't run if there are tasks waiting for a connection, and also uses
the proper `SharedPool::release()` to return validated connections to the pool so waiting tasks get woken

closes #622, #1210

(hopefully for good this time)

Signed-off-by: Austin Bonander <austin@launchbadge.com>
2021-05-17 19:24:40 -07:00
Feike Steenbergen
78a94240e6
Skip empty and commented pgpass entries (#1216)
While running an application a lot of warnings were printed about my
pgpass file, like:

	Malformed line in pgpass file

This was due to the fact that my pgpass file contains whitespace and
comments to organize it in a better way.

This commit ensures we will ignore empty lines and lines that (barring
whitespace) start with a comment. This is in line with how PostgreSQL
treats these entries in the pgpass file:

- https://www.postgresql.org/docs/current/libpq-pgpass.html
- function passwordFromFile in src/interfaces/libpq/fe-connect.c
2021-05-10 16:18:13 -07:00
link2xt
405474b575
sqlite: add SqliteConnectOptions::shared_cache() (#1177)
This makes it possible to open database in shared cache mode without
having to construct `sqlite://` URL with `?cache=shared` flag.
2021-04-27 18:35:45 -07:00
Josh Triplett
b5928f6e7f Export SqliteAutoVacuum so it can be used 2021-04-27 12:35:58 -07:00
Josh Triplett
d4a7217a56 Support setting sqlite page_size
The page size setting only takes effect if set before doing anything
else to the database.
2021-04-27 12:35:23 -07:00
link2xt
fda55fe3b3 sqlite: export SqliteLockingMode
This makes it possible to `use sqlx::sqlite::SqliteLockingMode`.
2021-04-16 18:25:07 -07:00
Ryan Leckey
f7775f7fde release: 0.5.2 2021-04-15 18:40:46 -07:00
Jonas Platte
73d35e73a6 Remove Self: Type bounds in Encode / Decode implementations 2021-04-15 18:27:13 -07:00
Jonas Platte
81ae756e86 Fix warnings 2021-04-15 18:27:13 -07:00
Ryan Leckey
9e8e334697
chore: add std_rng to rand 2021-04-09 15:48:19 -07:00
Ryan Leckey
633a662752 chore: update dependencies 2021-04-09 00:31:07 -07:00
Alexander Krotov
78656eb469 fix(sqlite): reset the statement when fetch_many() stream is dropped
Unlike `Executor.fetch_optional()`, `Executor.fetch_many()` does not
have a single exit.  The stream can be dropped at any time.  To catch
this event, we create a `StatementResetter` structure inside the stream
loop and reset the statement when it is dropped.

A test case `it_resets_prepared_statement_after_fetch_many` is
similar to `it_resets_prepared_statement_after_fetch_one` which tests
`Executor.fetch_optional()`.
2021-04-09 00:23:17 -07:00
link2xt
5cf1af2d19 fix(sqlite): do not ignore API misuse errors from sqlite3_finalize 2021-04-09 00:21:52 -07:00
link2xt
f488f53916 fix(sqlite): do not cast pointers to i32
64-bit pointers can't be casted to i32 correctly.

It does not seem to cause problems on amd64 as long as both pointers
reside in the same page, but it's not correct generally.
2021-04-09 00:21:12 -07:00
argv-minus-one
2123d9de2e Make the bounds on Connection::transaction less strict.
The provided callback doesn't need to be `'static`. It should be enough that it doesn't borrow anything from the `Connection` itself, even if it does borrow data from elsewhere.
2021-04-09 00:13:51 -07:00
Ryan Leckey
fd828fed14 Merge remote-tracking branch 'demurgos/domain-type-description' 2021-04-08 23:59:25 -07:00
Diggory Blake
a3b73f8e08 Remove all listeners before returning a connection to the pool 2021-04-08 23:54:10 -07:00
Diggory Blake
01bef75cb9 Fix bug when a read on a BufStream is cancelled. 2021-04-08 23:53:45 -07:00
Josh Triplett
c96bcd9f6b Support the sqlite auto_vacuum pragma 2021-04-08 23:52:34 -07:00
Josh Triplett
62e58f5b1c Support the sqlite locking_mode pragma
This allows applications that never use a sqlite database concurrently
to avoid using shared memory for the write-ahead log.
2021-04-08 23:52:34 -07:00
Evgeny Nosov
e4dd1c3a1d Ignore reversing migrations in migrate! macro 2021-04-08 23:50:39 -07:00
Evgeny Nosov
8b866bb23d Fix migrate! macro 2021-04-08 23:50:39 -07:00
Evgeny Nosov
85ff651ba1 Add ignore_missing parameter 2021-04-08 23:50:39 -07:00
Evgeny Nosov
8950332ca3 Rewrite migration algorithm in order to apply also unapplied migrations 2021-04-08 23:50:39 -07:00
Tom Dohrmann
7463cdaf45 rename test to tests
Co-authored-by: Jonas Platte <jplatte@users.noreply.github.com>
2021-04-08 23:47:35 -07:00
Tom Dohrmann
47253d5d20 move pgpass functions into seperate submodule 2021-04-08 23:47:35 -07:00
Tom Dohrmann
88ee528f24 prefer PGPASSFILE over default paths 2021-04-08 23:47:35 -07:00
Tom Dohrmann
ea7cc78445 move tests into submodule 2021-04-08 23:47:35 -07:00
Tom Dohrmann
4c28cd5c50 fix test 2021-04-08 23:47:35 -07:00
Tom Dohrmann
ac4a9c3c1d run cargo fmt 2021-04-08 23:47:35 -07:00
Tom Dohrmann
9ccf030248 add support for pgpass files 2021-04-08 23:47:35 -07:00
Austin Bonander
5295ff10a5 fix: pool internals improvements
* fix `DecrementSizeGuard::drop()` only waking one `Waiter` regardless of whether that waiter was already woken
* fix connect-backoff loop giving up the size guard
* don't cut in line to open a new connection
* have tasks waiting on `acquire()` wake periodically to check if there's a connection in the queue

Signed-off-by: Austin Bonander <austin@launchbadge.com>
2021-04-06 09:04:20 -07:00
crajcan
469c4ac130
Correct Postgres' Length Limit for Bind Parameters (#1141)
* Bump limit for postgres' bind parameters

* Fix lingering fmt error
2021-03-29 19:39:27 -07:00
Charles Samborski
93b90be9f7 fix(postgres): Add support for domain types description
Fix commit updates the `postgres::connection::describe` module to add full support for domain types. Domain types were previously confused with their category which caused invalid oid resolution.

Fixes launchbadge/sqlx#110
2021-03-16 20:23:03 +01:00
Rich Murphey
edcc91c9f2
replace deprecated compare_and_swap() with compare_exchange() (#1080) 2021-03-03 08:50:12 -08:00
Nathan Roach
d5f9f08c62 Fixing NaiveTime not including SQLite 2021-02-27 01:24:25 -08:00
Nathan Roach
4b5f41eebe Fixing format, removing duplicate NaiveDate 2021-02-27 01:24:25 -08:00
Nathan Roach
9d6c5defd4 Adding derivation of any types for chrono types present in all of the featured sql types at compile time 2021-02-27 01:24:25 -08:00
Jonas Platte
e8f4eebdbe Make re-exports from other crates show up as such
… in `types` and sub-modules.
2021-02-27 01:22:22 -08:00
mareq
111265b5ab doc: Add information on the required structure of the migration scripts 2021-02-27 01:06:17 -08:00
Austin Bonander
0ed524d65c fix(pool): always ping connection on release to see if it's still viable
Signed-off-by: Austin Bonander <austin@launchbadge.com>
2021-02-27 00:56:08 -08:00
Austin Bonander
1a9e0d9a52 ban Ord::{min, max} with Clippy as it's too easy to misread
It is *much* too easy to misread `x.min(y)` as "`x` should be *at least* `y`" when in fact it means the *exact* opposite, and same with `x.max(y)`. This has bitten us in the gluteus maximus a number of times both in SQLx and in private projects.

Signed-off-by: Austin Bonander <austin@launchbadge.com>
2021-02-05 13:30:35 -08:00
Ryan Leckey
cbe820760f
release: 0.5.1 2021-02-04 09:16:11 -08:00
Ryan Leckey
efccd6c9b8
chore: update sqlx-rt to 0.3 2021-02-04 09:15:00 -08:00
Ryan Leckey
94d0baeb52
release: 0.5 2021-02-04 06:32:50 -08:00
Ryan Leckey
2fd26b5504
sqlite: remove support for u64
see https://github.com/launchbadge/sqlx/pull/919#discussion_r557106441
2021-02-04 06:17:17 -08:00
wuaoxiang
31abe22e34 fix(sqlite): GROUP BY in query! cause infinite loop at compile time 2021-01-31 16:58:48 -08:00
Jonas Platte
6fea00304e Remove any::AnyType
It was not actually used in a meaningful way.
2021-01-31 16:56:37 -08:00
Jonas Platte
1b217cfac4 Make impl Acquire for &'_ Pool<DB> more general 2021-01-31 16:54:22 -08:00
Jonas Platte
77238108cf Require Acquire::Connection to be Send 2021-01-31 16:54:22 -08:00
Ryan Leckey
df393128f8
style: rustfmt 2021-01-20 22:29:05 -08:00
Austin Bonander
89305873b0
fix(postgres): patch nullable inference in Postgres using EXPLAIN
BREAKING CHANGE: some columns in `query!()` et. al. output will change from `T` to `Option<T>`

breakage should be minimal in practice as
these columns will need to have been manually
overridden anyway to avoid runtime errors

Signed-off-by: Austin Bonander <austin@launchbadge.com>
2021-01-20 22:27:44 -08:00
Austin Bonander
5e452d9e86
fix(sqlite): remove errant println!() in sqlite/explain.rs 2021-01-20 22:26:43 -08:00
Austin Bonander
7c32928ebc
feat(macros): implement query_scalar!() and variants
Signed-off-by: Austin Bonander <austin@launchbadge.com>
2021-01-20 22:23:04 -08:00
Ryan Leckey
b0c430ed18
feat(sqlite): track nullable through left joins 2021-01-20 22:22:26 -08:00
Sho Nakatani
0c0dd6936a feat: Adds Debug, Clone auto-derive to SqliteArguments 2021-01-20 22:15:48 -08:00
William Hammond
25858fc42a Improves error handling in the case of missing type 2021-01-20 22:10:03 -08:00
Ryan Leckey
e03c31adcd
Merge branch 'feature/inline-certificates' of https://github.com/alex-berger/sqlx into alex-berger-feature/inline-certificates 2021-01-20 22:08:26 -08:00
Florian Hübsch
68cf2f9cdb Add constraint method to DatabaseError trait
Override `constraint` method for `PgDatabaseError`.
2021-01-20 22:00:44 -08:00
Ryan Leckey
d5e0f1b92b
refactor: rename DbOutcome to DbQueryResult 2021-01-20 21:57:26 -08:00
Jonas Platte
c5d43db312
Upgrade async runtime dependencies
Co-authored-by: Josh Toft <joshtoft@gmail.com>
Co-authored-by: Philip A Reimer <antreimer@gmail.com>
2021-01-20 21:50:45 -08:00
Ryan Leckey
de4a7decfb
fix(sqlite): i64 -> u64 in type docs 2021-01-20 21:50:45 -08:00
dignifiedquire
1d87b6cc8d
feat: implement unsigned int support for sqlite 2021-01-20 21:50:45 -08:00
Takeru Ohta
a6aef7817b
fix to read just 20 bytes for AuthSwitchRequest data 2021-01-20 21:50:44 -08:00
Jonas Platte
08a76f45ae
Rename DbDone to DbOutcome 2021-01-12 14:45:01 +01:00
Jonas Platte
a1d562f04b
Remove the Done trait 2021-01-12 14:37:44 +01:00
Jonas Platte
e2f7aa2eca Restore support for sqlx(rename) on types, with a deprecation warning 2021-01-12 03:39:10 -08:00
Jonas Platte
fd8b2b7f8a Rename sqlx(rename) attribute to sqlx(type_name) 2021-01-12 03:39:10 -08:00
Jonas Platte
74835bfe58
Allow chaining map / try_map on queries
To support `.map()` / `.try_map()` on `query!()` (and `query_as!()`).
2021-01-05 23:50:27 -08:00
Jonas Platte
9eca6413fe
Remove TryMapRow and MapRow
These traits were a workaround for a bug in rustc that an earlier
revision of the API triggered, but the API has since been changed.
2021-01-05 23:50:23 -08:00
Chloe Ross
2890d154a3 doc: use the fancy new intra-crate doc links everywhere 2021-01-04 18:39:03 -08:00
Austin Bonander
ef6c73c985 doc: add tables describing the right method to call on query!() et al
Signed-off-by: Austin Bonander <austin@launchbadge.com>
2021-01-04 12:03:42 -08:00
up9cloud
e7eaed6220 remove unnecessary Fut 2021-01-04 09:31:47 -08:00
Austin Bonander
93ba3d59e7 fix(logging): make query logging obey level setting for sqlx::query target
Signed-off-by: Austin Bonander <austin@launchbadge.com>
2020-12-29 15:28:06 -08:00
Kirill Bulatov
24c85d20d6 Add a way to disable query logging programmatically 2020-12-29 11:30:34 -08:00
Jakob Truelsen
9146929575 Do not attempt to reconnect on every Io error.
Io errors can describe a lot of things, when connecting to a database in general only
ECONNREFUSED can be hoped to be resolved by waiting. Other errors will require
user intervention
2020-12-25 19:36:54 -08:00
Jakob Truelsen
46f9f44d41 Do not call connect it a bussy loop on connection refused.
If the connection to the database is refused, it is not helpfull to hammer it with connection
attempts, instead we should wait a bit before connecting again. Here we start waiting 10ms,
doubling the wait time for every attempt before setteling out at 2s
2020-12-25 19:36:54 -08:00
Brandon
b8839c6d90 Convert to intra-crate links 2020-12-23 18:49:39 -08:00
Brandon
cbc1deb363 Fix broken link in Transaction docs 2020-12-23 18:49:39 -08:00
Jakob Truelsen
c7cf104a8f Handle dropping wait_for_conn
If wait_for_conn is dropped before completing, release will call
wake on a waker that noone is listining on. This leads to a state where
waiting will gro indefinitly while all connections are idle.

To fix this we turn waiting into a queue of unique Weak pointers.
This way if wait_for_conn is dropped the pointer in waiting cannot
be upgraded, we can use this as a signal that we shoud wake the
next one instead.
2020-12-22 20:13:40 -08:00
Ryan Leckey
565d0a91a3
release: v0.4.2 2020-12-19 01:07:50 -08:00
Ryan Leckey
2d3b9e4909
fix: rollback (another) update to rustls 2020-12-19 00:37:45 -08:00
Ryan Leckey
7bbf89c301
fix: rollback a couple package updates (forgot to check tokio) 2020-12-19 00:34:10 -08:00
Ryan Leckey
c410f88bcd
chore: update several dependencies 2020-12-19 00:26:06 -08:00
Ryan Leckey
e9e1dcf78e
style: rustfmt 2020-12-19 00:08:29 -08:00
Ryan Leckey
00d3211f03
add runtime-async-std-native-tls to docs.rs feature in sqlx-core 2020-12-18 23:30:29 -08:00
Ryan Leckey
405553cc43
Merge branch 'slumber-another-fix-for-decimals' of https://github.com/slumber/sqlx into slumber-slumber-another-fix-for-decimals 2020-12-18 23:23:06 -08:00
Mike Cronce
376ea3f596 sqlx-core/src/mysql/types/str.rs: + COLLATE_UTF8MB4_GENERAL_CI 2020-12-19 07:17:28 +00:00
Hamza
d1417dc2ec Ensure tests pass 2020-12-19 07:17:12 +00:00
Hamza
8a55ae2d32 Fix transaction wrapper 2020-12-19 07:17:12 +00:00
Federico Rampazzo
b9e57de005 Rename mixedCase to camelCase, CamelCase to PascalCase, aligning with serde 2020-12-19 07:14:09 +00:00
Federico Rampazzo
aa0adaa434 Updated rename-all docs 2020-12-19 07:14:09 +00:00
Marcin Kaźmierczak
e584618041 sqlite synchronous setting 2020-12-19 06:03:50 +00:00
Ryan Leckey
4ee1727ba6
fix: tweak bstr and git2 Encode impls 2020-12-18 21:56:29 -08:00
Eric Semeniuc
389f9b5f41
fix macro 2020-12-18 21:33:52 -08:00
Eric Semeniuc
7cc0ecb981
Add cfg sqlite condition 2020-12-18 21:33:52 -08:00
Eric Semeniuc
c64b9bee45
Address pr feedback 2020-12-18 21:33:51 -08:00
Eric Semeniuc
892bbc95a9
add new example for migration 2020-12-18 21:33:51 -08:00
Ryan Leckey
187b7481e9
fix(sqlite): implement Encode on Uuid and Hyphenated not references to them 2020-12-18 21:33:50 -08:00
James Tomlinson
7c8822ae5e
Fix formatting (cargo fmt) 2020-12-18 21:33:30 -08:00
James Tomlinson
40011f66df
Uuid support for Sqlite.
Includes the same support for the Hyphenated adapter as the MySQL
Uuid support.
2020-12-18 21:33:30 -08:00
Andrew Whitehead
a445f9f431
manually close connections in SharedPool::close 2020-12-18 21:33:11 -08:00
Andrew Whitehead
f39d194b17
decrement pool size when connection is released 2020-12-18 21:33:11 -08:00
Chris Sosnin
4c1cf86380
sqlite: fix memory leak 2020-12-18 21:33:11 -08:00
Fangdun Cai
169fb298ef
fix: whoami crash on FreeBSD aarch platform 2020-12-18 21:33:11 -08:00
chertov
6f793271c4
Replace lru-cache with hashlink 2020-12-18 21:33:09 -08:00
Marcin Kaźmierczak
9ad0c71253
fix clipyy warnings 2020-12-18 21:32:08 -08:00
sid
0921df44c1
reversible migrations for cli
- adds a -r flag whihc will create a reversible migration
- add revert subcommand, which reverts the last migration
- add --dry-run flag to migration run command, which list the migrations that will be applied
- updates add migration to check if all migration are of same type, i.e cannot mix and match reversible and simple migrations
2020-12-18 21:32:08 -08:00
Marcin Kaźmierczak
e798409e20
fix fetch_optional for sqlite 2020-12-18 21:32:08 -08:00
Chris Sosnin
9747218ad3 postgres: fix decimal conversions 2020-12-10 22:22:33 +03:00
Chris Sosnin
82b66b29a3 Revert "Fixing BigDecimal conversion for PostgreSQL"
This reverts commit a0007b4e98.
2020-12-10 22:02:01 +03:00
chertov
04647ae09a Replace lru-cache with hashlink 2020-12-02 18:41:49 -08:00
alex.berger@nexiot.ch
8379728d6e fix formatting 2020-11-27 17:58:05 +01:00
alex.berger@nexiot.ch
6ecdb83bc2 Add support for passing in-memory trusted certificates in addition to the already supported path to trusted certificates. 2020-11-27 17:43:24 +01:00
Marcin Kaźmierczak
7f1bff406d fix clipyy warnings 2020-11-24 16:15:22 -08:00
sid
f41551f3ad reversible migrations for cli
- adds a -r flag whihc will create a reversible migration
- add revert subcommand, which reverts the last migration
- add --dry-run flag to migration run command, which list the migrations that will be applied
- updates add migration to check if all migration are of same type, i.e cannot mix and match reversible and simple migrations
2020-11-24 16:04:43 -08:00
Marcin Kaźmierczak
70fa667063 fix fetch_optional for sqlite 2020-11-24 16:01:52 -08:00
Josh Triplett
71a72e7c67 Add support for git2::Oid (under the git2 feature flag)
This allows queries to convert between Oid and SQL data types.
2020-11-21 14:32:29 -08:00
Josh Triplett
47b0973bdb Add support for bstr::BString (under the bstr feature flag)
This allows queries to convert between BString and SQL data types.
2020-11-21 14:03:11 -08:00
Jonas Platte
c1e79d2675 Simplify pattern matching in postgres/type_info.rs 2020-11-19 14:04:07 -08:00
Jonas Platte
3c7c266eac Fix some clippy lints 2020-11-19 14:04:07 -08:00
Ryan Leckey
0b03dc6762 prepare v0.4.0 2020-11-12 07:46:13 -08:00
Ryan Leckey
f22a3f5a5d remove default runtime, you must now always select a runtime 2020-11-12 07:42:31 -08:00
Jonas Platte
1ed75ba5f0 Support accept_invalid_certs & accept_invalid_hostnames with rustls
Co-authored-by: BlackHoleFox <blackholefoxdev@gmail.com>
2020-11-12 07:32:59 -08:00
Jonas Platte
b14266ba2e Add rustls support 2020-11-12 07:32:59 -08:00
Jonas Platte
9298c88b87 Refactor TLS code to be a bit easier to read 2020-11-12 07:32:21 -08:00
Jonas Platte
cd44b5eb43 De-duplicate mysql & postgres TLS code 2020-11-12 07:32:21 -08:00
Jonas Platte
a161bcba05 Rename cargo features in preparation for rustls support 2020-11-12 07:32:21 -08:00
Ryan Leckey
b8bce0a541 Merge branch 'mysql-non-ascii-credentials' of https://github.com/yerke/sqlx into yerke-mysql-non-ascii-credentials 2020-11-12 07:21:10 -08:00
Austin Bonander
cebfcce1b5 docs: WIP improve docs about Pool
Signed-off-by: Austin Bonander <austin@launchbadge.com>
2020-11-12 07:15:08 -08:00
Jakob Truelsen
9d71a7f372 Allow configuring the log level of query logging 2020-11-12 07:06:34 -08:00
David Yamnitsky
12b4250454 support sqlite bind parameters of the form $NNN 2020-11-06 15:08:08 -08:00
Yerkebulan Tulibergenov
b2ee575e4f Merge branch 'master' into mysql-non-ascii-credentials 2020-11-04 22:50:03 -08:00
Julius de Bruijn
a0007b4e98 Fixing BigDecimal conversion for PostgreSQL
Now working properly with numbers, such as `0.01` and `0.012`.
2020-11-04 17:09:01 -08:00
Julius de Bruijn
25e72925fa Update to bigdecimal 0.2 and num-bigint 0.3 2020-11-04 17:09:01 -08:00
Marcin Kaźmierczak
1d9ab5245c use futures_channel::oneshot in sqlite worker 2020-11-03 22:51:42 -08:00
Jonas Platte
85b5ab0fb3 Fix cfg-specific unused lints 2020-10-29 22:21:27 -07:00
Austin Bonander
e44031676f doc: improve docs for Type and FromRow derives 2020-10-29 18:33:14 -07:00
dignifiedquire
eae3f46237 update libsqlite3-sys to 0.20 2020-10-26 01:34:28 -07:00
Peter Maatman
fae72200e5 sqlite: Add basic json implementation
Fixes #608
2020-10-20 20:08:20 -07:00
Daniel Stöckel
144dcceb44 fix(postgres): prefer parsing non-localized notice severity field
In order to support PostgreSQL <= 9.5, the b'S' field of an error/notice
message was parsed. However, this field can be localized and thus parsing
can fail for instances that use a non-english locale. In version > 9.5,
the b'V' field, that is guaranteed to be in english, was added. However,
even for these versions parsing would fail as the b'S' field was also
parsed. This patch prefers b'V' over b'S' if it exists and uses a default
severity in case b'V' is not present and b'S' could not be parsed.

Fixes #734
2020-10-19 00:03:06 -07:00
Dana Marcuse
d97014f620 feat: correctly handle percent-encoded socket as host for postgres URI 2020-10-18 01:19:11 -07:00
Dana Marcuse
7b1b8c12ba feat: handle hostaddr postgres URI param and add more tests 2020-10-18 01:19:11 -07:00
Joshua Nelson
591d33b877 Enable all features for sqlx-core on docs.rs 2020-10-17 02:44:53 -07:00
Joshua Nelson
20d65a8248 Remove hashbrown dependency
Hashbrown is now the hashmap used in the standard library, so no need to
pull in an external dependency. This switches to using `AHashMap`
directly.
2020-10-17 02:44:09 -07:00
Rodrigo Araujo
d69d897eab Remove last line 2020-10-16 17:31:30 -07:00
Rodrigo Araujo
ce4b8caaa2 Format code 2020-10-16 17:31:30 -07:00
Rodrigo Araujo
f808a81f6c TiDB compatibility: Add support to utf8mb4_bin collation 2020-10-16 17:31:30 -07:00
Jonas Platte
e1662e42e1 Fix unused variable warnings in migrate.rs with feature = "mssql" 2020-10-16 14:49:27 -07:00
Gevorg Hindoyan
5835bc4951 Fix NaiveDate parse_from_str argument order
The [documentation](https://docs.rs/chrono/0.4.13/chrono/naive/struct.NaiveDate.html#method.parse_from_str) specifies that `NaiveDate::parse_from_str` takes two arguments: value and format, in respective order. 

Due to this, `DATE` fields could not be read into `NaiveDate`... and I have ptsd.
2020-10-16 14:40:50 -07:00
Mike Cronce
fd25a7530c sqlx-core/src/mysql/protocol/statement/execute.rs: Execute::encode_with(): Encode a 1 for iteration-count instead of 0 2020-10-15 22:51:08 -07:00
Austin Bonander
fa7981f68a fix(pool): ignore spurious wakeups when waiting for a connection
fixes #622
2020-10-13 10:37:10 -07:00
Julius de Bruijn
7a70717944 Use flags to detect MySQL enums
In some cases the returned value is of `ColumnType::String`, but it has
the `ENUM` flag set.
2020-10-13 10:09:06 -07:00
Jonas Platte
1935e91e7a Bump base64 version 2020-10-13 10:04:05 -07:00
Jonas Platte
63bfab90c5 Bump hmac version 2020-10-13 10:04:05 -07:00
Jonas Platte
f155bb83e8 Bump hashbrown version 2020-10-13 10:04:05 -07:00
Joshua Nelson
920168a129 Add examples to after_connect documentation
This requires testing with `--features postgres`.
2020-10-13 10:02:24 -07:00
Joshua Nelson
2be4601150 Add size() and num_idle() 2020-10-13 09:57:56 -07:00
Kramer Hampton
d0ccb4d0b2 feat: parse additional parameters: user, password, port, dbname. Also
add additional documentation and an example connection string using
parameters.
2020-10-13 09:56:48 -07:00
Wesley Norris
727ebf0b38 Percent decode MySQL passwords from URL string
Fixes #603.
Adds percent decoding for MySQL passwords for when they contain non-URL
safe passwords, along with a regression test to prevent further
instances of this issue.
2020-10-13 09:55:40 -07:00
Patryk Wychowaniec
ca07158949 sqlite: Fix #616 2020-10-13 09:54:50 -07:00
Jonas Platte
3b9c98d979 Fix bounds for F on query::Map
Query::map was not usable before.
2020-10-13 09:50:34 -07:00
Jonas Platte
4ad4a42edd Make Send a supertrait of TryMapRow, MapRow
Map<'q, DB, F, A> where F: !Send was useless and these traits are only
used as part of Map. This might improve error messages.
2020-10-13 09:50:34 -07:00
Chris Couzens
8e4d061dc1 Correct PgConnectOptions to MySql in mysql docs
I'm using this library for the first time, and I noticed this small oversight in the docs.
2020-10-07 05:24:03 -07:00
David Yamnitsky
44594e2e03 impl From for AnyConnectOptions 2020-09-09 01:18:28 -07:00
Mike Cronce
1acd782e7f sqlx-core/src/mysql/types/str.rs: cargo fmt 2020-09-02 22:53:13 -07:00
Mike Cronce
d8142a8fa3 sqlx-core/src/mysql/types/str.rs: str::compatible(): Added support for charset number 33 (utf8 COLLATE utf8_general_ci) 2020-09-02 22:53:13 -07:00
Andrew Whitehead
9cd9209aa3 add support for pooling in-memory sqlite DB, enabling shared cache 2020-09-02 22:51:03 -07:00
Yerkebulan Tulibergenov
b48e008ef8 Support non-ASCII chars in mssql credentials 2020-08-23 16:48:59 -07:00
Yerkebulan Tulibergenov
500d4a5b2a Support non-ASCII chars in mysql credentials 2020-08-23 16:34:50 -07:00
Ryan Leckey
67099d993c Merge remote-tracking branch 'frigus02/pg-percent-decode' into master 2020-08-19 18:03:31 -07:00
Stuart Hinson
1ab815cc9b WIP pg application_name 2020-08-19 17:56:51 -07:00
Yusuke Tanaka
3076a2dc09 Fix typo 2020-08-17 20:39:52 -07:00
Jan Kuehle
106a6a8395
Support non-ASCII chars in postgres credentials
The `url` crate returns username and password portions of a URL as
percent encoded ASCII strings. In order to use them for the Postgres
connection, we need to decode them.
2020-08-13 15:50:07 +01:00
Julius de Bruijn
ae2e5db4b2 SQLite: Allow setting busy_timeout in options 2020-08-04 19:16:31 -07:00
Chloe Ross
1949445cf0 other: don't deadname self 2020-07-31 04:14:48 -07:00
Chloe Ross
3885ae6ddf fix: allow queries that select just void to pass through macros as () instead of struct { _1: () } 2020-07-31 04:14:48 -07:00
Jannik Obermann
67142259e4 Fix #580 + Add test 2020-07-31 04:14:32 -07:00
吴翱翔
96f4a43bb8 style: rustfmt 2020-07-29 07:39:31 -07:00
吴翱翔
c6fa9047b9 Remove rust_decimal unnecessary num-traits 2020-07-29 07:39:31 -07:00
Martin Tomasi
002929ed2e Added missing target for query logger 2020-07-29 07:37:58 -07:00
Jonas Platte
960e71202b Don't include postgres OIDs in query cache 2020-07-29 07:28:14 -07:00
foldu
bd1d9f45f3 Fix create_if_missing docs 2020-07-27 04:03:30 -07:00
Julius de Bruijn
0ed8e3f610 Add missing compatible implementation for Vec<BitVec> 2020-07-27 03:36:44 -07:00
Julius de Bruijn
1a59d3308a Pg: Implementing BIT and VARBIT using BitVec 2020-07-27 03:36:44 -07:00
Ryan Leckey
22f1f93b79 chore: prepare sqlx v0.4.0-beta.1 and sqlx-cli v0.1.0-beta.1 2020-07-27 01:43:02 -07:00
Ryan Leckey
7bc3133f70 feat: add an optional query logger (using log) 2020-07-26 23:55:36 -07:00
Ryan Leckey
3d7ac03e52 style: rustfmt 2020-07-26 22:30:45 -07:00
Ryan Leckey
4fec7db789 test(mysql, uuid): add some tests to prove UUIDs work in MySQL 2020-07-26 22:30:32 -07:00
Kaleb Elwert
e0ace861c5
Allow MigrationSource to be implemented externally (#511) 2020-07-26 20:23:44 -07:00
Joshua Koudys
05ffcb312d
Uuid support for MySQL (#536)
* feat: uuid decoder for mysql, patterned on postgres

* feat: Add uuid on mysql encoding

* fix: encode after converting to bytes

* fix: use the byte decoder on uuids

* fix: remove unused import

* feat: Adds mysql encoding/decoding support for Hyphenated uuid

* fix: uncommented feature flag line

* fix: unresolved import

* fix: use sqlx string type for binary uuid

Co-authored-by: Ian Hume <Humeian@me.com>
2020-07-26 19:45:06 -07:00
Ryan Leckey
ec0e84d8ac feat(mysql): support reading and writing BIT via unsigned integers
e.g., BIT(64) is u64 and BIT(2) is u8
2020-07-26 19:42:32 -07:00
Ryan Leckey
7b132d1dbc refactor(mysql): store max_size in MySqlTypeInfo – prepare for an eventual future where emit bool for TINYINT(1) 2020-07-26 19:37:58 -07:00
Ryan Leckey
c454e1ea35 style: remove unused import 2020-07-26 18:05:55 -07:00