-
-
Notifications
You must be signed in to change notification settings - Fork 543
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #309 from SeaQL/refactor-schema-helper
Refactor `Schema`
- Loading branch information
Showing
3 changed files
with
30 additions
and
13 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,5 +1,17 @@ | ||
use crate::DbBackend; | ||
|
||
mod entity; | ||
|
||
/// This structure defines a schema for a table | ||
/// This is a helper struct to convert [`EntityTrait`](crate::EntityTrait) | ||
/// into different [`sea_query`](crate::sea_query) statements. | ||
#[derive(Debug)] | ||
pub struct Schema; | ||
pub struct Schema { | ||
backend: DbBackend, | ||
} | ||
|
||
impl Schema { | ||
/// Create a helper for a specific database backend | ||
pub fn new(backend: DbBackend) -> Self { | ||
Self { backend } | ||
} | ||
} |
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