Lightweight 0.20250904.0
Loading...
Searching...
No Matches
Lightweight::SqlQueryBuilder Class Referencefinal

API Entry point for building SQL queries. More...

#include <SqlQuery.hpp>

Public Member Functions

 SqlQueryBuilder (SqlQueryFormatter const &formatter, std::string &&table={}, std::string &&alias={}) noexcept
 Constructs a new query builder for the given table.
 
LIGHTWEIGHT_API SqlQueryBuilderFromTable (std::string table)
 Constructs a new query builder for the given table.
 
LIGHTWEIGHT_API SqlQueryBuilderFromTable (std::string_view table)
 Constructs a new query builder for the given table.
 
template<size_t N>
SqlQueryBuilderFromTable (char const (&table)[N])
 Constructs a new query builder for the given table.
 
LIGHTWEIGHT_API SqlQueryBuilderFromTableAs (std::string table, std::string alias)
 Constructs a new query builder for the given table with an alias.
 
LIGHTWEIGHT_API SqlInsertQueryBuilder Insert (std::vector< SqlVariant > *boundInputs=nullptr) noexcept
 
LIGHTWEIGHT_API SqlLastInsertIdQuery LastInsertId ()
 Constructs a query to retrieve the last insert ID for the given table.
 
LIGHTWEIGHT_API SqlSelectQueryBuilder Select () noexcept
 Initiates SELECT query building.
 
LIGHTWEIGHT_API SqlUpdateQueryBuilder Update (std::vector< SqlVariant > *boundInputs=nullptr) noexcept
 
LIGHTWEIGHT_API SqlDeleteQueryBuilder Delete () noexcept
 Initiates DELETE query building.
 
LIGHTWEIGHT_API SqlMigrationQueryBuilder Migration ()
 Initiates query for building database migrations.
 

Detailed Description

API Entry point for building SQL queries.

Definition at line 28 of file SqlQuery.hpp.

Constructor & Destructor Documentation

◆ SqlQueryBuilder()

LIGHTWEIGHT_FORCE_INLINE Lightweight::SqlQueryBuilder::SqlQueryBuilder ( SqlQueryFormatter const &  formatter,
std::string &&  table = {},
std::string &&  alias = {} 
)
inlineexplicitnoexcept

Constructs a new query builder for the given table.

Definition at line 84 of file SqlQuery.hpp.

Member Function Documentation

◆ FromTable()

template<size_t N>
SqlQueryBuilder & Lightweight::SqlQueryBuilder::FromTable ( char const (&)  table[N])
inline

Constructs a new query builder for the given table.

Definition at line 44 of file SqlQuery.hpp.

◆ Insert()

LIGHTWEIGHT_API SqlInsertQueryBuilder Lightweight::SqlQueryBuilder::Insert ( std::vector< SqlVariant > *  boundInputs = nullptr)
noexcept

Initiates INSERT query building

Parameters
boundInputsOptional vector to store bound inputs. If provided, the inputs will be appended to this vector and can be used to bind the values to the query via SqlStatement::ExecuteWithVariants(...)

Referenced by Lightweight::DataMapper::CreateExplicit().

◆ Update()

LIGHTWEIGHT_API SqlUpdateQueryBuilder Lightweight::SqlQueryBuilder::Update ( std::vector< SqlVariant > *  boundInputs = nullptr)
noexcept

Initiates UPDATE query building.

Parameters
boundInputsOptional vector to store bound inputs. If provided, the inputs will be appended to this vector and can be used to bind the values to the query via SqlStatement::ExecuteWithVariants(...)

Referenced by Lightweight::DataMapper::Update().


The documentation for this class was generated from the following file: