mirror of
https://github.com/launchbadge/sqlx.git
synced 2026-03-01 03:09:30 +00:00
0.7.0-alpha.1 release
This commit is contained in:
parent
c4a2e73a6f
commit
eade49cfb0
1676
Cargo.lock
generated
1676
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
40
Cargo.toml
40
Cargo.toml
@ -6,23 +6,24 @@ members = [
|
||||
"sqlx-macros-core",
|
||||
"sqlx-test",
|
||||
"sqlx-cli",
|
||||
"sqlx-bench",
|
||||
# "sqlx-bench",
|
||||
"sqlx-mysql",
|
||||
"sqlx-postgres",
|
||||
"sqlx-sqlite",
|
||||
"examples/mysql/todos",
|
||||
"examples/postgres/axum-social-with-tests",
|
||||
"examples/postgres/files",
|
||||
"examples/postgres/json",
|
||||
"examples/postgres/listen",
|
||||
"examples/postgres/todos",
|
||||
"examples/postgres/mockable-todos",
|
||||
"examples/postgres/transaction",
|
||||
"examples/sqlite/todos",
|
||||
# FIXME: uncomment these for full release
|
||||
# "examples/mysql/todos",
|
||||
# "examples/postgres/axum-social-with-tests",
|
||||
# "examples/postgres/files",
|
||||
# "examples/postgres/json",
|
||||
# "examples/postgres/listen",
|
||||
# "examples/postgres/todos",
|
||||
# "examples/postgres/mockable-todos",
|
||||
# "examples/postgres/transaction",
|
||||
# "examples/sqlite/todos",
|
||||
]
|
||||
|
||||
[workspace.package]
|
||||
version = "0.6.2"
|
||||
version = "0.7.0-alpha.1"
|
||||
license = "MIT OR Apache-2.0"
|
||||
edition = "2021"
|
||||
repository = "https://github.com/launchbadge/sqlx"
|
||||
@ -112,13 +113,18 @@ uuid = ["sqlx-core/uuid", "sqlx-macros?/uuid", "sqlx-mysql?/uuid", "sqlx-postgre
|
||||
regexp = ["sqlx-sqlite?/regexp"]
|
||||
|
||||
[workspace.dependencies]
|
||||
# Core Crates
|
||||
sqlx-core = { version = "=0.7.0-alpha.1", path = "sqlx-core" }
|
||||
sqlx-macros-core = { version = "=0.7.0-alpha.1", path = "sqlx-macros-core" }
|
||||
sqlx-macros = { version = "=0.7.0-alpha.1", path = "sqlx-macros" }
|
||||
|
||||
# Driver crates
|
||||
sqlx-mysql = { version = "=0.6.2", path = "sqlx-mysql" }
|
||||
sqlx-postgres = { version = "=0.6.2", path = "sqlx-postgres" }
|
||||
sqlx-sqlite = { version = "=0.6.2", path = "sqlx-sqlite" }
|
||||
sqlx-mysql = { version = "=0.7.0-alpha.1", path = "sqlx-mysql" }
|
||||
sqlx-postgres = { version = "=0.7.0-alpha.1", path = "sqlx-postgres" }
|
||||
sqlx-sqlite = { version = "=0.7.0-alpha.1", path = "sqlx-sqlite" }
|
||||
|
||||
# Facade crate (for reference from sqlx-cli)
|
||||
sqlx = {version = "=0.6.2", path = "." }
|
||||
sqlx = { version = "=0.7.0-alpha.1", path = "." }
|
||||
|
||||
# Common type integrations shared by multiple driver crates.
|
||||
# These are optional unless enabled in a workspace crate.
|
||||
@ -144,8 +150,8 @@ features = ["time", "net", "sync", "fs", "io-util", "rt"]
|
||||
default-features = false
|
||||
|
||||
[dependencies]
|
||||
sqlx-core = { version = "0.6.2", path = "sqlx-core", features = ["offline", "migrate"], default-features = false }
|
||||
sqlx-macros = { version = "0.6.2", path = "sqlx-macros", default-features = false, optional = true }
|
||||
sqlx-core = { version = "=0.7.0-alpha.1", path = "sqlx-core", features = ["offline", "migrate"], default-features = false }
|
||||
sqlx-macros = { version = "=0.7.0-alpha.1", path = "sqlx-macros", default-features = false, optional = true }
|
||||
|
||||
sqlx-mysql = { workspace = true, optional = true }
|
||||
sqlx-postgres = { workspace = true, optional = true }
|
||||
|
||||
@ -1,16 +0,0 @@
|
||||
#!/usr/bin/env sh
|
||||
set -ex
|
||||
|
||||
VERSION=$1
|
||||
|
||||
if [ -z "$VERSION" ]
|
||||
then
|
||||
echo "USAGE: ./prep-release.sh <version>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cargo set-version -p sqlx-rt "$VERSION"
|
||||
cargo set-version -p sqlx-core "$VERSION"
|
||||
cargo set-version -p sqlx-macros "$VERSION"
|
||||
cargo set-version -p sqlx "$VERSION"
|
||||
cargo set-version -p sqlx-cli "$VERSION"
|
||||
@ -29,7 +29,7 @@ sqlite = ["sqlx/sqlite"]
|
||||
criterion = "0.3.3"
|
||||
dotenvy = "0.15.0"
|
||||
once_cell = "1.4"
|
||||
sqlx = { version = "0.6", path = "../", default-features = false, features = ["macros"] }
|
||||
sqlx = { workspace = true, default-features = false, features = ["macros"] }
|
||||
|
||||
chrono = "0.4.19"
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "sqlx-cli"
|
||||
version = "0.6.2"
|
||||
version.workspace = true
|
||||
description = "Command-line utility for SQLx, the Rust SQL toolkit."
|
||||
edition = "2021"
|
||||
readme = "README.md"
|
||||
|
||||
@ -97,5 +97,5 @@ event-listener = "2.5.2"
|
||||
dotenvy = "0.15"
|
||||
|
||||
[dev-dependencies]
|
||||
sqlx = { version = "0.6.2", path = "..", features = ["postgres", "sqlite", "mysql", "migrate"] }
|
||||
sqlx = { workspace = true, features = ["postgres", "sqlite", "mysql", "migrate"] }
|
||||
tokio = { version = "1", features = ["rt"] }
|
||||
|
||||
@ -1,10 +1,8 @@
|
||||
use crate::any::value::AnyValueKind;
|
||||
use crate::any::{Any, AnyValueRef};
|
||||
use crate::any::Any;
|
||||
use crate::arguments::Arguments;
|
||||
use crate::encode::Encode;
|
||||
use crate::types::Type;
|
||||
use std::borrow::Cow;
|
||||
use std::marker::PhantomData;
|
||||
|
||||
pub struct AnyArguments<'q> {
|
||||
#[doc(hidden)]
|
||||
@ -22,7 +20,7 @@ impl<'q> Arguments<'q> for AnyArguments<'q> {
|
||||
where
|
||||
T: 'q + Send + Encode<'q, Self::Database> + Type<Self::Database>,
|
||||
{
|
||||
value.encode(&mut self.values);
|
||||
let _ = value.encode(&mut self.values);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
use crate::any::{Any, AnyTypeInfo, AnyValue};
|
||||
use crate::column::{Column, ColumnIndex};
|
||||
use crate::any::{Any, AnyTypeInfo};
|
||||
use crate::column::Column;
|
||||
use crate::ext::ustr::UStr;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
use crate::any::{Any, AnyArguments, AnyQueryResult, AnyRow, AnyStatement, AnyTypeInfo};
|
||||
use crate::describe::Describe;
|
||||
use crate::transaction::Transaction;
|
||||
use either::Either;
|
||||
use futures_core::future::BoxFuture;
|
||||
use futures_core::stream::BoxStream;
|
||||
|
||||
@ -8,7 +8,6 @@ use crate::executor::{Execute, Executor};
|
||||
use either::Either;
|
||||
use futures_core::future::BoxFuture;
|
||||
use futures_core::stream::BoxStream;
|
||||
use futures_util::{StreamExt, TryStreamExt};
|
||||
|
||||
impl<'c> Executor<'c> for &'c mut AnyConnection {
|
||||
type Database = Any;
|
||||
|
||||
@ -1,8 +1,6 @@
|
||||
use futures_core::future::BoxFuture;
|
||||
use std::marker::PhantomData;
|
||||
use url::Url;
|
||||
|
||||
use crate::any::{Any, AnyConnectOptions, AnyKind};
|
||||
use crate::any::{Any, AnyConnectOptions};
|
||||
use crate::connection::{ConnectOptions, Connection};
|
||||
use crate::error::Error;
|
||||
|
||||
|
||||
@ -3,7 +3,6 @@ use crate::any::{
|
||||
AnyStatement, AnyTransactionManager, AnyTypeInfo, AnyValue, AnyValueRef,
|
||||
};
|
||||
use crate::database::{Database, HasArguments, HasStatement, HasStatementCache, HasValueRef};
|
||||
use std::marker::PhantomData;
|
||||
|
||||
/// Opaque database driver. Capable of being used in place of any SQLx database driver. The actual
|
||||
/// driver used will be selected at runtime, from the connection url.
|
||||
|
||||
@ -7,8 +7,6 @@ use std::str::FromStr;
|
||||
use std::time::Duration;
|
||||
use url::Url;
|
||||
|
||||
use crate::any::kind::AnyKind;
|
||||
|
||||
/// Opaque options for connecting to a database. These may only be constructed by parsing from
|
||||
/// a connection url.
|
||||
///
|
||||
|
||||
@ -9,7 +9,6 @@ use crate::row::Row;
|
||||
use crate::type_info::TypeInfo;
|
||||
use crate::types::Type;
|
||||
use crate::value::{Value, ValueRef};
|
||||
use std::borrow::Cow;
|
||||
use std::sync::Arc;
|
||||
|
||||
#[derive(Clone)]
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
use crate::any::{Any, AnyArguments, AnyColumn, AnyTypeInfo};
|
||||
use crate::column::ColumnIndex;
|
||||
use crate::database::{Database, HasStatement};
|
||||
use crate::database::Database;
|
||||
use crate::error::Error;
|
||||
use crate::ext::ustr::UStr;
|
||||
use crate::statement::Statement;
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
use futures_util::future::BoxFuture;
|
||||
|
||||
use crate::any::{Any, AnyConnection};
|
||||
use crate::database::Database;
|
||||
use crate::error::Error;
|
||||
use crate::transaction::TransactionManager;
|
||||
|
||||
|
||||
@ -14,7 +14,7 @@ impl Type<Any> for f32 {
|
||||
}
|
||||
|
||||
impl<'q> Encode<'q, Any> for f32 {
|
||||
fn encode_by_ref(&self, buf: &mut AnyArgumentBuffer) -> IsNull {
|
||||
fn encode_by_ref(&self, buf: &mut AnyArgumentBuffer<'q>) -> IsNull {
|
||||
buf.0.push(AnyValueKind::Real(*self));
|
||||
IsNull::No
|
||||
}
|
||||
|
||||
@ -17,16 +17,6 @@
|
||||
//! In addition, `Option<T>` is supported where `T` implements `Type`. An `Option<T>` represents
|
||||
//! a potentially `NULL` value from SQL.
|
||||
|
||||
use crate::any::type_info::AnyTypeInfoKind;
|
||||
use crate::any::value::AnyValueKind;
|
||||
use crate::any::{Any, AnyTypeInfo, AnyValueRef};
|
||||
use crate::database::{HasArguments, HasValueRef};
|
||||
use crate::decode::Decode;
|
||||
use crate::encode::{Encode, IsNull};
|
||||
use crate::error::BoxDynError;
|
||||
use crate::types::Type;
|
||||
use std::borrow::Cow;
|
||||
|
||||
mod blob;
|
||||
mod bool;
|
||||
mod float;
|
||||
@ -35,6 +25,11 @@ mod str;
|
||||
|
||||
#[test]
|
||||
fn test_type_impls() {
|
||||
use crate::any::Any;
|
||||
use crate::decode::Decode;
|
||||
use crate::encode::Encode;
|
||||
use crate::types::Type;
|
||||
|
||||
fn has_type<T>()
|
||||
where
|
||||
T: Type<Any>,
|
||||
|
||||
@ -64,7 +64,6 @@ impl<DB: Database> Describe<DB> {
|
||||
crate::any::AnyTypeInfo: for<'a> TryFrom<&'a DB::TypeInfo, Error = crate::Error>,
|
||||
{
|
||||
use crate::any::AnyTypeInfo;
|
||||
use std::convert::TryFrom;
|
||||
|
||||
let columns = self
|
||||
.columns
|
||||
|
||||
@ -74,7 +74,6 @@ use futures_core::FusedFuture;
|
||||
use futures_util::FutureExt;
|
||||
use std::fmt;
|
||||
use std::future::Future;
|
||||
use std::ops::DerefMut;
|
||||
use std::pin::Pin;
|
||||
use std::sync::Arc;
|
||||
use std::task::{Context, Poll};
|
||||
|
||||
@ -6,7 +6,6 @@ use futures_core::future::BoxFuture;
|
||||
|
||||
use crate::database::Database;
|
||||
use crate::error::Error;
|
||||
use crate::executor::Executor;
|
||||
use crate::pool::MaybePoolConnection;
|
||||
|
||||
/// Generic management of database transactions.
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
use std::ops::{Deref, DerefMut};
|
||||
|
||||
use serde::de::DeserializeOwned;
|
||||
use serde::{Deserialize, Serialize};
|
||||
pub use serde_json::value::RawValue as JsonRawValue;
|
||||
pub use serde_json::Value as JsonValue;
|
||||
|
||||
@ -36,7 +36,7 @@ time = ["sqlx-core/time", "sqlx-mysql?/time", "sqlx-postgres?/time", "sqlx-sqlit
|
||||
uuid = ["sqlx-core/uuid", "sqlx-mysql?/uuid", "sqlx-postgres?/uuid", "sqlx-sqlite?/uuid"]
|
||||
|
||||
[dependencies]
|
||||
sqlx-core = { version = "0.6.2", default-features = false, features = ["offline"], path = "../sqlx-core" }
|
||||
sqlx-core = { workspace = true, default-features = false, features = ["offline"] }
|
||||
sqlx-mysql = { workspace = true, features = ["offline", "migrate"], optional = true }
|
||||
sqlx-postgres = { workspace = true, features = ["offline", "migrate"], optional = true }
|
||||
sqlx-sqlite = { workspace = true, features = ["offline", "migrate"], optional = true }
|
||||
|
||||
@ -39,8 +39,8 @@ uuid = ["sqlx-macros-core/uuid"]
|
||||
json = ["sqlx-macros-core/json"]
|
||||
|
||||
[dependencies]
|
||||
sqlx-core = { version = "=0.6.2", default-features = false, features = ["any"], path = "../sqlx-core" }
|
||||
sqlx-macros-core = { version = "=0.6.2", path = "../sqlx-macros-core" }
|
||||
sqlx-core = { workspace = true, default-features = false, features = ["any"] }
|
||||
sqlx-macros-core = { workspace = true }
|
||||
|
||||
proc-macro2 = { version = "1.0.36", default-features = false }
|
||||
syn = { version = "1.0.84", default-features = false, features = ["full"] }
|
||||
|
||||
@ -17,6 +17,8 @@ offline = ["sqlx-core/offline", "serde/derive"]
|
||||
migrate = ["sqlx-core/migrate"]
|
||||
|
||||
[dependencies]
|
||||
sqlx-core = { workspace = true }
|
||||
|
||||
# Futures crates
|
||||
futures-channel = { version = "0.3.19", default-features = false, features = ["sink", "alloc", "std"] }
|
||||
futures-core = { version = "0.3.19", default-features = false }
|
||||
@ -64,7 +66,3 @@ tracing = { version = "0.1.37", features = ["log"] }
|
||||
whoami = { version = "1.2.1", default-features = false }
|
||||
|
||||
serde = { version = "1.0.144", optional = true }
|
||||
|
||||
[dependencies.sqlx-core]
|
||||
version = "=0.6.2"
|
||||
path = "../sqlx-core"
|
||||
|
||||
@ -68,7 +68,6 @@ serde = { version = "1.0.144", features = ["derive"] }
|
||||
serde_json = { version = "1.0.85", features = ["raw_value"] }
|
||||
|
||||
[dependencies.sqlx-core]
|
||||
version = "=0.6.2"
|
||||
path = "../sqlx-core"
|
||||
workspace = true
|
||||
# We use JSON in the driver implementation itself so there's no reason not to enable it here.
|
||||
features = ["json"]
|
||||
|
||||
@ -58,8 +58,7 @@ features = [
|
||||
]
|
||||
|
||||
[dependencies.sqlx-core]
|
||||
version = "=0.6.2"
|
||||
path = "../sqlx-core"
|
||||
workspace = true
|
||||
|
||||
[dev-dependencies]
|
||||
sqlx = { version = "0.6.2", path = "..", default-features = false, features = ["macros", "runtime-tokio", "tls-none"] }
|
||||
sqlx = { workspace = true, default-features = false, features = ["macros", "runtime-tokio", "tls-none"] }
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
// The no-arg variant is covered by other tests already.
|
||||
|
||||
use sqlx::{MySqlPool, Row};
|
||||
use sqlx::MySqlPool;
|
||||
|
||||
const MIGRATOR: sqlx::migrate::Migrator = sqlx::migrate!("tests/mysql/migrations");
|
||||
|
||||
|
||||
@ -5,6 +5,8 @@ use std::ops::Bound;
|
||||
use sqlx::postgres::types::{Oid, PgInterval, PgMoney, PgRange};
|
||||
use sqlx::postgres::Postgres;
|
||||
use sqlx_test::{test_decode_type, test_prepared_type, test_type};
|
||||
|
||||
#[cfg(any(postgres_14, postgres_15))]
|
||||
use std::str::FromStr;
|
||||
|
||||
test_type!(null<Option<i16>>(Postgres,
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
use sqlx::{error::ErrorKind, query, sqlite::Sqlite, Connection, Executor, Transaction};
|
||||
use sqlx::{error::ErrorKind, sqlite::Sqlite, Connection, Executor};
|
||||
use sqlx_test::new;
|
||||
|
||||
#[sqlx_macros::test]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user