public interface DatabaseAdapter
| Modifier and Type | Method and Description |
|---|---|
default String |
generateTableName(boolean quoteTableName,
String catalog,
String schemaName,
String tableName,
TableSchema tableSchema) |
default List<String> |
getAlterTableStatements(String tableName,
List<ColumnDescription> columnsToAdd,
boolean quoteTableName,
boolean quoteColumnNames) |
default String |
getColumnQuoteString() |
default String |
getCreateTableStatement(TableSchema tableSchema,
boolean quoteTableName,
boolean quoteColumnNames)
Generates a CREATE TABLE statement using the specified table schema
|
String |
getDescription() |
default String |
getInsertIgnoreStatement(String table,
List<String> columnNames,
Collection<String> uniqueKeyColumnNames)
Returns an SQL INSERT_IGNORE statement - i.e.
|
String |
getName() |
String |
getSelectStatement(String tableName,
String columnNames,
String whereClause,
String orderByClause,
Long limit,
Long offset)
Returns a SQL SELECT statement with the given clauses applied.
|
default String |
getSelectStatement(String tableName,
String columnNames,
String whereClause,
String orderByClause,
Long limit,
Long offset,
String columnForPartitioning)
Returns a SQL SELECT statement with the given clauses applied.
|
default String |
getSQLForDataType(int sqlType) |
default String |
getTableAliasClause(String tableName) |
default String |
getTableQuoteString() |
default int |
getTimesToAddColumnObjectsForUpsert()
Tells How many times the column values need to be inserted into the prepared statement.
|
default String |
getUpsertStatement(String table,
List<String> columnNames,
Collection<String> uniqueKeyColumnNames)
Returns an SQL UPSERT statement - i.e.
|
default boolean |
supportsCreateTableIfNotExists() |
default boolean |
supportsInsertIgnore()
Tells whether this adapter supports INSERT_IGNORE.
|
default boolean |
supportsUpsert()
Tells whether this adapter supports UPSERT.
|
default String |
unwrapIdentifier(String identifier)
Returns a bare identifier string by removing wrapping escape characters
from identifier strings such as table and column names.
|
String getName()
String getDescription()
String getSelectStatement(String tableName, String columnNames, String whereClause, String orderByClause, Long limit, Long offset)
tableName - The name of the table to fetch rows fromcolumnNames - The names of the columns to fetch from the tablewhereClause - The filter to apply to the statement. This should not include the WHERE keywordorderByClause - The columns/clause used for ordering the result rows. This should not include the ORDER BY keywordslimit - The value for the LIMIT clause (i.e. the number of rows to return)offset - The value for the OFFSET clause (i.e. the number of rows to skip)default String getSelectStatement(String tableName, String columnNames, String whereClause, String orderByClause, Long limit, Long offset, String columnForPartitioning)
tableName - The name of the table to fetch rows fromcolumnNames - The names of the columns to fetch from the tablewhereClause - The filter to apply to the statement. This should not include the WHERE keywordorderByClause - The columns/clause used for ordering the result rows. This should not include the ORDER BY keywordslimit - The value for the LIMIT clause (i.e. the number of rows to return)offset - The value for the OFFSET clause (i.e. the number of rows to skip)columnForPartitioning - The (optional) column name that, if provided, the limit and offset values are based on values from the column itself (rather than the row number)default boolean supportsUpsert()
default boolean supportsInsertIgnore()
default int getTimesToAddColumnObjectsForUpsert()
default String getUpsertStatement(String table, List<String> columnNames, Collection<String> uniqueKeyColumnNames)
supportsUpsert()!table - The name of the table in which to update/insert a record into.columnNames - The name of the columns in the table to add values to.uniqueKeyColumnNames - The name of the columns that form a unique key.default String getInsertIgnoreStatement(String table, List<String> columnNames, Collection<String> uniqueKeyColumnNames)
supportsInsertIgnore()!table - The name of the table in which to ignore/insert a record into.columnNames - The name of the columns in the table to add values to.uniqueKeyColumnNames - The name of the columns that form a unique key.default String unwrapIdentifier(String identifier)
Returns a bare identifier string by removing wrapping escape characters from identifier strings such as table and column names.
The default implementation of this method removes double quotes. If the target database engine supports different escape characters, then its DatabaseAdapter implementation should override this method so that such escape characters can be removed properly.
identifier - An identifier which may be wrapped with escape charactersdefault String getTableQuoteString()
default String getColumnQuoteString()
default boolean supportsCreateTableIfNotExists()
default String getCreateTableStatement(TableSchema tableSchema, boolean quoteTableName, boolean quoteColumnNames)
tableSchema - The table schema including column informationquoteTableName - Whether to quote the table name in the generated DDLquoteColumnNames - Whether to quote column names in the generated DDLdefault List<String> getAlterTableStatements(String tableName, List<ColumnDescription> columnsToAdd, boolean quoteTableName, boolean quoteColumnNames)
default String getSQLForDataType(int sqlType)
default String generateTableName(boolean quoteTableName, String catalog, String schemaName, String tableName, TableSchema tableSchema)
Copyright © 2023 Apache NiFi Project. All rights reserved.