added sequence-specific code (create, drop and nextval)

This commit is contained in:
2026-02-17 13:31:06 +01:00
parent 80426c5293
commit 5668f1060b
17 changed files with 174 additions and 8 deletions
+7 -1
View File
@@ -145,6 +145,7 @@ public:
[[nodiscard]] const std::string& end_binary_data() const;
[[nodiscard]] const std::string& end_quote() const;
[[nodiscard]] const std::string& end_string_data() const;
[[nodiscard]] const std::string& exists() const;
[[nodiscard]] const std::string& foreign_key() const;
[[nodiscard]] const std::string& from() const;
[[nodiscard]] const std::string& group_by() const;
@@ -157,6 +158,7 @@ public:
[[nodiscard]] const std::string& join() const;
[[nodiscard]] const std::string& like() const;
[[nodiscard]] const std::string& limit() const;
[[nodiscard]] const std::string& nextval() const;
[[nodiscard]] const std::string& not_() const;
[[nodiscard]] const std::string& not_null() const;
[[nodiscard]] const std::string& offset() const;
@@ -171,6 +173,7 @@ public:
[[nodiscard]] const std::string& schema() const;
[[nodiscard]] const std::string& select() const;
[[nodiscard]] const std::string& set() const;
[[nodiscard]] const std::string& sequence() const;
[[nodiscard]] const std::string& start_quote() const;
[[nodiscard]] const std::string& string_quote() const;
[[nodiscard]] const std::string& table() const;
@@ -192,6 +195,7 @@ private:
std::string default_schema_name_;
token_to_string_map tokens_ {
{dialect_token::AddConstraint, "ADD CONSTRAINT"},
{dialect_token::Alter, "ALTER"},
@@ -215,6 +219,7 @@ private:
{dialect_token::EndBinaryData, "'"},
{dialect_token::EndQuote, "\""},
{dialect_token::EndStringData, "'"},
{dialect_token::Exists, "EXISTS"},
{dialect_token::ForeignKey, "FOREIGN KEY"},
{dialect_token::From, "FROM"},
{dialect_token::GroupBy, "GROUP BY"},
@@ -227,6 +232,7 @@ private:
{dialect_token::Join, "LEFT JOIN"},
{dialect_token::Like, "LIKE"},
{dialect_token::Limit, "LIMIT"},
{dialect_token::NextVal, "NEXTVAL"},
{dialect_token::None, ""},
{dialect_token::Not, "NOT"},
{dialect_token::NotNull, "NOT NULL"},
@@ -242,6 +248,7 @@ private:
{dialect_token::Schema, "SCHEMA"},
{dialect_token::Select, "SELECT"},
{dialect_token::Set, "SET"},
{dialect_token::Sequence, "SEQUENCE"},
{dialect_token::StartQuote, "\""},
{dialect_token::StringQuote, "'"},
{dialect_token::Table, "TABLE"},
@@ -250,7 +257,6 @@ private:
{dialect_token::Values, "VALUES"},
{dialect_token::Where, "WHERE"}
};
data_type_to_string_map data_types_ {
{utils::basic_type::Int8, "TINYINT"},
{utils::basic_type::Int16, "SMALLINT"},
+3
View File
@@ -29,6 +29,7 @@ enum class dialect_token : uint8_t {
EndBinaryData,
EndQuote,
EndStringData,
Exists,
ForeignKey,
From,
GroupBy,
@@ -41,6 +42,7 @@ enum class dialect_token : uint8_t {
Join,
Like,
Limit,
NextVal,
None,
Not,
NotNull,
@@ -56,6 +58,7 @@ enum class dialect_token : uint8_t {
Schema,
Select,
Set,
Sequence,
StartQuote,
StringQuote,
Table,
+2
View File
@@ -13,6 +13,7 @@ enum class sql_command {
Create,
CreateTable,
CreateSchema,
CreateSequence,
CreateDatabase,
Update,
Insert,
@@ -21,6 +22,7 @@ enum class sql_command {
Drop,
DropTable,
DropSchema,
DropSequence,
DropDatabase,
Alter,
AlterTable,