identity generator progress
This commit is contained in:
@@ -70,6 +70,7 @@ public:
|
||||
column_builder& not_null();
|
||||
column_builder& primary_key();
|
||||
column_builder& unique();
|
||||
column_builder& identity();
|
||||
|
||||
private:
|
||||
std::string column_name_;
|
||||
|
||||
@@ -36,11 +36,17 @@ public:
|
||||
query_create_table_columns_intermediate columns(const std::vector<table_column> &columns);
|
||||
};
|
||||
|
||||
class query_create_sequence_intermediate : public executable_query {
|
||||
public:
|
||||
using executable_query::executable_query;
|
||||
};
|
||||
|
||||
class query_create_intermediate : public query_intermediate {
|
||||
public:
|
||||
query_create_intermediate();
|
||||
|
||||
query_create_table_intermediate table(const table &tab);
|
||||
query_create_sequence_intermediate sequence(const std::string &sequence_name);
|
||||
executable_query schema(const std::string &schema_name);
|
||||
};
|
||||
|
||||
|
||||
@@ -52,8 +52,6 @@ private:
|
||||
std::vector<table_column> columns_;
|
||||
};
|
||||
|
||||
table operator ""_tab(const char *name, size_t len);
|
||||
|
||||
template<typename Type = table>
|
||||
class typed_table : public table {
|
||||
public:
|
||||
|
||||
@@ -148,6 +148,7 @@ public:
|
||||
[[nodiscard]] const std::string& foreign_key() const;
|
||||
[[nodiscard]] const std::string& from() const;
|
||||
[[nodiscard]] const std::string& group_by() const;
|
||||
[[nodiscard]] const std::string& identity() const;
|
||||
[[nodiscard]] const std::string& in() const;
|
||||
[[nodiscard]] const std::string& insert() const;
|
||||
[[nodiscard]] const std::string& into() const;
|
||||
@@ -213,9 +214,10 @@ private:
|
||||
{dialect_token::EndBinaryData, "'"},
|
||||
{dialect_token::EndQuote, "\""},
|
||||
{dialect_token::EndStringData, "'"},
|
||||
{dialect_token::ForeignKey, "FOREIGN KEY"},
|
||||
{dialect_token::ForeignKey, "FOREIGN KEY"},
|
||||
{dialect_token::From, "FROM"},
|
||||
{dialect_token::GroupBy, "GROUP BY"},
|
||||
{dialect_token::Identity, "AUTO INCREMENT"},
|
||||
{dialect_token::In, "IN"},
|
||||
{dialect_token::Insert, "INSERT"},
|
||||
{dialect_token::Into, "INTO"},
|
||||
@@ -238,7 +240,7 @@ private:
|
||||
{dialect_token::Schema, "SCHEMA"},
|
||||
{dialect_token::Select, "SELECT"},
|
||||
{dialect_token::Set, "SET"},
|
||||
{dialect_token::StartQuote, "\""},
|
||||
{dialect_token::StartQuote, "\""},
|
||||
{dialect_token::StringQuote, "'"},
|
||||
{dialect_token::Table, "TABLE"},
|
||||
{dialect_token::Unique, "UNIQUE"},
|
||||
|
||||
@@ -32,6 +32,7 @@ enum class dialect_token : uint8_t {
|
||||
ForeignKey,
|
||||
From,
|
||||
GroupBy,
|
||||
Identity,
|
||||
In,
|
||||
Insert,
|
||||
Into,
|
||||
|
||||
@@ -7,10 +7,11 @@ enum class constraints : unsigned char {
|
||||
None = 0,
|
||||
Index = 1 << 0,
|
||||
Unique = 1 << 1,
|
||||
PrimaryKey = 1 << 2,
|
||||
ForeignKey = 1 << 3,
|
||||
Default = 1 << 4,
|
||||
NotNull = 1 << 5
|
||||
PrimaryKey = 1 << 2,
|
||||
ForeignKey = 1 << 3,
|
||||
Identity = 1 << 4,
|
||||
Default = 1 << 5,
|
||||
NotNull = 1 << 6
|
||||
};
|
||||
|
||||
inline constraints operator|(constraints a, constraints b) { return static_cast<constraints>(static_cast<unsigned int>(a) | static_cast<unsigned int>(b)); }
|
||||
|
||||
Reference in New Issue
Block a user