-
Notifications
You must be signed in to change notification settings - Fork 243
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DYOD] Data Definition Language Project (#177)
This pull request sums up all the work for project 1 of this term "Develop your Own Database" seminar. The project's high-level goal is to make the schema SQL of hyrise executable. Specifically, this pull request - once finished - will include the extension of the parser to support CREATE INDEX and DROP INDEX statements, column and table key constraints, a subset of ALTER TABLE statements, and extended type parsing within column definitions. Co-authored-by: Moritz Spranger <[email protected]> Co-authored-by: Jostafarr <[email protected]> Co-authored-by: mweisgut <[email protected]> Co-authored-by: Marcel Weisgut <[email protected]>
- Loading branch information
1 parent
f1afb9a
commit 0de1890
Showing
15 changed files
with
4,297 additions
and
3,536 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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,41 @@ | ||
#ifndef SQLPARSER_ALTER_STATEMENT_H | ||
#define SQLPARSER_ALTER_STATEMENT_H | ||
|
||
#include "SQLStatement.h" | ||
|
||
// Note: Implementations of constructors and destructors can be found in statements.cpp. | ||
namespace hsql { | ||
|
||
enum ActionType { | ||
DropColumn, | ||
}; | ||
|
||
struct AlterAction { | ||
AlterAction(ActionType type); | ||
ActionType type; | ||
virtual ~AlterAction(); | ||
}; | ||
|
||
struct DropColumnAction : AlterAction { | ||
DropColumnAction(char* column_name); | ||
char* columnName; | ||
bool ifExists; | ||
|
||
~DropColumnAction() override; | ||
}; | ||
|
||
// Represents SQL Alter Table statements. | ||
// Example "ALTER TABLE students DROP COLUMN name;" | ||
struct AlterStatement : SQLStatement { | ||
|
||
AlterStatement(char* name, AlterAction* action); | ||
~AlterStatement() override; | ||
|
||
char* schema; | ||
bool ifTableExists; | ||
char* name; | ||
AlterAction* action; | ||
}; | ||
} // namespace hsql | ||
|
||
#endif |
Oops, something went wrong.