mirror of
https://github.com/launchbadge/sqlx
synced 2024-11-10 06:24:16 +00:00
mason -> sqlx
This commit is contained in:
parent
2c7475ef0b
commit
22f71df7c7
25 changed files with 21 additions and 21 deletions
12
Cargo.toml
12
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 <leckey.ryan@gmail.com>"]
|
||||
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"
|
||||
|
|
|
@ -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::<Pg>::establish(...)
|
||||
// sqlx::Connection::<Pg>::establish(...)
|
||||
|
||||
let mut conn = Connection::establish(ConnectOptions::new().user("postgres")).await?;
|
||||
// or: Connection::establish("postgres://postgres@localhost/").await?;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
[package]
|
||||
name = "mason-core"
|
||||
name = "sqlx-core"
|
||||
version = "0.0.0"
|
||||
authors = ["Ryan Leckey <leckey.ryan@gmail.com>"]
|
||||
license = "MIT OR Apache-2.0"
|
||||
description = "Shared types and traits for Mason."
|
||||
description = "Shared types and traits for sqlx."
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
|
@ -1,5 +1,5 @@
|
|||
[package]
|
||||
name = "mason-postgres-protocol"
|
||||
name = "sqlx-postgres-protocol"
|
||||
version = "0.0.0"
|
||||
authors = ["Ryan Leckey <leckey.ryan@gmail.com>"]
|
||||
license = "MIT OR Apache-2.0"
|
|
@ -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)
|
|
@ -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| {
|
|
@ -1,5 +1,5 @@
|
|||
[package]
|
||||
name = "mason-postgres"
|
||||
name = "sqlx-postgres"
|
||||
version = "0.0.0"
|
||||
authors = ["Ryan Leckey <leckey.ryan@gmail.com>"]
|
||||
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"
|
|
@ -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;
|
||||
|
|
@ -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;
|
||||
|
|
@ -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;
|
||||
|
|
|
@ -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> {
|
||||
|
|
Loading…
Reference in a new issue