xale-db 1.0
minimal SQL engine, written in c++
Loading...
Searching...
No Matches
Xale::Query Namespace Reference

Classes

class  BasicParser
 Basic implementation of SQL parser. More...
class  BasicTokenizer
 Basic implementation of SQL tokenizer. More...
class  IParser
 Interface for SQL parsers. More...
class  ITokenizer
 Interface for SQL tokenizer that converts an input string into a sequence of tokens. More...
struct  Expression
 Base expression structure. More...
struct  BinaryExpression
 Binary expression. More...
struct  WhereClause
 WHERE clause representation. More...
struct  Statement
 Base statement structure. More...
struct  SelectStatement
 SELECT statement structure. More...
struct  InsertStatement
 INSERT statement structure. More...
struct  UpdateStatement
 UPDATE statement structure. More...
struct  DeleteStatement
 DELETE statement structure. More...
struct  ColumnDefinitionStmt
 Column definition for CREATE TABLE statement structure. More...
struct  CreateStatement
 CREATE TABLE statement structure. More...
struct  DropStatement
 DROP TABLE statement structure. More...
struct  ListStatement
 LIST TABLE statement structure. More...
struct  Token
 Token struct defined by type, value and pos. More...

Enumerations

enum class  StatementType {
  Select , Insert , Update , Delete ,
  Create , Drop , List , Unknown
}
 Types of SQL statements. More...
enum class  ExpressionType {
  Identifier , StringLiteral , NumericLiteral , BinaryOp ,
  Wildcard
}
 Types of expression nodes. More...
enum class  TokenType {
  DefinitionKeyword , ManipulationKeyword , QueryKeyword , JoinKeyword ,
  LogicalKeyword , Operator , Identifier , StringLiteral ,
  NumericLiteral , EndOfInput , Unknown
}
 Types of possible tokens. More...

Functions

 DECLARE_TOKENS (sql_definition_kw, "CREATE", "ALTER", "DROP", "LIST")
 DECLARE_TOKENS (sql_manipulation_kw, "SELECT", "INSERT", "UPDATE", "DELETE")
 DECLARE_TOKENS (sql_query_kw, "FROM", "WHERE")
 DECLARE_TOKENS (sql_join_kw, "JOIN", "LEFT", "RIGHT")
 DECLARE_TOKENS (sql_logical_kw, "AND", "OR", "NOT")
 DECLARE_TOKENS (sql_operators, "*", ",", "(", ")", "=", "!=", "<", ">", "<=", ">=")
 DECLARE_TOKENS (sql_end_query, ";")
const std::string to_string (TokenType type)
 Convert TokenType to string.

Enumeration Type Documentation

◆ ExpressionType

enum class Xale::Query::ExpressionType
strong

Types of expression nodes.

Enumerator
Identifier 
StringLiteral 
NumericLiteral 
BinaryOp 
Wildcard 

◆ StatementType

enum class Xale::Query::StatementType
strong

Types of SQL statements.

Enumerator
Select 
Insert 
Update 
Delete 
Create 
Drop 
List 
Unknown 

◆ TokenType

enum class Xale::Query::TokenType
strong

Types of possible tokens.

Enumerator
DefinitionKeyword 
ManipulationKeyword 
QueryKeyword 
JoinKeyword 
LogicalKeyword 
Operator 
Identifier 
StringLiteral 
NumericLiteral 
EndOfInput 
Unknown 

Function Documentation

◆ DECLARE_TOKENS() [1/7]

Xale::Query::DECLARE_TOKENS ( sql_definition_kw ,
"CREATE" ,
"ALTER" ,
"DROP" ,
"LIST"  )

◆ DECLARE_TOKENS() [2/7]

Xale::Query::DECLARE_TOKENS ( sql_end_query ,
";"  )

◆ DECLARE_TOKENS() [3/7]

Xale::Query::DECLARE_TOKENS ( sql_join_kw ,
"JOIN" ,
"LEFT" ,
"RIGHT"  )

◆ DECLARE_TOKENS() [4/7]

Xale::Query::DECLARE_TOKENS ( sql_logical_kw ,
"AND" ,
"OR" ,
"NOT"  )

◆ DECLARE_TOKENS() [5/7]

Xale::Query::DECLARE_TOKENS ( sql_manipulation_kw ,
"SELECT" ,
"INSERT" ,
"UPDATE" ,
"DELETE"  )

◆ DECLARE_TOKENS() [6/7]

Xale::Query::DECLARE_TOKENS ( sql_operators ,
"*" ,
" ,
" ,
"(", ")"  )

◆ DECLARE_TOKENS() [7/7]

Xale::Query::DECLARE_TOKENS ( sql_query_kw ,
"FROM" ,
"WHERE"  )

◆ to_string()

const std::string Xale::Query::to_string ( TokenType type)
inline

Convert TokenType to string.

Returns
string representation of TokenType