-
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
119 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
pub mod mysql; | ||
pub(crate) mod sqlx_types; | ||
pub mod name; | ||
pub(crate) mod parser; | ||
pub(crate) mod util; | ||
|
||
// pub use mysql::*; | ||
pub use name::*; | ||
pub use parser::*; | ||
pub use util::*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
use sea_query::{MysqlQueryBuilder, SelectStatement}; | ||
use crate::sqlx_types::{MySqlPool, mysql::MySqlRow}; | ||
|
||
use crate::debug_print; | ||
|
||
pub struct Executor { | ||
pool: MySqlPool, | ||
} | ||
|
||
pub trait IntoExecutor { | ||
fn into_executor(self) -> Executor; | ||
} | ||
|
||
impl IntoExecutor for MySqlPool { | ||
fn into_executor(self) -> Executor { | ||
Executor { | ||
pool: self | ||
} | ||
} | ||
} | ||
|
||
impl Executor { | ||
pub async fn fetch_all(&self, select: SelectStatement) -> Vec<MySqlRow> { | ||
let (sql, values) = select.build(MysqlQueryBuilder); | ||
debug_print!("{}, {:?}", sql, values); | ||
debug_print!(); | ||
|
||
Vec::new() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#[cfg(feature="sqlx-mysql")] | ||
mod real; | ||
#[cfg(feature="sqlx-mysql")] | ||
pub use real::*; | ||
|
||
#[cfg(not(feature="sqlx-mysql"))] | ||
mod mock; | ||
#[cfg(not(feature="sqlx-mysql"))] | ||
pub use mock::*; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
#[cfg(feature="def")] | ||
pub mod def; | ||
#[cfg(feature="sqlx-mysql")] | ||
#[cfg(feature="discovery")] | ||
pub mod discovery; | ||
#[cfg(feature="parser")] | ||
pub mod parser; | ||
#[cfg(feature="query")] | ||
pub mod query; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
pub struct MySqlPool; | ||
|
||
pub mod mysql { | ||
pub struct MySqlRow; | ||
} | ||
|
||
pub trait Row {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#[cfg(feature="sqlx-dep")] | ||
mod real; | ||
#[cfg(feature="sqlx-dep")] | ||
pub use real::*; | ||
|
||
#[cfg(not(feature="sqlx-dep"))] | ||
mod mock; | ||
#[cfg(not(feature="sqlx-dep"))] | ||
pub use mock::*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pub use sqlx::*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters