diff --git a/Cargo.toml b/Cargo.toml index e2c7722ef..5389e89d7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,13 +1,13 @@ [workspace] members = [ ".", - "mason-core", - "mason-postgres-protocol", - "mason-postgres", + "sqlx-core", + "sqlx-postgres-protocol", + "sqlx-postgres", ] [package] -name = "mason" +name = "sqlx" version = "0.0.0" authors = ["Ryan Leckey "] license = "MIT OR Apache-2.0" @@ -16,8 +16,8 @@ edition = "2018" [dependencies] runtime = "=0.3.0-alpha.4" -mason-core = { path = "mason-core" } -mason-postgres = { path = "mason-postgres" } +sqlx-core = { path = "sqlx-core" } +sqlx-postgres = { path = "sqlx-postgres" } failure = "0.1" env_logger = "0.6.1" bytes = "0.4.12" diff --git a/README.md b/README.md index ebf5d5b31..320650c7a 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Mason +# sqlx _Asynchronous and expressive database client in pure Rust_ This is an experiment being worked on in stages. The first stage @@ -12,12 +12,12 @@ What follows is _experimental_ usage (for thinking on API design) that is not cu ```rust #![feature(async_await)] -use mason::pg::Connection; +use sqlx::pg::Connection; #[runtime::main] async fn main() -> Result<(), failure::Error> { // this will likely be something like eventually: - // mason::Connection::::establish(...) + // sqlx::Connection::::establish(...) let mut conn = Connection::establish(ConnectOptions::new().user("postgres")).await?; // or: Connection::establish("postgres://postgres@localhost/").await?; diff --git a/mason-core/Cargo.toml b/sqlx-core/Cargo.toml similarity index 66% rename from mason-core/Cargo.toml rename to sqlx-core/Cargo.toml index 7f9634e11..ea9da5fac 100644 --- a/mason-core/Cargo.toml +++ b/sqlx-core/Cargo.toml @@ -1,9 +1,9 @@ [package] -name = "mason-core" +name = "sqlx-core" version = "0.0.0" authors = ["Ryan Leckey "] license = "MIT OR Apache-2.0" -description = "Shared types and traits for Mason." +description = "Shared types and traits for sqlx." edition = "2018" [dependencies] diff --git a/mason-core/src/connection.rs b/sqlx-core/src/connection.rs similarity index 100% rename from mason-core/src/connection.rs rename to sqlx-core/src/connection.rs diff --git a/mason-core/src/lib.rs b/sqlx-core/src/lib.rs similarity index 100% rename from mason-core/src/lib.rs rename to sqlx-core/src/lib.rs diff --git a/mason-postgres-protocol/Cargo.toml b/sqlx-postgres-protocol/Cargo.toml similarity index 93% rename from mason-postgres-protocol/Cargo.toml rename to sqlx-postgres-protocol/Cargo.toml index 0dcc2cf1e..44cd53982 100644 --- a/mason-postgres-protocol/Cargo.toml +++ b/sqlx-postgres-protocol/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "mason-postgres-protocol" +name = "sqlx-postgres-protocol" version = "0.0.0" authors = ["Ryan Leckey "] license = "MIT OR Apache-2.0" diff --git a/mason-postgres-protocol/benches/decode.rs b/sqlx-postgres-protocol/benches/decode.rs similarity index 92% rename from mason-postgres-protocol/benches/decode.rs rename to sqlx-postgres-protocol/benches/decode.rs index a0ef3635d..93fb775ae 100644 --- a/mason-postgres-protocol/benches/decode.rs +++ b/sqlx-postgres-protocol/benches/decode.rs @@ -3,7 +3,7 @@ extern crate criterion; use bytes::Bytes; use criterion::{black_box, Criterion}; -use mason_postgres_protocol::{Decode, Response}; +use sqlx_postgres_protocol::{Decode, Response}; fn criterion_benchmark(c: &mut Criterion) { // NOTE: This is sans header (for direct decoding) diff --git a/mason-postgres-protocol/benches/encode.rs b/sqlx-postgres-protocol/benches/encode.rs similarity index 94% rename from mason-postgres-protocol/benches/encode.rs rename to sqlx-postgres-protocol/benches/encode.rs index ab07872b9..d47fe9335 100644 --- a/mason-postgres-protocol/benches/encode.rs +++ b/sqlx-postgres-protocol/benches/encode.rs @@ -2,7 +2,7 @@ extern crate criterion; use criterion::Criterion; -use mason_postgres_protocol::{Encode, PasswordMessage, StartupMessage, Response, Severity}; +use sqlx_postgres_protocol::{Encode, PasswordMessage, StartupMessage, Response, Severity}; fn criterion_benchmark(c: &mut Criterion) { c.bench_function("encode Response(Builder)", |b| { diff --git a/mason-postgres-protocol/src/authentication.rs b/sqlx-postgres-protocol/src/authentication.rs similarity index 100% rename from mason-postgres-protocol/src/authentication.rs rename to sqlx-postgres-protocol/src/authentication.rs diff --git a/mason-postgres-protocol/src/backend_key_data.rs b/sqlx-postgres-protocol/src/backend_key_data.rs similarity index 100% rename from mason-postgres-protocol/src/backend_key_data.rs rename to sqlx-postgres-protocol/src/backend_key_data.rs diff --git a/mason-postgres-protocol/src/decode.rs b/sqlx-postgres-protocol/src/decode.rs similarity index 100% rename from mason-postgres-protocol/src/decode.rs rename to sqlx-postgres-protocol/src/decode.rs diff --git a/mason-postgres-protocol/src/encode.rs b/sqlx-postgres-protocol/src/encode.rs similarity index 100% rename from mason-postgres-protocol/src/encode.rs rename to sqlx-postgres-protocol/src/encode.rs diff --git a/mason-postgres-protocol/src/lib.rs b/sqlx-postgres-protocol/src/lib.rs similarity index 100% rename from mason-postgres-protocol/src/lib.rs rename to sqlx-postgres-protocol/src/lib.rs diff --git a/mason-postgres-protocol/src/message.rs b/sqlx-postgres-protocol/src/message.rs similarity index 100% rename from mason-postgres-protocol/src/message.rs rename to sqlx-postgres-protocol/src/message.rs diff --git a/mason-postgres-protocol/src/password_message.rs b/sqlx-postgres-protocol/src/password_message.rs similarity index 100% rename from mason-postgres-protocol/src/password_message.rs rename to sqlx-postgres-protocol/src/password_message.rs diff --git a/mason-postgres-protocol/src/ready_for_query.rs b/sqlx-postgres-protocol/src/ready_for_query.rs similarity index 100% rename from mason-postgres-protocol/src/ready_for_query.rs rename to sqlx-postgres-protocol/src/ready_for_query.rs diff --git a/mason-postgres-protocol/src/response.rs b/sqlx-postgres-protocol/src/response.rs similarity index 100% rename from mason-postgres-protocol/src/response.rs rename to sqlx-postgres-protocol/src/response.rs diff --git a/mason-postgres-protocol/src/startup_message.rs b/sqlx-postgres-protocol/src/startup_message.rs similarity index 100% rename from mason-postgres-protocol/src/startup_message.rs rename to sqlx-postgres-protocol/src/startup_message.rs diff --git a/mason-postgres/Cargo.toml b/sqlx-postgres/Cargo.toml similarity index 86% rename from mason-postgres/Cargo.toml rename to sqlx-postgres/Cargo.toml index 1ec47ab40..026007e43 100644 --- a/mason-postgres/Cargo.toml +++ b/sqlx-postgres/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "mason-postgres" +name = "sqlx-postgres" version = "0.0.0" authors = ["Ryan Leckey "] license = "MIT OR Apache-2.0" @@ -7,7 +7,7 @@ description = "PostgreSQL database driver for dbx." edition = "2018" [dependencies] -mason-core = { path = "../mason-core" } +sqlx-core = { path = "../sqlx-core" } runtime = "=0.3.0-alpha.4" futures-preview = "=0.3.0-alpha.16" failure = "0.1" diff --git a/mason-postgres/src/connection/establish.rs b/sqlx-postgres/src/connection/establish.rs similarity index 98% rename from mason-postgres/src/connection/establish.rs rename to sqlx-postgres/src/connection/establish.rs index d1014f2e2..ffbfe3b63 100644 --- a/mason-postgres/src/connection/establish.rs +++ b/sqlx-postgres/src/connection/establish.rs @@ -4,7 +4,7 @@ use crate::protocol::{ server::Message as ServerMessage, }; use futures::StreamExt; -use mason_core::ConnectOptions; +use sqlx_core::ConnectOptions; use md5::{Digest, Md5}; use std::io; diff --git a/mason-postgres/src/connection/mod.rs b/sqlx-postgres/src/connection/mod.rs similarity index 99% rename from mason-postgres/src/connection/mod.rs rename to sqlx-postgres/src/connection/mod.rs index 525440b8c..6447700f5 100644 --- a/mason-postgres/src/connection/mod.rs +++ b/sqlx-postgres/src/connection/mod.rs @@ -8,7 +8,7 @@ use futures::{ io::{AsyncRead, AsyncReadExt, AsyncWriteExt, ReadHalf, WriteHalf}, SinkExt, StreamExt, }; -use mason_core::ConnectOptions; +use sqlx_core::ConnectOptions; use runtime::{net::TcpStream, task::JoinHandle}; use std::io; diff --git a/mason-postgres/src/connection/query.rs b/sqlx-postgres/src/connection/query.rs similarity index 100% rename from mason-postgres/src/connection/query.rs rename to sqlx-postgres/src/connection/query.rs diff --git a/mason-postgres/src/lib.rs b/sqlx-postgres/src/lib.rs similarity index 100% rename from mason-postgres/src/lib.rs rename to sqlx-postgres/src/lib.rs diff --git a/src/lib.rs b/src/lib.rs index d58ca45d0..8060ada06 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,2 +1,2 @@ -pub use mason_core::ConnectOptions; -pub use mason_postgres as pg; +pub use sqlx_core::ConnectOptions; +pub use sqlx_postgres as pg; diff --git a/src/main.rs b/src/main.rs index 3a0f04834..9ef8b7040 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,6 @@ #![feature(async_await)] -//use mason::{pg::Connection, ConnectOptions}; +//use sqlx::{pg::Connection, ConnectOptions}; #[runtime::main] async fn main() -> Result<(), failure::Error> {