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 enumstatic classstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringfinal com.wisecoders.dbs.sql.indenter.ScriptComparatorFields 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 TypeMethodDescriptionbooleanvoidcreateDatabase(Connector connector, String nameOrPath, String options) protected StringcreateQuery(String sql, Schema schema) protected StringcreateQuery(String sql, Schema schema, AbstractUnit unit) protected StringcreateQuery(String sql, Schema schema, AbstractUnit unit, AbstractUnit table) com.wisecoders.dbs.data.model.explain.ExecutionPlanexplainPlan(com.wisecoders.dbs.dbms.connect.model.envoy.Envoy envoy, String query) formatImportedDefaultValue(DataType dataType, String defaultValue) formatQueryForExecution(String query) static Dbmsstatic DbmsintgetErrorPosition(SQLException exception, String sql, Statement statement, com.wisecoders.dbs.dbms.connect.model.envoy.Envoy envoy) protected intgetErrorPositionUsingPatterns(String sql, String text, Pattern patternLinePosition, Pattern patternColumnPosition, Pattern patternIndexPosition, Pattern patternNearText) static StringgetInheritedDbms(String dbId) getKnownDbmsExclude(String... excludeDbms) static StringgetMessageFromException(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.ScriptGeneratorgetScriptGenerator(Unit unit) com.wisecoders.dbs.sql.generator.ScriptGeneratorgetScriptGenerator(List<Unit> units) getSelectQuery(Entity entity, boolean excludeGeneratedColumns) com.wisecoders.dbs.dbms.sync.model.SyncFiltervoidimportColumnAdditions(Column column, ResultSet rs) voidimportColumns(com.wisecoders.dbs.dbms.reverseEngineer.model.Importer importer, Schema schema) voidimportConstraints(com.wisecoders.dbs.dbms.reverseEngineer.model.Importer importer, Schema schema) voidimportFinal(Schema schema) List<com.wisecoders.dbs.dbms.reverseEngineer.model.ForeignKeyEntry>voidimportFunctionParameters(com.wisecoders.dbs.dbms.reverseEngineer.model.Importer importer, Schema schema) voidimportFunctions(com.wisecoders.dbs.dbms.reverseEngineer.model.Importer importer, Schema schema) voidimportIndexes(com.wisecoders.dbs.dbms.reverseEngineer.model.Importer importer, Schema schema) voidimportMaterializedViews(com.wisecoders.dbs.dbms.reverseEngineer.model.Importer importer, Schema schema) voidimportNumberOfRows(com.wisecoders.dbs.dbms.reverseEngineer.model.Importer importer, Schema schema) voidimportProcedureParameters(com.wisecoders.dbs.dbms.reverseEngineer.model.Importer importer, Schema schema) voidimportProcedures(com.wisecoders.dbs.dbms.reverseEngineer.model.Importer importer, Schema schema) voidimportRules(com.wisecoders.dbs.dbms.reverseEngineer.model.Importer importer, Schema schema) voidimportSchemaAdditions(com.wisecoders.dbs.dbms.reverseEngineer.model.Importer importer, Schema schema) voidimportSchemaComments(com.wisecoders.dbs.dbms.reverseEngineer.model.Importer importer, Schema schema) voidimportTriggers(com.wisecoders.dbs.dbms.reverseEngineer.model.Importer importer, Schema schema) voidimportUserDefinedTypes(com.wisecoders.dbs.dbms.reverseEngineer.model.Importer importer, Schema schema) voidimportViewColumns(com.wisecoders.dbs.dbms.reverseEngineer.model.Importer importer, Schema schema) voidimportViews(com.wisecoders.dbs.dbms.reverseEngineer.model.Importer importer, Schema schema) booleanisIdentityOrGenerated(Column column) booleanisPlSqlBlock(String text) voidlearnDataTypes(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) voidlistFunctionNames(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) voidlistProcedureNames(com.wisecoders.dbs.dbms.reverseEngineer.model.StructureImporter importer, Schema schema) voidlistRuleNames(com.wisecoders.dbs.dbms.reverseEngineer.model.StructureImporter importer, Schema schema) listSchemasAndCatalogs(com.wisecoders.dbs.dbms.connect.model.envoy.Envoy envoy) voidlistSequences(com.wisecoders.dbs.dbms.reverseEngineer.model.StructureImporter importer, Schema schema) voidlistTableAndViewsNames(com.wisecoders.dbs.dbms.reverseEngineer.model.StructureImporter importer, Schema schema) voidlistTriggerNames(com.wisecoders.dbs.dbms.reverseEngineer.model.StructureImporter importer, Schema schema) voidloadDbVersion(com.wisecoders.dbs.dbms.reverseEngineer.model.StructureImporter importer, Project project) final voidloadSchemaMapping(com.wisecoders.dbs.dbms.connect.model.envoy.Envoy envoy) final voidloadSchemasAndCatalogs(com.wisecoders.dbs.dbms.connect.model.envoy.Envoy envoy, Project project) static voidbooleanreverseEngineerTablesUsingDDL(com.wisecoders.dbs.dbms.reverseEngineer.model.Importer importer, com.wisecoders.dbs.sql.parser.DDLParser DDLParser, Schema schema) static voidsetColumnTypeFromString(Column column, String typeString) voidsetDDLImportedColumnTypes(Table table) voidsetImportedColumnType(Column column, int javaType, String typeName, int length, int decimal, String defaultValue) voidvalidateCreatedUnit(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
-