Interface ISqlDialect<SELECT extends SelectBuilder,INSERT extends InsertBuilder,UPDATE extends UpdateBuilder,DELETE extends DeleteBuilder,CREATE extends CreateBranchingBuilder,ALTER extends AlterBranchingBuilder,DROP extends DropBranchingBuilder,NEXT extends NextValueSequenceBuilder,LAST extends LastValueIdentityBuilder>
- Type Parameters:
SELECT- the generic typeINSERT- the generic typeUPDATE- the generic typeDELETE- the generic typeCREATE- the generic typeALTER- the generic typeDROP- the generic typeNEXT- the generic typeLAST- the generic type
- All Superinterfaces:
ISqlFactory<SELECT,,INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, NEXT, LAST> ISqlKeywords
- All Known Implementing Classes:
DefaultSqlDialect
public interface ISqlDialect<SELECT extends SelectBuilder,INSERT extends InsertBuilder,UPDATE extends UpdateBuilder,DELETE extends DeleteBuilder,CREATE extends CreateBranchingBuilder,ALTER extends AlterBranchingBuilder,DROP extends DropBranchingBuilder,NEXT extends NextValueSequenceBuilder,LAST extends LastValueIdentityBuilder>
extends ISqlFactory<SELECT,INSERT,UPDATE,DELETE,CREATE,ALTER,DROP,NEXT,LAST>, ISqlKeywords
The SQL Dialect interface.
-
Field Summary
FieldsFields inherited from interface org.eclipse.dirigible.database.sql.ISqlKeywords
ALTER, CLOSE, COMMA, DOT, EQUALS, FUNCTION_CURRENT_DATE, FUNCTION_CURRENT_TIME, FUNCTION_CURRENT_TIMESTAMP, KEYWORD_ADD, KEYWORD_ALTER, KEYWORD_AND, KEYWORD_AS, KEYWORD_ASC, KEYWORD_CHECK, KEYWORD_COLUMN, KEYWORD_COLUMNSTORE, KEYWORD_CONSTRAINT, KEYWORD_CREATE, KEYWORD_DATA, KEYWORD_DATABASE_DROP_CASCADE, KEYWORD_DATABASE_DROP_RESTRICT, KEYWORD_DELETE, KEYWORD_DESC, KEYWORD_DISTINCT, KEYWORD_DROP, KEYWORD_DYNAMIC, KEYWORD_EVENT, KEYWORD_EXTERNAL, KEYWORD_FETCH, KEYWORD_FOR, KEYWORD_FOR_UPDATE, KEYWORD_FOREIGN, KEYWORD_FROM, KEYWORD_FULL, KEYWORD_GLOBAL_TEMPORARY, KEYWORD_GLOBAL_TEMPORARY_COLUMN, KEYWORD_GROUP_BY, KEYWORD_HAVING, KEYWORD_HYBRID, KEYWORD_ICEBERG, KEYWORD_IDENTITY, KEYWORD_INDEX, KEYWORD_INNER, KEYWORD_INSERT, KEYWORD_INTO, KEYWORD_JOIN, KEYWORD_KEY, KEYWORD_LEFT, KEYWORD_LIKE, KEYWORD_LIMIT, KEYWORD_NEXT, KEYWORD_NEXT_VALUE_FOR, KEYWORD_NO, KEYWORD_NOT, KEYWORD_NULL, KEYWORD_OFFSET, KEYWORD_ON, KEYWORD_ONLY, KEYWORD_OR, KEYWORD_ORDER_BY, KEYWORD_OUTER, KEYWORD_PRIMARY, KEYWORD_PUBLIC, KEYWORD_REFERENCES, KEYWORD_RIGHT, KEYWORD_ROW, KEYWORD_ROWS, KEYWORD_ROWSTORE, KEYWORD_SCHEMA, KEYWORD_SELECT, KEYWORD_SEQUENCE, KEYWORD_SEQUENCE_CYCLE, KEYWORD_SEQUENCE_EMPTY_STRING_FOR_BOOLEAN_TYPES, KEYWORD_SEQUENCE_INCREMENT_BY, KEYWORD_SEQUENCE_MAXVALUE, KEYWORD_SEQUENCE_MINVALUE, KEYWORD_SEQUENCE_NO_MAXVALUE, KEYWORD_SEQUENCE_NO_MINVALUE, KEYWORD_SEQUENCE_RESET_BY, KEYWORD_SEQUENCE_RESTART_WITH, KEYWORD_SEQUENCE_START_WITH, KEYWORD_SET, KEYWORD_START, KEYWORD_SYNONYM, KEYWORD_TABLE, KEYWORD_TABLE_TYPE, KEYWORD_UNION, KEYWORD_UNIQUE, KEYWORD_UPDATE, KEYWORD_VALUES, KEYWORD_VIEW, KEYWORD_WHERE, KEYWORD_WITH, METADATA_ALIAS, METADATA_BASE_TABLE, METADATA_CALC_VIEW, METADATA_GLOBAL_TEMPORARY, METADATA_GLOBAL_TEMPORARY_COLUMN, METADATA_LOCAL_TEMPORARY, METADATA_SYNONYM, METADATA_SYSTEM_TABLE, METADATA_TABLE, METADATA_TABLE_STRUCTURES, METADATA_TABLE_TYPES, METADATA_VIEW, OPEN, QUESTION, SEMICOLON, SPACE, STAR, TABLE, UNDERSCROE -
Method Summary
Modifier and TypeMethodDescriptionall(Connection connection, String table) Count.All.intcount(Connection connection, String table) Count.countQuery(String table) Count.booleanexists(Connection connection, String name, int type) Check existence of an artifacts.booleanexistsSchema(Connection connection, String schema) Check existence of a schema.booleanexistsTable(Connection connection, String table) Check existence of a table.voidexportData(Connection connection, String table, OutputStream output) Export data.Gives the dialect specific name of the CURRENT_DATE function.Gives the dialect specific name of the CURRENT_TIME function.Gives the dialect specific name of the CURRENT_TIMESTAMP function.getDatabaseName(Connection connection) Returns the database name.getDataTypeName(DataType dataType) Default implementation returns the direct toString() conversion.Returns the escape symbol.Returns the function names.Returns the creation of fuzzy search index.Identity argument for a column for the create table script Default is "IDENTITY".NOT NULL argument for a column for the create table script Default is "NOT NULL".PRIMARY KEY argument for a column for the create table script Default is "PRIMARY KEY".If the database supports schema filtering SQL statements (seeisSchemaFilterSupported()), this method provides the corresponding SQL statement.UNIQUE argument for a column for the create table script Default is "UNIQUE".voidimportData(Connection connection, String table, InputStream input) Import data.booleanDoes this database support catalogs synonymous to schemas.booleanChecks if the database is capable of schema-level filtering statements (e.g. to reduce the provisioned schemas down to those that the current user is entitled to see).booleanChecks if the database is capable to create and use Sequences.booleanChecks if the database is capable to create and use Synonyms.Methods inherited from interface org.eclipse.dirigible.database.sql.ISqlFactory
alter, create, delete, drop, exists, expression, getDatabaseType, insert, lastval, nextval, select, update
-
Field Details
-
FUNCTIONS
The Constant FUNCTIONS.
-
-
Method Details
-
getDataTypeName
Default implementation returns the direct toString() conversion. It may get overridden for specific database dialects- Parameters:
dataType- the data type- Returns:
- the data type name
-
getPrimaryKeyArgument
String getPrimaryKeyArgument()PRIMARY KEY argument for a column for the create table script Default is "PRIMARY KEY".- Returns:
- the primary key argument
-
getIdentityArgument
String getIdentityArgument()Identity argument for a column for the create table script Default is "IDENTITY".- Returns:
- the primary key argument
-
getNotNullArgument
String getNotNullArgument()NOT NULL argument for a column for the create table script Default is "NOT NULL".- Returns:
- the not null argument
-
getUniqueArgument
String getUniqueArgument()UNIQUE argument for a column for the create table script Default is "UNIQUE".- Returns:
- the unique argument
-
existsTable
Check existence of a table.- Specified by:
existsTablein interfaceISqlFactory<SELECT extends SelectBuilder,INSERT extends InsertBuilder, UPDATE extends UpdateBuilder, DELETE extends DeleteBuilder, CREATE extends CreateBranchingBuilder, ALTER extends AlterBranchingBuilder, DROP extends DropBranchingBuilder, NEXT extends NextValueSequenceBuilder, LAST extends LastValueIdentityBuilder> - Parameters:
connection- the current connectiontable- the table name- Returns:
- true if the table exists and false otherwise
- Throws:
SQLException- the SQL exception
-
exists
Check existence of an artifacts.- Specified by:
existsin interfaceISqlFactory<SELECT extends SelectBuilder,INSERT extends InsertBuilder, UPDATE extends UpdateBuilder, DELETE extends DeleteBuilder, CREATE extends CreateBranchingBuilder, ALTER extends AlterBranchingBuilder, DROP extends DropBranchingBuilder, NEXT extends NextValueSequenceBuilder, LAST extends LastValueIdentityBuilder> - Parameters:
connection- the current connectionname- the artifact nametype- the artifact type- Returns:
- true if the table exists and false otherwise
- Throws:
SQLException- the SQL exception
-
existsSchema
Check existence of a schema.- Specified by:
existsSchemain interfaceISqlFactory<SELECT extends SelectBuilder,INSERT extends InsertBuilder, UPDATE extends UpdateBuilder, DELETE extends DeleteBuilder, CREATE extends CreateBranchingBuilder, ALTER extends AlterBranchingBuilder, DROP extends DropBranchingBuilder, NEXT extends NextValueSequenceBuilder, LAST extends LastValueIdentityBuilder> - Parameters:
connection- the current connectionschema- the schema name- Returns:
- true if the table exists and false otherwise
- Throws:
SQLException- the SQL exception
-
isSchemaFilterSupported
boolean isSchemaFilterSupported()Checks if the database is capable of schema-level filtering statements (e.g. to reduce the provisioned schemas down to those that the current user is entitled to see).- Returns:
- true if the feature is supported, false otherwise
-
getSchemaFilterScript
String getSchemaFilterScript()If the database supports schema filtering SQL statements (seeisSchemaFilterSupported()), this method provides the corresponding SQL statement.- Returns:
- a filtering SQL statement
-
isCatalogForSchema
boolean isCatalogForSchema()Does this database support catalogs synonymous to schemas.- Returns:
- whether it is a catalog for schema
-
functionCurrentDate
String functionCurrentDate()Gives the dialect specific name of the CURRENT_DATE function.- Returns:
- the name of the function
-
functionCurrentTime
String functionCurrentTime()Gives the dialect specific name of the CURRENT_TIME function.- Returns:
- the name of the function
-
functionCurrentTimestamp
String functionCurrentTimestamp()Gives the dialect specific name of the CURRENT_TIMESTAMP function.- Returns:
- the name of the function
-
isSequenceSupported
boolean isSequenceSupported()Checks if the database is capable to create and use Sequences.- Returns:
- true if the feature is supported, false otherwise
-
getDatabaseName
Returns the database name.- Parameters:
connection- the active database connection- Returns:
- the database name
-
isSynonymSupported
boolean isSynonymSupported()Checks if the database is capable to create and use Synonyms.- Returns:
- true if the feature is supported, false otherwise
-
getFunctionsNames
Returns the function names.- Returns:
- the list of functions names
-
getFuzzySearchIndex
String getFuzzySearchIndex()Returns the creation of fuzzy search index.- Returns:
- the string for creating the Fuzzy Search Index
-
getEscapeSymbol
String getEscapeSymbol()Returns the escape symbol.- Returns:
- the string for escape symbol
-
count
Count.- Parameters:
connection- the connectiontable- the table- Returns:
- the count
- Throws:
SQLException- the SQL exception
-
all
Count.- Parameters:
connection- the connectiontable- the table- Returns:
- the result set
- Throws:
SQLException- the SQL exception
-
countQuery
Count.- Parameters:
table- the table- Returns:
- the count query
-
allQuery
All.- Parameters:
table- the table- Returns:
- the all query
-
exportData
Export data.- Parameters:
connection- the connectiontable- the tableoutput- the output- Throws:
Exception- Signals that an I/O or SQL exception has occurred.
-
importData
Import data.- Parameters:
connection- the connectiontable- the tableinput- the input- Throws:
Exception- Signals that an I/O or SQL exception has occurred.
-