|
Lightweight 0.20260617.0
|
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 SqlQueryBuilder & | FromTable (std::string table) |
| Constructs a new query builder for the given table. | |
| LIGHTWEIGHT_API SqlQueryBuilder & | FromTable (std::string_view table) |
| Constructs a new query builder for the given table. | |
| template<size_t N> | |
| SqlQueryBuilder & | FromTable (char const (&table)[N]) |
| Constructs a new query builder for the given table. | |
| LIGHTWEIGHT_API SqlQueryBuilder & | FromTableAs (std::string table, std::string alias) |
| Constructs a new query builder for the given table with an alias. | |
| LIGHTWEIGHT_API SqlQueryBuilder & | FromSchemaTable (std::string_view schema, std::string_view table) |
| 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 SqlSelectQueryStarter | Select () noexcept |
| 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. | |
API Entry point for building SQL queries.
Definition at line 31 of file SqlQuery.hpp.
|
inlineexplicitnoexcept |
Constructs a new query builder for the given table.
Definition at line 101 of file SqlQuery.hpp.
|
inline |
Constructs a new query builder for the given table.
Definition at line 47 of file SqlQuery.hpp.
| LIGHTWEIGHT_API SqlQueryBuilder & Lightweight::SqlQueryBuilder::FromSchemaTable | ( | std::string_view | schema, |
| std::string_view | table | ||
| ) |
Constructs a new query builder for the given schema and table.
| schema | The schema name (e.g., "public", "dbo") |
| table | The table name |
|
noexcept |
Initiates INSERT query building
| boundInputs | Optional 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::CreateAll().
|
noexcept |
Initiates SELECT query building.
Returns a SqlSelectQueryStarter — a type that intentionally does not expose All / First / Range, so Select().All() and the equivalent auto q = Select(); q.All(); (both empty-projection patterns) fail to compile. Add a column via .Field(...), .Fields(...), .FieldAs(...), or .Build([](auto& q){ ... }) — each returns a SqlSelectQueryBuilder& that exposes the finalizers. .Count() is exposed on the starter directly, since SELECT COUNT(*) is well-formed without an explicit field list.
Referenced by Lightweight::DataMapper::QuerySingle().
|
noexcept |
Initiates UPDATE query building.
| boundInputs | Optional 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(), and Lightweight::DataMapper::UpdateAll().