Lightweight 0.20261105.1
Loading...
Searching...
No Matches
SqlQueryFormatter.hpp
1// SPDX-License-Identifier: Apache-2.0
2
3#pragma once
4
5#include "Api.hpp"
6#include "SqlConnection.hpp"
7#include "SqlQuery/MigrationPlan.hpp"
8#include "SqlServerType.hpp"
9
10#include <string>
11#include <string_view>
12
13namespace Lightweight
14{
15
16class SqlAdvisoryLockHandler;
17class SqlRetryClassifier;
18
19/// API to format SQL queries for different SQL dialects.
20class [[nodiscard]] LIGHTWEIGHT_API SqlQueryFormatter
21{
22 public:
23 /// Default constructor.
24 SqlQueryFormatter() = default;
25 /// Default move constructor.
27 /// Default copy constructor.
29 /// Default move assignment operator.
31 /// Default copy assignment operator.
33 virtual ~SqlQueryFormatter() = default;
34
35 /// Converts a boolean value to a string literal.
36 [[nodiscard]] virtual std::string_view BooleanLiteral(bool value) const noexcept = 0;
37
38 /// Returns the SQL function name used to retrieve the current date.
39 [[nodiscard]] virtual std::string_view DateFunction() const noexcept = 0;
40
41 /// Converts a string value to a string literal.
42 [[nodiscard]] virtual std::string StringLiteral(std::string_view value) const noexcept = 0;
43
44 /// Converts a character value to a string literal.
45 [[nodiscard]] virtual std::string StringLiteral(char value) const noexcept = 0;
46
47 /// Converts a binary value to a hex-encoded string literal.
48 [[nodiscard]] virtual std::string BinaryLiteral(std::span<uint8_t const> data) const = 0;
49
50 /// Formats a qualified table name with proper quoting for this database.
51 /// @param schema The schema name (can be empty for default schema)
52 /// @param table The table name
53 /// @return The properly quoted qualified table name (e.g., "schema"."table" or [schema].[table])
54 [[nodiscard]] virtual std::string QualifiedTableName(std::string_view schema, std::string_view table) const = 0;
55
56 /// Constructs an SQL INSERT query.
57 ///
58 /// @param intoTable The table to insert into.
59 /// @param fields The fields to insert into.
60 /// @param values The values to insert.
61 ///
62 /// The fields and values must be in the same order.
63 [[nodiscard]] virtual std::string Insert(std::string_view intoTable,
64 std::string_view fields,
65 std::string_view values) const = 0;
66
67 /// Constructs an SQL INSERT query with a schema prefix.
68 [[nodiscard]] virtual std::string Insert(std::string_view schema,
69 std::string_view intoTable,
70 std::string_view fields,
71 std::string_view values) const = 0;
72
73 /// Retrieves the last insert ID of the given table.
74 [[nodiscard]] virtual std::string QueryLastInsertId(std::string_view tableName) const = 0;
75
76 /// Constructs an SQL SELECT query for all rows.
77 ///
78 /// In all Select* functions @p groupBy is the GROUP BY clause followed by the HAVING clause, if the
79 /// query has one, and has to be emitted as one piece between the WHERE and the ORDER BY clause.
80 [[nodiscard]] virtual std::string SelectAll(bool distinct,
81 std::string_view fields,
82 std::string_view fromTable,
83 std::string_view fromTableAlias,
84 std::string_view tableJoins,
85 std::string_view whereCondition,
86 std::string_view orderBy,
87 std::string_view groupBy) const = 0;
88
89 /// Constructs an SQL SELECT query for the first row.
90 ///
91 /// When @p groupBy is non-empty it is emitted between the WHERE and the ORDER BY clause, so
92 /// the row limit given by @p count applies to the grouped result set.
93 [[nodiscard]] virtual std::string SelectFirst(bool distinct,
94 std::string_view fields,
95 std::string_view fromTable,
96 std::string_view fromTableAlias,
97 std::string_view tableJoins,
98 std::string_view whereCondition,
99 std::string_view orderBy,
100 std::string_view groupBy,
101 size_t count) const = 0;
102
103 /// Constructs an SQL SELECT query for a range of rows.
104 [[nodiscard]] virtual std::string SelectRange(bool distinct,
105 std::string_view fields,
106 std::string_view fromTable,
107 std::string_view fromTableAlias,
108 std::string_view tableJoins,
109 std::string_view whereCondition,
110 std::string_view orderBy,
111 std::string_view groupBy,
112 std::size_t offset,
113 std::size_t limit) const = 0;
114
115 /// Constructs an SQL SELECT query retrieve the count of rows matching the given condition.
116 ///
117 /// When @p groupBy is non-empty the query counts the rows of each group, i.e. it yields one
118 /// row per group rather than a single total.
119 [[nodiscard]] virtual std::string SelectCount(bool distinct,
120 std::string_view fromTable,
121 std::string_view fromTableAlias,
122 std::string_view tableJoins,
123 std::string_view whereCondition,
124 std::string_view groupBy) const = 0;
125
126 /// Constructs an SQL UPDATE query.
127 [[nodiscard]] virtual std::string Update(std::string_view table,
128 std::string_view tableAlias,
129 std::string_view setFields,
130 std::string_view whereCondition) const = 0;
131
132 /// Constructs an SQL DELETE query.
133 [[nodiscard]] virtual std::string Delete(std::string_view fromTable,
134 std::string_view fromTableAlias,
135 std::string_view tableJoins,
136 std::string_view whereCondition) const = 0;
137
138 /// Alias for a list of SQL statement strings.
139 using StringList = std::vector<std::string>;
140
141 /// Convert the given column type definition to the SQL type.
142 [[nodiscard]] virtual std::string ColumnType(SqlColumnTypeDefinition const& type) const = 0;
143
144 /// Constructs an SQL CREATE TABLE query.
145 ///
146 /// @param schema The schema name of the table to create.
147 /// @param tableName The name of the table to create.
148 /// @param columns The columns of the table.
149 /// @param foreignKeys The foreign key constraints of the table.
150 /// @param ifNotExists If true, generates CREATE TABLE IF NOT EXISTS instead of CREATE TABLE.
151 [[nodiscard]] virtual StringList CreateTable(std::string_view schema,
152 std::string_view tableName,
153 std::vector<SqlColumnDeclaration> const& columns,
154 std::vector<SqlCompositeForeignKeyConstraint> const& foreignKeys,
155 bool ifNotExists = false) const = 0;
156
157 /// Constructs an SQL ALTER TABLE query.
158 [[nodiscard]] virtual StringList AlterTable(std::string_view schema,
159 std::string_view tableName,
160 std::vector<SqlAlterTableCommand> const& commands) const = 0;
161
162 /// Constructs an SQL DROP TABLE query.
163 ///
164 /// @param schema The schema name of the table to drop.
165 /// @param tableName The name of the table to drop.
166 /// @param ifExists If true, generates DROP TABLE IF EXISTS instead of DROP TABLE.
167 /// @param cascade If true, drops all foreign key constraints referencing this table first.
168 [[nodiscard]] virtual StringList DropTable(std::string_view schema,
169 std::string_view const& tableName,
170 bool ifExists = false,
171 bool cascade = false) const = 0;
172
173 /// Returns the SQL query to retrieve the full server version string.
174 ///
175 /// This query returns detailed version information specific to each database:
176 /// - SQL Server: Returns result of SELECT @@VERSION (includes build, edition, OS info)
177 /// - PostgreSQL: Returns result of SELECT version() (includes build info)
178 /// - SQLite: Returns result of SELECT sqlite_version()
179 [[nodiscard]] virtual std::string QueryServerVersion() const = 0;
180
181 /// Retrieves the SQL query formatter for SQLite.
182 static SqlQueryFormatter const& Sqlite();
183
184 /// Retrieves the SQL query formatter for Microsoft SQL server.
185 static SqlQueryFormatter const& SqlServer();
186
187 /// Retrieves the SQL query formatter for PostgreSQL.
188 static SqlQueryFormatter const& PostgrSQL();
189
190 /// Retrieves the SQL query formatter for the given SqlServerType.
191 static SqlQueryFormatter const* Get(SqlServerType serverType) noexcept;
192
193 /// @brief Whether the dialect must rebuild a table to apply an `ALTER TABLE` schema change that it
194 /// cannot express in place — adding/dropping a foreign-key constraint, or altering a column's
195 /// type/nullability (`ALTER TABLE … ADD/DROP CONSTRAINT` / `… ALTER COLUMN`).
196 ///
197 /// SQLite returns `true`; every other backend defaults to `false`. The migration executor consults
198 /// this (via @ref SqlConnection::RequiresTableRebuildForSchemaChange) to decide whether to take the
199 /// table-rebuild path for the `-- LIGHTWEIGHT_SQLITE_GUARD:` sentinels these dialects emit.
200 [[nodiscard]] virtual bool RequiresTableRebuildForSchemaChange() const noexcept
201 {
202 return false;
203 }
204
205 /// @brief The per-table hint that asks for a dirty read (READ UNCOMMITTED) of one table in a SELECT.
206 ///
207 /// Rendered right after a table reference (and its alias) in the FROM clause and in each JOIN of a
208 /// query built with @ref SqlSelectQueryBuilder::ReadUncommitted. Only that statement is affected;
209 /// the connection's transaction isolation level is left alone.
210 ///
211 /// Defaults to an empty string, meaning the dialect has no per-table hint and renders the
212 /// statement unchanged. SQL Server returns `" WITH (READUNCOMMITTED)"`.
213 ///
214 /// @return The hint text including its leading space, or an empty string. The text must stay
215 /// valid for as long as the formatter does.
216 [[nodiscard]] virtual std::string_view ReadUncommittedTableHint() const noexcept
217 {
218 return {};
219 }
220
221 /// @brief Whether the dialect provides a batched, whole-database schema-introspection
222 /// fast path that `SqlSchema::ReadAllTables` can use instead of the per-table ODBC
223 /// catalog loop.
224 ///
225 /// Defaults to `false`, meaning the generic per-table catalog reader is used.
226 /// SQL Server returns `true`: it can answer the entire schema with a handful of
227 /// `sys.*` queries, collapsing thousands of per-table round-trips into a few.
228 /// The batched path must produce byte-identical schema metadata to the legacy path.
229 ///
230 /// @return `true` if the dialect supports the batched fast path, `false` otherwise.
231 [[nodiscard]] virtual bool SupportsBatchedSchemaIntrospection() const noexcept
232 {
233 return false;
234 }
235
236 /// @brief Whether the dialect treats narrow (`CHAR`/`VARCHAR`) and wide
237 /// (`NCHAR`/`NVARCHAR`) text as distinct types — distinct enough that a foreign key
238 /// between them is rejected and changing a column between them needs its dependent
239 /// constraints and indexes dropped first.
240 ///
241 /// Defaults to `false` (PostgreSQL and SQLite store both the same way). SQL Server
242 /// returns `true`.
243 ///
244 /// @return `true` if narrow and wide text are distinct types in this dialect.
245 [[nodiscard]] virtual bool DistinguishesNarrowAndWideText() const noexcept
246 {
247 return false;
248 }
249
250 /// @brief Largest number of values this dialect should be handed in a single `WHERE ... IN (...)`
251 /// predicate.
252 ///
253 /// The batched relation loading behind `Query<Record>().With<&Record::relation>()` resolves a whole
254 /// result set through `IN` predicates over the collected keys. Those keys are rendered as literals,
255 /// so a large batch would otherwise produce one enormous expression — SQL Server raises
256 /// "an expression services limit has been reached", and SQLite has its own parser limits. Splitting
257 /// the batch into chunks of this size keeps every generated statement inside what the dialect
258 /// accepts; the cost is one extra round-trip per chunk, still a constant number of queries per
259 /// relation instead of one per record.
260 ///
261 /// @return The maximum number of values per `IN` predicate. Defaults to 1000 for every dialect.
262 [[nodiscard]] virtual size_t MaxInPredicateValues() const noexcept
263 {
264 return 1000;
265 }
266
267 /// @brief Builds the canonical foreign-key constraint name for a set of columns.
268 ///
269 /// Produces `FK_<table>_<col1>[_<col2>…]`. A single-column FK collapses to
270 /// `FK_<table>_<col>`; a composite FK includes every column so that a composite
271 /// FK whose first column matches an existing single-column FK doesn't collide
272 /// on the constraint name (which MSSQL enforces as globally unique per DB).
273 ///
274 /// Consumers include the SQL Server, PostgreSQL and SQLite formatters —
275 /// centralising the convention here keeps CREATE/ALTER emission in sync with
276 /// DROP CONSTRAINT lookup (e.g. `SQLiteRebuildDropForeignKey`).
277 template <typename Range>
278 [[nodiscard]] static std::string BuildForeignKeyConstraintName(std::string_view tableName, Range const& columns)
279 {
280 std::string name { "FK_" };
281 name.append(tableName);
282 for (auto const& col: columns)
283 {
284 name.push_back('_');
285 name.append(col);
286 }
287 return name;
288 }
289
290 /// @brief Returns the SQL statement to execute after connect to make
291 /// `schema` the connection-level default for unqualified DDL/DML.
292 ///
293 /// Returns an empty string when the DBMS has no session-level concept of a
294 /// default schema (SQL Server, SQLite). Callers must skip emission for
295 /// empty results. PostgreSQL implements this via `SET search_path TO ...`.
296 ///
297 /// The `schema` value is interpolated into the statement; callers must
298 /// validate it (e.g. whitelist `[A-Za-z0-9_]`) before invoking.
299 [[nodiscard]] virtual std::string SetDefaultSchemaStatement(std::string_view schema) const
300 {
301 (void) schema;
302 return {};
303 }
304
305 /// @brief Returns the statements a connection executes after connecting to realise @p settings.
306 ///
307 /// Only the SQLite dialect has these settings, and emits one @c PRAGMA per setting; every other
308 /// dialect returns an empty list, which leaves the settings inert there.
309 ///
310 /// @param settings The connection's SQLite settings.
311 /// @return The statements to execute, in order; empty when there is nothing to apply.
312 [[nodiscard]] virtual StringList SqliteSettingsStatements(SqliteConnectionSettings const& settings) const
313 {
314 (void) settings;
315 return {};
316 }
317
318 /// @brief Returns the dialect-specific handler used by `SqlScopedLock` to
319 /// acquire and release named cross-process advisory locks.
320 ///
321 /// The returned reference is to a process-singleton, valid for the lifetime
322 /// of the program. Each backend implements its own primitive — SQL Server
323 /// uses `sp_getapplock`, PostgreSQL uses `pg_advisory_lock`, SQLite uses
324 /// a lock table — and the implementation lives in the backend's formatter
325 /// translation unit, so adding a new dialect only touches that unit and
326 /// `SqlScopedLock` itself stays dialect-agnostic.
327 [[nodiscard]] virtual SqlAdvisoryLockHandler const& AdvisoryLockOps() const = 0;
328
329 /// Returns the dialect's transient-error classifier, used by @c SqlRetryPolicy to decide
330 /// whether a failed statement is worth another attempt.
331 ///
332 /// Routing the classification through the formatter is what keeps per-DBMS error-code
333 /// knowledge out of business logic — the same reason @ref AdvisoryLockOps() exists.
334 [[nodiscard]] virtual SqlRetryClassifier const& RetryOps() const noexcept = 0;
335
336 /// @brief Whether the dialect resolves table and column names without regard to case, even
337 /// when they are quoted — so a declared `ITEM_NAME` names the live column `Item_Name`.
338 ///
339 /// Defaults to `false`. SQLite returns `true`. SQL Server returns `true` as well, which assumes
340 /// a case-insensitive database collation (the default); it is not probed per database.
341 /// PostgreSQL keeps quoted identifiers case-sensitive and returns `false`.
342 ///
343 /// New hooks are appended at the end of the class: that keeps the slots of the earlier ones for
344 /// callers, but a subclass outside this library must still be rebuilt.
345 ///
346 /// @return `true` if identifiers differing only in ASCII letter case name the same object.
347 [[nodiscard]] virtual bool IdentifiersAreCaseInsensitive() const noexcept
348 {
349 return false;
350 }
351
352 /// @brief Whether the dialect has schemas that tables can be created in.
353 ///
354 /// Defaults to `true`. SQLite returns `false`: it has no schemas, only attached databases.
355 ///
356 /// @return `true` if a table can be created in a named schema.
357 [[nodiscard]] virtual bool SupportsSchemas() const noexcept
358 {
359 return true;
360 }
361
362 /// @brief Returns the statement that creates @p schema unless it already exists.
363 ///
364 /// Returns an empty string when the dialect has no schemas (see @ref SupportsSchemas()).
365 ///
366 /// @param schema The schema to create.
367 /// @return The statement to execute, or an empty string when there is nothing to execute.
368 [[nodiscard]] virtual std::string CreateSchemaIfNotExists(std::string_view schema) const
369 {
370 (void) schema;
371 return {};
372 }
373
374 /// @brief Returns the statement that makes the session report affected-row counts again.
375 ///
376 /// Defaults to an empty string, meaning the dialect always reports them. SQL Server returns
377 /// `SET NOCOUNT OFF`: under `NOCOUNT ON` the driver may report 0 rows for a statement that
378 /// changed rows. The setting stays in effect for the session after the statement ran.
379 ///
380 /// @return The statement to execute, or an empty string when there is nothing to execute.
381 [[nodiscard]] virtual std::string_view ReportRowCountsStatement() const noexcept
382 {
383 return {};
384 }
385
386 /// @brief A query estimating a table's row count from the catalog's statistics, without reading the
387 /// table. It takes two parameters, the schema name and then the table name, and yields one integer.
388 ///
389 /// @return The query, or empty when the dialect keeps no such statistics; callers then count with
390 /// `SELECT COUNT(*)`, which reads the whole table.
391 [[nodiscard]] virtual std::string_view TableRowCountEstimateQuery() const noexcept
392 {
393 return {};
394 }
395
396 /// @brief Whether the dialect has a native GUID/UUID column type (as opposed to storing GUIDs as text).
397 ///
398 /// Defaults to `false`. SQL Server (`UNIQUEIDENTIFIER`) and PostgreSQL (`UUID`) return `true`.
399 ///
400 /// @return `true` if GUID columns are stored in a dedicated binary type.
401 [[nodiscard]] virtual bool HasNativeGuidType() const noexcept
402 {
403 return false;
404 }
405
406 /// @brief Whether comparing a fixed-width CHAR(n) column pads the shorter operand with spaces.
407 ///
408 /// Defaults to `true`. SQLite returns `false`: it stores CHAR(n) as plain text and compares it verbatim.
409 ///
410 /// @return `true` if trailing spaces of CHAR(n) values are insignificant in comparisons.
411 [[nodiscard]] virtual bool ComparesFixedCharWithPadSemantics() const noexcept
412 {
413 return true;
414 }
415
416 /// @brief Returns the name under which the dialect stores an unquoted identifier.
417 ///
418 /// Defaults to returning @p identifier unchanged. PostgreSQL folds unquoted identifiers to
419 /// lower case and returns the ASCII-lower-cased name.
420 ///
421 /// @param identifier The identifier as written without quotes.
422 /// @return The identifier as the catalog stores it.
423 [[nodiscard]] virtual std::string FoldUnquotedIdentifier(std::string_view identifier) const
424 {
425 return std::string(identifier);
426 }
427
428 /// @brief Whether the driver's parameter status array names exactly the parameter sets that
429 /// failed when a batch (parameter array) execution fails.
430 ///
431 /// Defaults to `false`. SQL Server returns `true`: ODBC Driver 18 executes every parameter set and
432 /// marks only the failing ones `SQL_PARAM_ERROR`. PostgreSQL's psqlodbc marks every parameter set
433 /// of a failed array `SQL_PARAM_ERROR`, and the SQLite ODBC driver does not fill the array at all,
434 /// so their failing rows are found by bisection instead.
435 ///
436 /// @return `true` if the rows marked `SQL_PARAM_ERROR` may be trusted to be the failing ones.
437 [[nodiscard]] virtual bool ParameterStatusIdentifiesFailedRows() const noexcept
438 {
439 return false;
440 }
441
442 /// @brief Whether a bulk load should commit periodically rather than hold all its rows in one
443 /// transaction.
444 ///
445 /// Defaults to `false`. SQLite returns `true`: its write-ahead log grows with the open
446 /// transaction, so a restore commits every `RestoreSettings::maxRowsPerCommit` rows of a chunk.
447 ///
448 /// @return `true` if a bulk load bounds the rows per transaction.
449 [[nodiscard]] virtual bool BoundsBulkLoadTransactionSize() const noexcept
450 {
451 return false;
452 }
453
454 protected:
455 /// Formats a table name with optional schema prefix.
456 static std::string FormatTableName(std::string_view schema, std::string_view table);
457
458 /// Doubles every @p quote in @p text, so @p text can be embedded between two such quotes.
459 /// @param text The text to embed.
460 /// @param quote The quote character that delimits the embedded text.
461 /// @return @p text with each @p quote doubled.
462 static std::string DoubleQuoteCharacter(std::string_view text, char quote);
463};
464
465} // namespace Lightweight
API to format SQL queries for different SQL dialects.
virtual size_t MaxInPredicateValues() const noexcept
Largest number of values this dialect should be handed in a single WHERE ... IN (....
virtual bool SupportsBatchedSchemaIntrospection() const noexcept
Whether the dialect provides a batched, whole-database schema-introspection fast path that SqlSchema:...
virtual bool DistinguishesNarrowAndWideText() const noexcept
Whether the dialect treats narrow (CHAR/VARCHAR) and wide (NCHAR/NVARCHAR) text as distinct types — d...
virtual std::string SetDefaultSchemaStatement(std::string_view schema) const
Returns the SQL statement to execute after connect to make schema the connection-level default for un...
virtual std::string CreateSchemaIfNotExists(std::string_view schema) const
Returns the statement that creates schema unless it already exists.
SqlQueryFormatter(SqlQueryFormatter const &)=default
Default copy constructor.
virtual std::string_view ReportRowCountsStatement() const noexcept
Returns the statement that makes the session report affected-row counts again.
SqlQueryFormatter()=default
Default constructor.
SqlQueryFormatter & operator=(SqlQueryFormatter &&)=default
Default move assignment operator.
virtual SqlAdvisoryLockHandler const & AdvisoryLockOps() const =0
Returns the dialect-specific handler used by SqlScopedLock to acquire and release named cross-process...
static std::string BuildForeignKeyConstraintName(std::string_view tableName, Range const &columns)
Builds the canonical foreign-key constraint name for a set of columns.
virtual bool SupportsSchemas() const noexcept
Whether the dialect has schemas that tables can be created in.
virtual bool BoundsBulkLoadTransactionSize() const noexcept
Whether a bulk load should commit periodically rather than hold all its rows in one transaction.
virtual std::string_view ReadUncommittedTableHint() const noexcept
The per-table hint that asks for a dirty read (READ UNCOMMITTED) of one table in a SELECT.
virtual std::string_view DateFunction() const noexcept=0
Returns the SQL function name used to retrieve the current date.
static std::string DoubleQuoteCharacter(std::string_view text, char quote)
virtual StringList SqliteSettingsStatements(SqliteConnectionSettings const &settings) const
Returns the statements a connection executes after connecting to realise settings.
std::vector< std::string > StringList
Alias for a list of SQL statement strings.
virtual bool ParameterStatusIdentifiesFailedRows() const noexcept
Whether the driver's parameter status array names exactly the parameter sets that failed when a batch...
virtual bool HasNativeGuidType() const noexcept
Whether the dialect has a native GUID/UUID column type (as opposed to storing GUIDs as text).
SqlQueryFormatter(SqlQueryFormatter &&)=default
Default move constructor.
virtual SqlRetryClassifier const & RetryOps() const noexcept=0
SqlQueryFormatter & operator=(SqlQueryFormatter const &)=default
Default copy assignment operator.
virtual std::string_view BooleanLiteral(bool value) const noexcept=0
Converts a boolean value to a string literal.
static std::string FormatTableName(std::string_view schema, std::string_view table)
Formats a table name with optional schema prefix.
virtual std::string_view TableRowCountEstimateQuery() const noexcept
A query estimating a table's row count from the catalog's statistics, without reading the table....
virtual std::string FoldUnquotedIdentifier(std::string_view identifier) const
Returns the name under which the dialect stores an unquoted identifier.
virtual bool ComparesFixedCharWithPadSemantics() const noexcept
Whether comparing a fixed-width CHAR(n) column pads the shorter operand with spaces.
Dialect-specific classification of SQL errors into transient and permanent.
std::variant< SqlAlterTableCommands::RenameTable, SqlAlterTableCommands::AddColumn, SqlAlterTableCommands::AddColumnIfNotExists, SqlAlterTableCommands::AlterColumn, SqlAlterTableCommands::AddIndex, SqlAlterTableCommands::RenameColumn, SqlAlterTableCommands::DropColumn, SqlAlterTableCommands::DropColumnIfExists, SqlAlterTableCommands::DropIndex, SqlAlterTableCommands::DropIndexIfExists, SqlAlterTableCommands::AddForeignKey, SqlAlterTableCommands::AddCompositeForeignKey, SqlAlterTableCommands::DropForeignKey > SqlAlterTableCommand
Represents a single SQL ALTER TABLE command.
Represents a SQL column declaration.
Represents a composite foreign key constraint.
Connection-level settings applied when a connection to a SQLite database is established.