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
This commit is contained in:
Austin Bonander
2023-07-03 14:37:37 -07:00
committed by GitHub
parent 1bdbedabdc
commit dcb58b0e2c
26 changed files with 1392 additions and 107 deletions

View File

@@ -5,6 +5,7 @@ use sqlx_core::connection::ConnectOptions;
use sqlx_core::error::Error;
use sqlx_core::executor::Executor;
use std::fmt::Write;
use std::str::FromStr;
use std::time::Duration;
use url::Url;
@@ -12,7 +13,15 @@ impl ConnectOptions for SqliteConnectOptions {
type Connection = SqliteConnection;
fn from_url(url: &Url) -> Result<Self, Error> {
Self::from_db_and_params(url.path(), url.query())
// SQLite URL parsing is handled specially;
// we want to treat the following URLs as equivalent:
//
// * sqlite:foo.db
// * sqlite://foo.db
//
// If we used `Url::path()`, the latter would return an empty string
// because `foo.db` gets parsed as the hostname.
Self::from_str(url.as_str())
}
fn connect(&self) -> BoxFuture<'_, Result<Self::Connection, Error>>