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"
17struct [[nodiscard]] SqlLastInsertIdQuery
19 std::string tableName;
20 SqlQueryFormatter
const* formatter;
22 [[nodiscard]] std::string
ToSql()
const
24 return formatter->QueryLastInsertId(tableName);
36 std::string&& table = {},
37 std::string&& alias = {})
noexcept;
49 return FromTable(std::string_view { table, N - 1 });
68 LIGHTWEIGHT_API SqlLastInsertIdQuery LastInsertId();
93 LIGHTWEIGHT_API SqlUpdateQueryBuilder Update(std::vector<
SqlVariant>* boundInputs =
nullptr) noexcept;
110 std::
string m_schema;
112 std::
string m_tableAlias;
117 std::
string&& alias) noexcept:
118 m_formatter { formatter },
119 m_table { std::move(table) },
120 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 & FromSchemaTable(std::string_view schema, std::string_view table)
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.
Compile-time gate for SELECT query construction.
LIGHTWEIGHT_API std::vector< std::string > ToSql(SqlQueryFormatter const &formatter, SqlMigrationPlanElement const &element)
Represents a value that can be any of the supported SQL data types.