-
Notifications
You must be signed in to change notification settings - Fork 552
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sql: split transaction and catalog traits, and use catalog during pla…
…nning
- Loading branch information
1 parent
5a1756a
commit 1269f8e
Showing
121 changed files
with
18,427 additions
and
440 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
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 |
---|---|---|
@@ -1,18 +1,13 @@ | ||
use crate::error::Result; | ||
use crate::sql::engine::Transaction; | ||
use crate::sql::engine::Catalog; | ||
use crate::sql::types::schema::Table; | ||
|
||
// Creates a table (i.e. CREATE TABLE). | ||
pub(super) fn create_table(txn: &impl Transaction, schema: Table) -> Result<()> { | ||
txn.create_table(schema) | ||
pub(super) fn create_table(catalog: &impl Catalog, schema: Table) -> Result<()> { | ||
catalog.create_table(schema) | ||
} | ||
|
||
/// Deletes a table (i.e. DROP TABLE). Returns true if the table existed. | ||
pub(super) fn drop_table(txn: &impl Transaction, table: &str, if_exists: bool) -> Result<bool> { | ||
// TODO the planner should deal with this. | ||
if if_exists && txn.get_table(table)?.is_none() { | ||
return Ok(false); | ||
} | ||
txn.drop_table(table)?; | ||
Ok(true) | ||
pub(super) fn drop_table(catalog: &impl Catalog, table: &str, if_exists: bool) -> Result<bool> { | ||
catalog.drop_table(table, if_exists) | ||
} |
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
Oops, something went wrong.