|
myTinySQL v0.2.0-2-g5000098
A tiny SQL interpreter over fixed-width text files
|
Functions | |
| bool | matches (std::string_view fieldValue, const Condition &condition) |
| Applies a WHERE test to one value. | |
| ResultSet | fitted (std::vector< std::string > headers, std::vector< std::vector< std::string > > rows) |
| Builds a result whose column widths fit the headers and the values (used by DESCRIBE). | |
| std::string | plural (std::size_t n, std::string_view word) |
| Writes a count with a noun in singular or plural. | |
| void | checkName (std::string_view name, std::string_view what) |
| Checks a new table or column name. | |
Variables | |
| constexpr std::size_t | kMaxNameLength = 20 |
| Longest table or column name: the width of the TABLE and FIELD columns of SYSTEM_TABLE. | |
| constexpr std::size_t | kMaxRecordLength = 99999 |
| Longest row: SYSTEM_TABLE keeps column positions in 5 characters. | |
| void tinysql::anonymous_namespace{Session.cpp}::checkName | ( | std::string_view | name, |
| std::string_view | what | ||
| ) |
Checks a new table or column name.
| name | The name. |
| what | "table" or "column", for the error message. |
| SqlError | Unless the name starts with a letter, has only letters, digits, _ and -, and is at most kMaxNameLength characters long. |
Definition at line 91 of file Session.cpp.
| ResultSet tinysql::anonymous_namespace{Session.cpp}::fitted | ( | std::vector< std::string > | headers, |
| std::vector< std::vector< std::string > > | rows | ||
| ) |
Builds a result whose column widths fit the headers and the values (used by DESCRIBE).
| headers | The column titles. |
| rows | The values, one inner vector per row. |
Definition at line 54 of file Session.cpp.
| bool tinysql::anonymous_namespace{Session.cpp}::matches | ( | std::string_view | fieldValue, |
| const Condition & | condition | ||
| ) |
Applies a WHERE test to one value.
| fieldValue | The row's value in the tested column. |
| condition | The test. |
LIKE matches a pattern, ignoring case (see matchesLike()). The other operators compare numbers as numbers when both sides are integers, otherwise as case-sensitive text. Definition at line 26 of file Session.cpp.
| std::string tinysql::anonymous_namespace{Session.cpp}::plural | ( | std::size_t | n, |
| std::string_view | word | ||
| ) |
Writes a count with a noun in singular or plural.
| n | The count. |
| word | The noun in singular, e.g. "row". |
Definition at line 75 of file Session.cpp.
|
constexpr |
Longest table or column name: the width of the TABLE and FIELD columns of SYSTEM_TABLE.
Definition at line 81 of file Session.cpp.
|
constexpr |
Longest row: SYSTEM_TABLE keeps column positions in 5 characters.
Definition at line 84 of file Session.cpp.