HyriseSQLParser/src/sql/CreateStatement.h

44 lines
1.1 KiB
C
Raw Normal View History

#ifndef __CREATE_STATEMENT_H__
#define __CREATE_STATEMENT_H__
2014-12-03 17:43:02 +01:00
#include "SQLStatement.h"
// Note: Implementations of constructors and destructors can be found in statements.cpp.
namespace hsql {
// Represents definition of a table column
2016-02-27 15:01:06 +01:00
struct ColumnDefinition {
enum DataType {
TEXT,
INT,
DOUBLE
};
ColumnDefinition(char* name, DataType type);
virtual ~ColumnDefinition();
2016-02-27 15:01:06 +01:00
char* name;
DataType type;
};
// Represents SQL Create statements.
// Example: "CREATE TABLE students (name TEXT, student_number INTEGER, city TEXT, grade DOUBLE)"
2016-02-27 15:01:06 +01:00
struct CreateStatement : SQLStatement {
enum CreateType {
kTable,
2016-02-27 15:22:22 +01:00
kTableFromTbl // Hyrise file format
2016-02-27 15:01:06 +01:00
};
CreateStatement(CreateType type);
virtual ~CreateStatement();
2016-02-27 15:01:06 +01:00
CreateType type;
bool ifNotExists; // default: false
const char* filePath; // default: NULL
const char* tableName; // default: NULL
std::vector<ColumnDefinition*>* columns; // default: NULL
2016-02-27 15:01:06 +01:00
};
} // namespace hsql
#endif