Commit graph

25 commits

Author SHA1 Message Date
Austin Bonander
dcb58b0e2c
0.7.0 release (#2575)
* WIP preparing 0.7.0 release

* fix: re-enable examples

* fix doctests in `sqlx-core`

* cherry-pick CHANGELOG entry for 0.6.3

* add actions workflow for examples

* fix(cli): close connection after running migrations

* fix examples

* fix(sqlite): fix parsing of URLs via `Any`

* fix(example): don't let Postgres `listen` example run forever

* fix Postgres `transaction` example
2023-07-03 14:37:37 -07:00
Austin Bonander
e2ce463af8
doc: make it clear that ConnectOptions types impl FromStr (#2574) 2023-06-30 16:49:24 -07:00
Andrew Whitehead
3fbc3a3ff2
(sqlite) do not drop notify mutex until after condvar is triggered (#2573)
Signed-off-by: Andrew Whitehead <cywolf@gmail.com>
2023-06-30 16:48:52 -07:00
Paolo Barbolini
37fdc2043b
Update bitflags to v2 (#2564) 2023-06-30 12:34:33 -07:00
tyrelr
238a95b0f3
Sqlite analytical (#2508)
* Add failing tests

* remove unnecessary functions, clarify function names

* simplify access to cursor columns with helper methods

* split table info from cursor info so that cursors can share table info

* fix test expectations
2023-06-12 12:48:32 -07:00
Mauro D
af0f04a108
Bump to libsqlite3-sys 0.26 (#2496) 2023-05-11 15:43:52 -07:00
tyrelr
0dfebb202f
Add and improve sqlite describe performance benchmarks (#2467)
* add basic describe benchmarks

* separate memory from query state

* move branch tracking & deduplication logic into a dedicated BranchList class

* Convert to using IntMap

* move intmap to a separate module, drop dead code, clean up function names

* Update Cargo.lock

* skip branches to check foreign keys, as they generally shouldn't impact query result type
2023-05-08 12:44:28 -07:00
Midas Lambrichts
cbf8dd37e9
Add Simple format for Uuid for MySQL & SQLite. (#2469)
* Add Simple format for Uuid for MySQL & SQLite.

Copy pasted the implementation for `Hyphenated` and adapt.

* Add uuid Simple docs for SQLite
2023-05-04 13:14:06 -07:00
tyrelr
39acaf1459
limit the number of instructions that can be evaluated (#2459)
* limit the number of instructions that can be evaluated

* code cleanup
2023-05-04 11:46:11 -07:00
Nicolas Stinus
dc9e298bff
fix(sqlx-core): allow time::OffsetDateTime to be built from sqlite's CURRENT_TIMESTAMP (#2285)
SQLite's CURRENT_TIMESTAMP keyword fills a DATETIME column as a UTC expressed
string in the following format: "YYYY-MM-DD HH:MM:SS".

Unfortunately, this format lacks the timezone information to safely build
a time::OffsetDateTime.

If all else fails, this patch will try to build it by assuming the missing
timezine is UTC.
2023-05-01 15:05:40 -07:00
Nisheeth Barthwal
4f1ac1d606
add progress handler support to sqlite (#2256)
* rebase main

* fmt

* use NonNull to fix UB

* apply code suggestions

* add test for multiple handler drops

* remove nightly features for test
2023-03-24 14:27:16 -07:00
Alexander Lyon
bd3eb94737 fix(#2407): respect the HaltIfNull opcode when determining nullability 2023-03-20 14:12:20 -07:00
Austin Bonander
d43257e18a chore: cleanup, fix all non-deprecation warnings 2023-03-16 17:03:14 -07:00
Austin Bonander
c4b835c23a feat: add Connection::shrink_buffers, PoolConnection::close
closes #2372
2023-03-03 16:50:27 -08:00
Paolo Barbolini
c17c59fc4c Update dependencies 2023-02-22 15:49:46 -08:00
Craig Bester
9677430d67 fix: implement AnyConnectionBackend::as_migrate for databases 2023-02-22 15:09:41 -08:00
Austin Bonander
f05c884cdc
fix: remove readme entries for sqlx-mysql, sqlx-postgres, sqlx-sqlite 2023-02-21 15:44:03 -08:00
Austin Bonander
eade49cfb0
0.7.0-alpha.1 release 2023-02-21 14:56:54 -08:00
miles
1fd05716af [SQLite] Add option to execute PRAGMA optimize; on close of a connection (#2116)
* CHANGELOG: mention that users should upgrade CLI

* [SQLite] Add option to execute `PRAGMA optimize;` on close of a connection

* Update sqlx-sqlite/src/options/mod.rs

* Update sqlx-sqlite/src/options/mod.rs

* Update sqlx-sqlite/src/options/mod.rs

---------

Co-authored-by: Austin Bonander <austin.bonander@gmail.com>
2023-02-21 13:25:25 -08:00
Trangar
ad8ef8d608 Added regexp support in sqlite (#2189)
* CHANGELOG: mention that users should upgrade CLI

* Added regexp support in sqlite

* Added a with_regexp function to sqliteconnectoptions

* Fixed tests

* Undo CHANGELOG.md change

---------

Co-authored-by: Austin Bonander <austin.bonander@gmail.com>
Co-authored-by: Victor Koenders <victor.koenders@qrtech.se>
2023-02-21 13:25:25 -08:00
CosmicHorror
acaee75a30 Initial work to switch to tracing (#2185)
* Add tracing dep

* Switch over basic events

* Switch over dynamically enabled events

* Fix missing SocketAddr formatting

* More format fixing

* refactor: Apply tracing changes to new crate structure
2023-02-21 13:25:25 -08:00
Danilo Cianfrone
b72a52b066 fix: use owned Builder pattern for ConnectOptions (#2132)
* CHANGELOG: mention that users should upgrade CLI

* fix(sqlx-core): use owned builder pattern for ConnectOptions

---------

Co-authored-by: Austin Bonander <austin.bonander@gmail.com>
2023-02-21 13:25:25 -08:00
Luiz Carvalho
c09532864d feat: better database errors (#2109)
* feat(core): create error kind enum

* feat(core): add error kind for postgres

* feat(core): add error kind for sqlite

* feat(core): add error kind for mysql

* test(postgres): add error tests

* test(sqlite): add error tests

* test(mysql): add error tests

* fix(tests): fix tests rebasing

* refac(errors): add `ErrorKind::Other` variant
2023-02-21 13:25:25 -08:00
tyrelr
5378dea6af Sqlite describe fixes (#2253)
* add failing test for nested orderby

* log query paths which were abandoned due to invalid state or looping.  Allow instructions to be executed a small number of times to fix nested order by query

* add failing testcase using nested orderby

* fix handling of sequence/offset and rewind

* fix handling when sqlite nests records inside of records

* add test of temporary table handling

* WIP add test failure for temp table access

* fix support for temp tables

* add tests for sqlite datetime functions

* add basic date and time function support

* handle gosub opcode correctly

* add group by test

* fix group by handling

* add additional passing group by test

* add test case for simple limit query

* fix IfPos & If touching wrong branches state, fix IfPos using wrong branch criteria

* add test for large offsets

* add short-circuit for possible query offset loops

* add groupby query that is predicted incorrectly

* fix handling of integer cast failures

* add tests for single-row aggregate results

* fix handling of null-based branching

* add test for coercion of text by sum

* fix calculation of sum value coercion

* add failing test for recursive with query

* add logic for delete operation to fix queries grouping by columns from a recursive query
2023-02-21 13:25:25 -08:00
Austin Bonander
b5312c3b6f Break drivers out into separate crates, clean up some technical debt (#2039)
* WIP rt refactors

* refactor: break drivers out into separate crates

also cleans up significant technical debt
2023-02-21 13:25:25 -08:00