myTinySQL v0.2.0-2-g5000098
A tiny SQL interpreter over fixed-width text files
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
tinysql::TableSchema Struct Reference

The definition of one table: its name, its columns, and the length of a row. More...

#include <Catalog.hpp>

Public Member Functions

std::optional< std::size_t > indexOf (std::string_view columnName) const
 Finds a column by name.
 
bool hasAutoId () const
 Tells whether rows are numbered automatically.
 

Public Attributes

std::string name
 Table name, e.g. EMPLOY.
 
std::vector< Column > columns
 Columns in file order.
 
std::size_t recordLength = 0
 Length of a full row, in characters.
 

Detailed Description

The definition of one table: its name, its columns, and the length of a row.

Definition at line 31 of file Catalog.hpp.

Member Function Documentation

◆ hasAutoId()

bool tinysql::TableSchema::hasAutoId ( ) const

Tells whether rows are numbered automatically.

Returns
True when the first column is called ID; INSERT then fills it in.

Definition at line 69 of file Catalog.cpp.

◆ indexOf()

std::optional< std::size_t > tinysql::TableSchema::indexOf ( std::string_view  columnName) const

Finds a column by name.

Parameters
columnNameThe name to look for (case-insensitive).
Returns
The column's position in columns, or std::nullopt if there is no such column.

Definition at line 60 of file Catalog.cpp.

Member Data Documentation

◆ columns

std::vector<Column> tinysql::TableSchema::columns

Columns in file order.

Definition at line 33 of file Catalog.hpp.

◆ name

std::string tinysql::TableSchema::name

Table name, e.g. EMPLOY.

Definition at line 32 of file Catalog.hpp.

◆ recordLength

std::size_t tinysql::TableSchema::recordLength = 0

Length of a full row, in characters.

Definition at line 34 of file Catalog.hpp.


The documentation for this struct was generated from the following files: