5#include "SqlQuery/Delete.hpp"
6#include "SqlQuery/Insert.hpp"
7#include "SqlQuery/Migrate.hpp"
8#include "SqlQuery/Select.hpp"
9#include "SqlQuery/Update.hpp"
14struct [[nodiscard]] SqlLastInsertIdQuery
16 std::string tableName;
17 SqlQueryFormatter
const* formatter;
19 [[nodiscard]] std::string ToSql()
const
21 return formatter->QueryLastInsertId(tableName);
33 std::string&& table = {},
34 std::string&& alias = {})
noexcept;
46 return FromTable(std::string_view { table, N - 1 });
60 LIGHTWEIGHT_API SqlLastInsertIdQuery LastInsertId();
70 LIGHTWEIGHT_API SqlUpdateQueryBuilder Update(std::vector<
SqlVariant>* boundInputs =
nullptr) noexcept;
81 std::
string m_tableAlias;
86 std::
string&& alias) noexcept:
87 m_formatter { formatter },
88 m_table { std::move(table) },
89 m_tableAlias { std::move(alias) }
Query builder for building DELETE FROM ... queries.
Query builder for building INSERT INTO ... queries.
Query builder for building SQL migration queries.
API Entry point for building SQL queries.
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 & FromTable(std::string table)
Constructs a new query builder for the given table.
LIGHTWEIGHT_API SqlInsertQueryBuilder Insert(std::vector< SqlVariant > *boundInputs=nullptr) noexcept
SqlQueryBuilder & FromTable(char const (&table)[N])
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.
Query builder for building SELECT ... queries.
Represents a value that can be any of the supported SQL data types.