Commit graph

1865 commits

Author SHA1 Message Date
Ryan Leckey
f7d3617e1b update CHANGELOG for 0.5.3 2021-05-21 17:22:50 -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
Siddhant
012478d8b7 Added support for PgMoney type in sqlx macros 2021-05-21 16:48:33 -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
Kitsu
be88631b5e Remove redundant args default notice 2021-04-27 12:35:46 -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
Stephen W
212d235334
Try to make 'no queries found' message more clear (#1191)
* try to make 'no queries found' message more clear

* Be more polite
2021-04-26 00:40:33 -07:00
jtroo
5a8418e5fd
Fix query! documentation of .execute (#1179) 2021-04-20 17:22:47 -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
link2xt
bd06836fba test(sqlite): extend it_caches_statements() test
Test that initial PRAGMA statements and &str statements are not
cached, but sqlx::query() statements are cached by default.
2021-04-15 18:26:06 -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
Ryan Leckey
98cd619157 style: rustfmt 2021-04-09 00:24:14 -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
Benjamin Bäumler
fc6eb6363b sqlx-cli database reset fix confirmation flag
sqlx database reset currenctly requires no confirmation and a
confirmation when -y flag is set. Should be the other way around
as it is for sqlx database drop. This commit fixes this.
2021-04-09 00:12:27 -07:00
Vyacheslav Gudkov
674d89bbab Removed unnecessarey preserve_order feature for serde_json. More reliable serialization-desetislization of sqlx-data.json. Added unit tests for sqlx-data.json serialization-deserialization
Signed-off-by: Vyacheslav Gudkov <vyacheslav.gudkov@dsr-corporation.com>
2021-04-09 00:10:32 -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
Kitsu
64e872ffd8
Remove redunant braces in type_name (#1153) 2021-04-05 13:11:37 -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
Chris Pick
c83427f8fc
Fix sqlx-cli crate link (#1139)
Co-authored-by: Chris Pick <chris@chrispick.com>
2021-03-26 21:40:32 -07:00
Ryan Leckey
b6e1275617
fix: derive(Type) should emit a forwarded impl for the compatible function 2021-03-18 16:12:00 -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