Package com.wisecoders.dbs.dbms
Class Dbms
java.lang.Object
com.wisecoders.dbs.dbms.DbmsDef
com.wisecoders.dbs.dbms.Dbms
public class Dbms
extends com.wisecoders.dbs.dbms.DbmsDef
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
static class
static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
final com.wisecoders.dbs.sql.indenter.ScriptComparator
Fields inherited from class com.wisecoders.dbs.dbms.DbmsDef
aliases, aliasSupport, allowEmptyPassword, allowVirtualTables, allowVirtualViews, alterCluster, alterColumn, alterConstraint, alterForeignKey, alterIndex1, alterIndex2, alterMaterializedView, alterNormalIndex, alterPartition, alterPlSql, alterPrimaryKey, alterSchema, alterSequence, alterSort, alterTable, alterUniqueIndex, alterUniqueKey, alterUserDataType, alterView, autoLetterCases, behaviour, behaviourDriver, behaviourLimits, behaviourSettings, behaviourVirtualization, booleanAs01, booleanFormat, brackets, cases, catalogAlias, childEntityRename, cluster, clusterColumnOptions, clusterCreate, clusterCreateEnding, clusterCreateInline, clusterDrop, clusterName, clusterOptions, clusterRename, clusterSpecificationOptions, clusterTooltip, column, columnAlias, columnChangeComment, columnComment, columnComputedOptions, columnCreate, columnCreateComputed, columnCreateComputedInline, columnCreateInline, columnDefault, columnDrop, columnDropComment, columnDropIdentity, columnDropMandatory, columnGeneratedUnsetMandatory, columnIdentityOptions, columnIdentitySetMandatory, columnInsertFromSequence, columnKeywords, columnModifyType, columnNotNull, columnNull, columnNullInline, columnOptions, columnRemoveDefault, columnRename, columnReorderAfter, columnReorderFirst, columnSetDefault, columnSetIdentity, columnSetMandatory, columnUnsigned, columnUseDefaultNull, comments, commentsAtScriptEnd, commit, computed, constraint, constraintComment, constraintCreate, constraintCreateInline, constraintDrop, constraintOptions, constraintRename, constraintTypes, createNewForeignKeysAsVirtual, database, databaseCreate, databaseOptions, dataExplorer, dataProvider, dateFormat, dateTimeFormat, dateTimeFunctions, dbId, DEFAULT_SCHEMA_NAME, defaultClusterName, defaultConstraintName, defaultDatabase, defaultDomainText, defaultForeignKeyName, defaultFunctionText, defaultIndex1Name, defaultIndex2Name, defaultIndexName, defaultInstance, defaultMaterializedViewText, defaultPartitionName, defaultPassword, defaultPort, defaultPrimaryKeyName, defaultProcedureText, defaultRuleName, defaultRuleText, defaults, defaultSchema, defaultSequenceName, defaultSortName, defaultStatements, defaultTableName, defaultTableStorage, defaultTriggerName, defaultTriggerText, defaultUniqueKeyName, defaultUrlParam, defaultUrlParam2, defaultUrlParam3, defaultUrlParam4, defaultUrlParam5, defaultUser, defaultViewName, defaultViewText, deleteStatement, disableAutoCommit, disableReorderColumns, dropFunction, dropProcedure, dropRule, dropTrigger, duplicateIndexesOptions, engineer, escapeAmpersand, escapeBackspace, escapeCarriageReturn, escapeDoubleQuote, escapeFormFeed, escapeNewline, escapes, escapeSingleQuote, escapeTabulator, explainPlanView, fk, fkAlias, fkBehaviour, fkChangeComment, fkComment, fkCreate, fkCreateInline, fkDelete, fkDeleteCascade, fkDeleteNoAction, fkDeleteRestrict, fkDeleteSetNull, fkDrop, fkDropComment, fkOptions, fkRename, fkUpdate, fkUpdateCascade, fkUpdateNoAction, fkUpdateRestrict, fkUpdateSetNull, foreignKeysInline, format, formatting, functionAlias, functionChangeComment, functionComment, functionDropComment, groovyCustomCode, hasJDBCDriverOnWeb, identifierCases, identifierDelimiter, identityOnAllColumns, importRemarksProperty, index, index1, index1ColumnOptions, index1Create, index1CreateEnding, index1CreateInline, index1Drop, index1Name, index1Options, index1Rename, index1SpecificationOptions, index1Tooltip, index2, index2ColumnOptions, index2Create, index2CreateEnding, index2CreateInline, index2Drop, index2Name, index2Options, index2Rename, index2SpecificationOptions, index2Tooltip, indexColumnOptions, indexComment, indexCreate, indexDrop, indexIncludeColumns, indexOptions, indexRename, indexSpecificationOptions, initializationScript, jdbcTipFx, keywords, loadConstraintDefinition, loadConstraintRemoveBrackets, loadFunctionDefinition, loadFunctionName, loadMaterializedViewsDefinition, loadProcedureDefinition, loadProcedureName, loadRuleDefinition, loadRuleName, loadSchemaComment, loadSequenceName, loadTimeout, loadTriggerDefinition, loadTriggerName, loadViewDefinition, materializedView, materializedViewAlias, materializedViewComment, materializedViewCreate, materializedViewDrop, maxColumnNameLength, maxForeignKeyNameLength, maxSchemaNameLength, maxTableNameLength, multipleValuesInInserts, newForeignKeyOptimizeDeletion, other, other2, partition, partitionColumnDefinition, partitionColumnOptions, partitionCreate, partitionCreateEnding, partitionCreateInline, partitionDrop, partitionIsColumnDefinition, partitionName, partitionOptions, partitionRename, partitionSpecificationOptions, partitionTooltip, pk, pkCanUseNonMandatoryColumns, pkColumnOptions, pkComment, pkCreate, pkCreateEnding, pkCreateInline, pkDrop, pkIndexAllowVirtual, pkInlineKeyword, pkOptions, pkRename, pkSpecificationOptions, plsql, postScriptOptions, prefixSchemaWithCatalog, prefixTableWithSchema, preScriptOptions, procedureAlias, procedureChangeComment, procedureComment, procedureDropComment, projectPropertyAddon1Load, projectPropertyAddon1Name, projectPropertyAddon2Load, projectPropertyAddon2Name, projectPropertyAddon3Load, projectPropertyAddon3Name, projectPropertyAddon4Load, projectPropertyAddon4Name, projectPropertyAddOns, projectScriptAddon1Load, projectScriptAddon1Name, projectScriptAddon1Script, projectScriptAddon2Load, projectScriptAddon2Name, projectScriptAddon2Script, projectScriptAddon3Load, projectScriptAddon3Name, projectScriptAddon3Script, projectScriptAddon4Load, projectScriptAddon4Name, projectScriptAddon4Script, projectScriptAddOns, psqlDelimiter, queries, queriesUsesCatalogAndSchema, quoteAllNames, quotedIdentifierCases, recordsPerPage, removeSemicolonFromQueries, reserved, resetIdentity, reverseEngineerPartitionTables, reverseEngineerUsingDDL, root, ruleAlias, ruleChangeComment, ruleComment, ruleDropComment, runDDLUsingStatementExecute, schema, schemaAlias, schemaChangeComment, schemaComment, schemaCreate, schemaDrop, schemaDropComment, schemaIsCatalogInDatabaseMetaData, schemaOptions, schemaPropertyAddon1Load, schemaPropertyAddon1Name, schemaPropertyAddon2Load, schemaPropertyAddon2Name, schemaPropertyAddon3Load, schemaPropertyAddon3Name, schemaPropertyAddon4Load, schemaPropertyAddon4Name, schemaPropertyAddOns, schemaRename, schemaScriptAddon1Load, schemaScriptAddon1Name, schemaScriptAddon1Script, schemaScriptAddon2Load, schemaScriptAddon2Name, schemaScriptAddon2Script, schemaScriptAddon3Load, schemaScriptAddon3Name, schemaScriptAddon3Script, schemaScriptAddon4Load, schemaScriptAddon4Name, schemaScriptAddon4Script, schemaScriptAddOns, schemaSpecificationOptions, selectHint, sequence, sequenceChangeComment, sequenceComment, sequenceCreate, sequenceDrop, sequenceDropComment, sequenceOptions, sort, sortColumnOptions, sortCreate, sortCreateEnding, sortCreateInline, sortDrop, sortName, sortOptions, sortRename, sortSpecificationOptions, sortTooltip, statementDelimiter, statementsHistoryAdvice, statementsHistoryQuery, statistics, stringDelimiter, stringFunctions, syntax, systemDatabases, systemDatabasesAlias, systemDate, systemTime, systemTimestamp, table, tableAlias, tableChangeComment, tableComment, tableCreate, tableCreatePartition, tableDrop, tableDropComment, tableInsert, tableOptions, tableRename, tableRowCount, tableSpecificationOptions, tableTypes, tags, timestampFormat, toTimestamp, transaction, triggerAlias, triggerChangeComment, triggerComment, triggerDropComment, triggerSkipCatalogName, truncateTable, uniqueIndex, uniqueIndexColumnOptions, uniqueIndexComment, uniqueIndexCreate, uniqueIndexCreateInline, uniqueIndexDrop, uniqueIndexOptions, uniqueIndexRename, uniqueIndexSpecificationOptions, uniqueKey, uniqueKeyColumnOptions, uniqueKeyComment, uniqueKeyCreate, uniqueKeyCreateInline, uniqueKeyDrop, uniqueKeyOptions, uniqueKeyRename, uniqueKeySpecificationOptions, useDatabaseDateFormat, useDefaultSchema, useLimit, useOffset, userDataType, userDataTypeAlias, userDataTypeComment, userDataTypeDeclaration, userDataTypeDrop, userDataTypeRename, userDataUpdateCast, userOrderBy, useTreeTableDetailsPane, view, viewAlias, viewComment, viewDrop
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
void
createDatabase
(Connector connector, String nameOrPath, String options) protected String
createQuery
(String sql, Schema schema) protected String
createQuery
(String sql, Schema schema, AbstractUnit unit) protected String
createQuery
(String sql, Schema schema, AbstractUnit unit, AbstractUnit table) com.wisecoders.dbs.data.model.explain.ExecutionPlan
explainPlan
(com.wisecoders.dbs.dbms.connect.model.envoy.Envoy envoy, String query) formatImportedDefaultValue
(DataType dataType, String defaultValue) formatQueryForExecution
(String query) static Dbms
static Dbms
int
getErrorPosition
(SQLException exception, String sql, Statement statement, com.wisecoders.dbs.dbms.connect.model.envoy.Envoy envoy) protected int
getErrorPositionUsingPatterns
(String sql, String text, Pattern patternLinePosition, Pattern patternColumnPosition, Pattern patternIndexPosition, Pattern patternNearText) static String
getInheritedDbms
(String dbId) getKnownDbmsExclude
(String... excludeDbms) static String
getMessageFromException
(Throwable cause, Connector connector) getParamSource
(com.wisecoders.dbs.dbms.JdbcUrlParam param) getResultAsString
(com.wisecoders.dbs.dbms.reverseEngineer.model.Importer importer, String query) com.wisecoders.dbs.sql.generator.ScriptGenerator
getScriptGenerator
(Unit unit) com.wisecoders.dbs.sql.generator.ScriptGenerator
getScriptGenerator
(List<Unit> units) getSelectQuery
(Entity entity, boolean excludeGeneratedColumns) com.wisecoders.dbs.dbms.sync.model.SyncFilter
void
importColumnAdditions
(Column column, ResultSet rs) void
importColumns
(com.wisecoders.dbs.dbms.reverseEngineer.model.Importer importer, Schema schema) void
importConstraints
(com.wisecoders.dbs.dbms.reverseEngineer.model.Importer importer, Schema schema) void
importFinal
(Schema schema) List<com.wisecoders.dbs.dbms.reverseEngineer.model.ForeignKeyEntry>
void
importFunctionParameters
(com.wisecoders.dbs.dbms.reverseEngineer.model.Importer importer, Schema schema) void
importFunctions
(com.wisecoders.dbs.dbms.reverseEngineer.model.Importer importer, Schema schema) void
importIndexes
(com.wisecoders.dbs.dbms.reverseEngineer.model.Importer importer, Schema schema) void
importMaterializedViews
(com.wisecoders.dbs.dbms.reverseEngineer.model.Importer importer, Schema schema) void
importNumberOfRows
(com.wisecoders.dbs.dbms.reverseEngineer.model.Importer importer, Schema schema) void
importProcedureParameters
(com.wisecoders.dbs.dbms.reverseEngineer.model.Importer importer, Schema schema) void
importProcedures
(com.wisecoders.dbs.dbms.reverseEngineer.model.Importer importer, Schema schema) void
importRules
(com.wisecoders.dbs.dbms.reverseEngineer.model.Importer importer, Schema schema) void
importSchemaAdditions
(com.wisecoders.dbs.dbms.reverseEngineer.model.Importer importer, Schema schema) void
importSchemaComments
(com.wisecoders.dbs.dbms.reverseEngineer.model.Importer importer, Schema schema) void
importTriggers
(com.wisecoders.dbs.dbms.reverseEngineer.model.Importer importer, Schema schema) void
importUserDefinedTypes
(com.wisecoders.dbs.dbms.reverseEngineer.model.Importer importer, Schema schema) void
importViewColumns
(com.wisecoders.dbs.dbms.reverseEngineer.model.Importer importer, Schema schema) void
importViews
(com.wisecoders.dbs.dbms.reverseEngineer.model.Importer importer, Schema schema) boolean
isIdentityOrGenerated
(Column column) boolean
isPlSqlBlock
(String text) void
learnDataTypes
(com.wisecoders.dbs.dbms.connect.model.envoy.Envoy envoy) listDatabasesUsingCustomQuery
(com.wisecoders.dbs.dbms.connect.model.envoy.Envoy envoy, com.wisecoders.dbs.dbms.connect.model.envoy.SelectStatement query) void
listFunctionNames
(com.wisecoders.dbs.dbms.reverseEngineer.model.StructureImporter importer, Schema schema) listParam
(com.wisecoders.dbs.dbms.connect.model.envoy.Envoy envoy, com.wisecoders.dbs.dbms.JdbcUrlParam param) void
listProcedureNames
(com.wisecoders.dbs.dbms.reverseEngineer.model.StructureImporter importer, Schema schema) void
listRuleNames
(com.wisecoders.dbs.dbms.reverseEngineer.model.StructureImporter importer, Schema schema) listSchemasAndCatalogs
(com.wisecoders.dbs.dbms.connect.model.envoy.Envoy envoy) void
listSequences
(com.wisecoders.dbs.dbms.reverseEngineer.model.StructureImporter importer, Schema schema) void
listTableAndViewsNames
(com.wisecoders.dbs.dbms.reverseEngineer.model.StructureImporter importer, Schema schema) void
listTriggerNames
(com.wisecoders.dbs.dbms.reverseEngineer.model.StructureImporter importer, Schema schema) void
loadDbVersion
(com.wisecoders.dbs.dbms.reverseEngineer.model.StructureImporter importer, Project project) final void
loadSchemaMapping
(com.wisecoders.dbs.dbms.connect.model.envoy.Envoy envoy) final void
loadSchemasAndCatalogs
(com.wisecoders.dbs.dbms.connect.model.envoy.Envoy envoy, Project project) static void
boolean
reverseEngineerTablesUsingDDL
(com.wisecoders.dbs.dbms.reverseEngineer.model.Importer importer, com.wisecoders.dbs.sql.parser.DDLParser DDLParser, Schema schema) static void
setColumnTypeFromString
(Column column, String typeString) void
setDDLImportedColumnTypes
(Table table) void
setImportedColumnType
(Column column, int javaType, String typeName, int length, int decimal, String defaultValue) void
validateCreatedUnit
(TreeUnit unit) Implement this to add custom columns to a table, for example _id to MongoDB collections if is missing.Methods inherited from class com.wisecoders.dbs.dbms.DbmsDef
computedColumnUsesDataType, defaultIsUsingBrackets, escapeString, getAliasSupport, getAlterIndex, getBrowseRecordsPerPage, getCommentDelimiters, getDefaultStatements, getIndexTypeName, getLetterCases, getSqlRecordsPerPage, getTags, identifierCommaList, indexColumnsWithOptions, isEndBracketInDDL, isReservedKeyword, isStartBracketInDDL, jsonIdentifierCommaList, quote, quote, quoteAlways, removeLineComments, saveTags, toDefaultCases
-
Field Details
-
GROOVY
- See Also:
-
ANY_DBMS
- See Also:
-
scriptComparator
public final com.wisecoders.dbs.sql.indenter.ScriptComparator scriptComparator
-
-
Constructor Details
-
Dbms
-
Dbms
Public constructor.- Parameters:
dbId
- nameinheritedDbms
- if specified all settings, data types will be used from this database
-
-
Method Details
-
getKnownDbmsExclude
-
get
-
get
-
reloadImporters
public static void reloadImporters() -
setDDLImportedColumnTypes
-
setImportedColumnType
-
formatImportedDefaultValue
-
loadSchemasAndCatalogs
public final void loadSchemasAndCatalogs(com.wisecoders.dbs.dbms.connect.model.envoy.Envoy envoy, Project project) throws Exception - Throws:
Exception
-
loadSchemaMapping
public final void loadSchemaMapping(com.wisecoders.dbs.dbms.connect.model.envoy.Envoy envoy) throws Exception - Throws:
Exception
-
listSchemasAndCatalogs
public List<Dbms.SchemaCatalogEntry> listSchemasAndCatalogs(com.wisecoders.dbs.dbms.connect.model.envoy.Envoy envoy) throws Exception - Throws:
Exception
-
loadDbVersion
public void loadDbVersion(com.wisecoders.dbs.dbms.reverseEngineer.model.StructureImporter importer, Project project) throws Exception - Throws:
Exception
-
learnDataTypes
public void learnDataTypes(com.wisecoders.dbs.dbms.connect.model.envoy.Envoy envoy) throws Exception - Throws:
Exception
-
listTableAndViewsNames
public void listTableAndViewsNames(com.wisecoders.dbs.dbms.reverseEngineer.model.StructureImporter importer, Schema schema) throws Exception - Throws:
Exception
-
createQuery
-
createQuery
-
createQuery
-
listProcedureNames
public void listProcedureNames(com.wisecoders.dbs.dbms.reverseEngineer.model.StructureImporter importer, Schema schema) throws Exception - Throws:
Exception
-
listFunctionNames
public void listFunctionNames(com.wisecoders.dbs.dbms.reverseEngineer.model.StructureImporter importer, Schema schema) throws Exception - Throws:
Exception
-
listTriggerNames
public void listTriggerNames(com.wisecoders.dbs.dbms.reverseEngineer.model.StructureImporter importer, Schema schema) throws Exception - Throws:
Exception
-
listRuleNames
public void listRuleNames(com.wisecoders.dbs.dbms.reverseEngineer.model.StructureImporter importer, Schema schema) throws Exception - Throws:
Exception
-
listSequences
public void listSequences(com.wisecoders.dbs.dbms.reverseEngineer.model.StructureImporter importer, Schema schema) throws Exception - Throws:
Exception
-
reverseEngineerTablesUsingDDL
public boolean reverseEngineerTablesUsingDDL(com.wisecoders.dbs.dbms.reverseEngineer.model.Importer importer, com.wisecoders.dbs.sql.parser.DDLParser DDLParser, Schema schema) throws Exception - Throws:
Exception
-
importColumns
public void importColumns(com.wisecoders.dbs.dbms.reverseEngineer.model.Importer importer, Schema schema) throws Exception - Throws:
Exception
-
importColumnAdditions
- Throws:
Exception
-
importSchemaAdditions
public void importSchemaAdditions(com.wisecoders.dbs.dbms.reverseEngineer.model.Importer importer, Schema schema) throws Exception - Throws:
Exception
-
importFks
public List<com.wisecoders.dbs.dbms.reverseEngineer.model.ForeignKeyEntry> importFks(com.wisecoders.dbs.dbms.reverseEngineer.model.Importer importer, Schema schema) throws Exception - Throws:
Exception
-
importIndexes
public void importIndexes(com.wisecoders.dbs.dbms.reverseEngineer.model.Importer importer, Schema schema) throws Exception - Throws:
Exception
-
importConstraints
public void importConstraints(com.wisecoders.dbs.dbms.reverseEngineer.model.Importer importer, Schema schema) throws Exception - Throws:
Exception
-
importViews
public void importViews(com.wisecoders.dbs.dbms.reverseEngineer.model.Importer importer, Schema schema) throws Exception - Throws:
Exception
-
importSchemaComments
public void importSchemaComments(com.wisecoders.dbs.dbms.reverseEngineer.model.Importer importer, Schema schema) throws Exception - Throws:
Exception
-
importViewColumns
public void importViewColumns(com.wisecoders.dbs.dbms.reverseEngineer.model.Importer importer, Schema schema) throws Exception - Throws:
Exception
-
importMaterializedViews
public void importMaterializedViews(com.wisecoders.dbs.dbms.reverseEngineer.model.Importer importer, Schema schema) throws Exception - Throws:
Exception
-
importProcedures
public void importProcedures(com.wisecoders.dbs.dbms.reverseEngineer.model.Importer importer, Schema schema) throws Exception - Throws:
Exception
-
importProcedureParameters
public void importProcedureParameters(com.wisecoders.dbs.dbms.reverseEngineer.model.Importer importer, Schema schema) throws Exception - Throws:
Exception
-
importFunctions
public void importFunctions(com.wisecoders.dbs.dbms.reverseEngineer.model.Importer importer, Schema schema) throws Exception - Throws:
Exception
-
importFunctionParameters
public void importFunctionParameters(com.wisecoders.dbs.dbms.reverseEngineer.model.Importer importer, Schema schema) throws Exception - Throws:
Exception
-
importUserDefinedTypes
public void importUserDefinedTypes(com.wisecoders.dbs.dbms.reverseEngineer.model.Importer importer, Schema schema) throws Exception - Throws:
Exception
-
importTriggers
public void importTriggers(com.wisecoders.dbs.dbms.reverseEngineer.model.Importer importer, Schema schema) throws Exception - Throws:
Exception
-
importRules
public void importRules(com.wisecoders.dbs.dbms.reverseEngineer.model.Importer importer, Schema schema) throws Exception - Throws:
Exception
-
importNumberOfRows
public void importNumberOfRows(com.wisecoders.dbs.dbms.reverseEngineer.model.Importer importer, Schema schema) throws Exception - Throws:
Exception
-
importFinal
-
getMessageFromException
-
getErrorPosition
public int getErrorPosition(SQLException exception, String sql, Statement statement, com.wisecoders.dbs.dbms.connect.model.envoy.Envoy envoy) throws Throwable - Throws:
Throwable
-
getErrorPositionUsingPatterns
-
canExplainPlan
public boolean canExplainPlan() -
explainPlan
public com.wisecoders.dbs.data.model.explain.ExecutionPlan explainPlan(com.wisecoders.dbs.dbms.connect.model.envoy.Envoy envoy, String query) throws Exception - Throws:
Exception
-
getParamSource
-
listParam
public List<String> listParam(com.wisecoders.dbs.dbms.connect.model.envoy.Envoy envoy, com.wisecoders.dbs.dbms.JdbcUrlParam param) throws Exception - Throws:
Exception
-
createDatabase
- Throws:
Exception
-
listDatabasesUsingCustomQuery
protected List<String> listDatabasesUsingCustomQuery(com.wisecoders.dbs.dbms.connect.model.envoy.Envoy envoy, com.wisecoders.dbs.dbms.connect.model.envoy.SelectStatement query) throws Exception - Throws:
Exception
-
isPlSqlBlock
-
extractDelimiterFromCommand
-
formatQueryForExecution
-
getSynchronizationFilter
public com.wisecoders.dbs.dbms.sync.model.SyncFilter getSynchronizationFilter() -
getScriptGenerator
-
getScriptGenerator
-
getLastUsedDbms
-
getInheritedDbms
-
setColumnTypeFromString
-
getResultAsString
public String getResultAsString(com.wisecoders.dbs.dbms.reverseEngineer.model.Importer importer, String query) throws Exception - Throws:
Exception
-
validateCreatedUnit
Implement this to add custom columns to a table, for example _id to MongoDB collections if is missing.- Parameters:
unit
- to validate
-
getSelectQuery
-
isIdentityOrGenerated
-