Skip to content

Commit

Permalink
0.7.0-alpha.1 release
Browse files Browse the repository at this point in the history
  • Loading branch information
abonander committed Feb 21, 2023
1 parent c4a2e73 commit 6cf15b0
Show file tree
Hide file tree
Showing 30 changed files with 485 additions and 1,322 deletions.
1,676 changes: 437 additions & 1,239 deletions Cargo.lock

Large diffs are not rendered by default.

40 changes: 23 additions & 17 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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.
Expand All @@ -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 }
Expand Down
16 changes: 0 additions & 16 deletions prep-release.sh

This file was deleted.

2 changes: 1 addition & 1 deletion sqlx-bench/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion sqlx-cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion sqlx-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
6 changes: 2 additions & 4 deletions sqlx-core/src/any/arguments.rs
Original file line number Diff line number Diff line change
@@ -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)]
Expand All @@ -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);
}
}

Expand Down
4 changes: 2 additions & 2 deletions sqlx-core/src/any/column.rs
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down
1 change: 0 additions & 1 deletion sqlx-core/src/any/connection/backend.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
1 change: 0 additions & 1 deletion sqlx-core/src/any/connection/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 1 addition & 3 deletions sqlx-core/src/any/connection/mod.rs
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
1 change: 0 additions & 1 deletion sqlx-core/src/any/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 0 additions & 2 deletions sqlx-core/src/any/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand Down
1 change: 0 additions & 1 deletion sqlx-core/src/any/row.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion sqlx-core/src/any/statement.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
1 change: 0 additions & 1 deletion sqlx-core/src/any/transaction.rs
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
2 changes: 1 addition & 1 deletion sqlx-core/src/any/types/float.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
15 changes: 5 additions & 10 deletions sqlx-core/src/any/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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>,
Expand Down
1 change: 0 additions & 1 deletion sqlx-core/src/describe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion sqlx-core/src/pool/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
1 change: 0 additions & 1 deletion sqlx-core/src/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 0 additions & 1 deletion sqlx-core/src/types/json.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 1 addition & 1 deletion sqlx-macros-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
4 changes: 2 additions & 2 deletions sqlx-macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
Expand Down
6 changes: 2 additions & 4 deletions sqlx-mysql/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down Expand Up @@ -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"
3 changes: 1 addition & 2 deletions sqlx-postgres/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
5 changes: 2 additions & 3 deletions sqlx-sqlite/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
2 changes: 1 addition & 1 deletion tests/mysql/test-attr.rs
Original file line number Diff line number Diff line change
@@ -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");

Expand Down
1 change: 0 additions & 1 deletion tests/postgres/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ 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};
use std::str::FromStr;

test_type!(null<Option<i16>>(Postgres,
"NULL::int2" == None::<i16>
Expand Down
2 changes: 1 addition & 1 deletion tests/sqlite/error.rs
Original file line number Diff line number Diff line change
@@ -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]
Expand Down

0 comments on commit 6cf15b0

Please sign in to comment.