myTinySQL v0.2.0-2-g5000098
A tiny SQL interpreter over fixed-width text files
Loading...
Searching...
No Matches
Functions | Variables
Session.cpp File Reference

Implementation of Session: running each kind of statement. More...

#include "Session.hpp"
#include <algorithm>
#include <compare>
#include <format>
#include <fstream>
#include <limits>
#include "Catalog.hpp"
#include "TableFile.hpp"
#include "Util.hpp"

Go to the source code of this file.

Functions

bool tinysql::anonymous_namespace{Session.cpp}::matches (std::string_view fieldValue, const Condition &condition)
 Applies a WHERE test to one value.
 
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).
 
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.
 
void tinysql::anonymous_namespace{Session.cpp}::checkName (std::string_view name, std::string_view what)
 Checks a new table or column name.
 

Variables

constexpr std::size_t tinysql::anonymous_namespace{Session.cpp}::kMaxNameLength = 20
 Longest table or column name: the width of the TABLE and FIELD columns of SYSTEM_TABLE.
 
constexpr std::size_t tinysql::anonymous_namespace{Session.cpp}::kMaxRecordLength = 99999
 Longest row: SYSTEM_TABLE keeps column positions in 5 characters.
 

Detailed Description

Implementation of Session: running each kind of statement.

Definition in file Session.cpp.