Skip to content

Latest commit

 

History

History
297 lines (244 loc) · 9.32 KB

scanner.adoc

File metadata and controls

297 lines (244 loc) · 9.32 KB

Metadata of a relational database schema

Imports the metadata of a relational database schema, i.e. schemas, tables and columns.

NOTE The JDBC driver must be available on the jQAssistant classpath, e.g. as dependency of the Maven plugin or copied to the plugins/ folder of the distribution.

Connection URI scanner

The connection information may be specified as URI using scope rdbms:connection, e.g. on the command line

jqassistant.sh scan -u rdbms:connection::jdbc:oracle:thin:username/password@host:1521:sid

Connection property file scanner

The connection properties can also be read from property files having a file name with prefix jqassistant.plugin.rdbms, e.g. jqassistant.plugin.rdbms_test.properties. Each of them must contain at least the properties driver, url, user and password, e.g.

${project.ArtifactId}_test.properties
## Required configuration properties
driver=org.hsqldb.jdbc.JDBCDriver
url=jdbc:hsqldb:file:target/myDatabase
user=SA
password=

## Optional properties which are passed to Schema Crawler (http://schemacrawler.sourceforge.net/), they affect the level of queried information.

## The name of the database specific driver provided by schema crawler, supported values are "sybaseiq", "sqlserver", "sqlite", "postgresql", "oracle", "mysql", "hsqldb", "derby", "db2"
# bundled_driver=mysql

## It may be necessary to use another info level for performance or compatibility reasons, e.g. if a database does not support retrieving metadata for stored
## procedures you might try to set "retrieve_routines=false". Allowed values are "standard", "minimum", "maximum" or "detailed"
# info_level=standard

## Activation/deactivation of single options on the selected info level
# retrieve_additional_column_attributes=true
# retrieve_additional_database_info=true
# retrieve_additional_jdbc_driver_info=true
# retrieve_additional_table_attributes=true
# retrieve_foreign_keys=true
# retrieve_indices=true
# retrieve_index_information=true
# retrieve_routines=true
# retrieve_routine_columns=true
# retrieve_routine_information=true
# retrieve_schema_crawler_info=true
# retrieve_sequence_information=true
# retrieve_tables=true
# retrieve_table_columns=true
# retrieve_trigger_information=true
# retrieve_view_information=true

Nodes labeled with :Rdbms:Connection:Properties

Represents a file containing the connection properties described above which have been used to read the schema metadata. It provides the same properties and relations as [:File:Properties].

Table 1. Relations of :Rdbms:Connection:Properties
Name Target label(s) Cardinality Description

DESCRIBES_SCHEMA

Nodes labeled with :Rdbms:Schema

1

References the schema

Nodes labeled with :Rdbms:Schema

Describes a database schema.

Table 2. Properties of :Rdbms:Schema
Name Description

name

The name of the schema.

Table 3. Relations of :Rdbms:Schema
Name Target label(s) Cardinality Description

HAS_TABLE

Nodes labeled with :Rdbms:Table

0..n

References the tables in the schema

HAS_VIEW

Nodes labeled with :Rdbms:View

0..n

References the views in the schema

HAS_SEQUENCE

Nodes labeled with :Rdbms:Sequence

0..n

References the sequences in the schema

Nodes labeled with :Rdbms:Table

Describes a database table.

Table 4. Properties of :Rdbms:Table
Name Description

name

The name of the table.

Table 5. Relations of :Rdbms:Table
Name Target label(s) Cardinality Description

HAS_COLUMN

Nodes labeled with `:Rdbms:Column

0..n

References the columns of the table

HAS_PRIMARY_KEY

Nodes labeled with :Rdbms:PrimaryKey

0..1

References the primary key of the table

HAS_INDEX

Nodes labeled with :Rdbms:Index

0..*

References indices defined for the table

Nodes labeled with :Rdbms:View

Describes a database view.

Table 6. Properties of .Rdbms:View
Name Description

name

The name of the view.

Table 7. Relations of :Rdbms:View
Name Target label(s) Cardinality Description

HAS_COLUMN

Nodes labeled with `:Rdbms:Column

0..n

References the columns of the view

Nodes labeled with `:Rdbms:Column

Describes a column of a table.

Table 8. Properties of :Rdbms:Column
Name Description

name

The name of the column

autoIncremented

Indicates an auto incremented value

generated

Indicates a generated value

defaultValue

The default value

size

The size of the column

decimalDigits

The number of digits for decimal types

partOfIndex

Indicates that the column is part of an index

partOfPrimaryKey

Indicates that the column is part of the primary key

partOfForeignKey

Indicates that the column is part of a foreign key

Table 9. Relations of :Rdbms:Column
Name Target label(s) Cardinality Description

OF_COLUMN_TYPE

Nodes labeled with :Rdbms:ColumnType

1

References the column type

Nodes labeled with :Rdbms:ColumnType

Describes a column data type, e.g. VARCHAR.

Table 10. Properties of :Rdbms:ColumnType
Name Description

databaseType

The database specific name of the type

autoIncrementable

Indicates that values of this type can auto incremented

precision

The precision

minimumScale

The minimum scale

maximumScale

The maximum scale

fixedPrecisionScale

The fixed precision scale

numericPrecisionRadix

The numeric precision radix

caseSensitive

Indicates that the type is case sensitive

unsigned

Indicates that the type is unsigned

userDefined

Indicates that the type is user defined

Nodes labeled with :Rdbms:PrimaryKey

Describes a primary key of a table.

Table 11. Properties of :Rdbms:PrimaryKey
Name Description

name

The name of the primary key.

Table 12. Relations of :Rdbms:PrimaryKey
Name Target label(s) Cardinality Description

ON_PRIMARY_KEY_COLUMN

Nodes labeled with :Rdbms:ColumnType

1

References a primary key column

ON_PRIMARY_KEY_COLUMN

Describes the properties of a column in a primary key.

Table 13. Properties of ON_PRIMARY_KEY_COLUMN
Name Description

indexOrdinalPosition

The ordinal position of the column in the primary key.

sortSequence

The sort sequence, i.e. "ascending" or "descending".

Nodes labeled with :Rdbms:Index

Describes an index defined for table.

Table 14. Properties of :Rdbms:Index
Name Description

name

The name of the index.

unique

true if the index is unique.

cardinality

The cardinality of the index.

indexType

The index type.

pages

The pages.

Table 15. Relations of :Rdbms:Index
Name Target label(s) Cardinality Description

ON_INDEX_COLUMN

Nodes labeled with :Rdbms:ColumnType

1

References an indexed column

ON_INDEX_COLUMN

Describes the properties of a column used by an index.

Table 16. Properties of ON_INDEX_COLUMN
Name Description

indexOrdinalPosition

The ordinal position of the column in the primary key.

sortSequence

The sort sequence, i.e. ascending or descending.

Nodes labeled with `:Rdbms:ForeignKey

Describes a foreign key.

Table 17. Properties of :Rdbms:ForeignKey
Name Description

name

The name of the foreign key

deferrability

The deferrability

deleteRule

The delete rule, e.g. cascade

updateRule

The update rule

Table 18. Relations of :Rdbms:ForeignKey
Name Target label(s) Cardinality Description

HAS_FOREIGN_KEY_REFERENCE

Nodes labeled with :Rdbms:ForeignKeyReference

1..n

The foreign key references

Nodes labeled with :Rdbms:ForeignKeyReference

Describes a foreign key reference, i.e. a pair consisting of a foreign key referencing a primary key.

Table 19. Relations of :Rdbms:ForeignKeyReference
Name Target label(s) Cardinality Description

FROM_FOREIGN_KEY_COLUMN

Nodes labeled with `:Rdbms:Column

1

The foreign key column

TO_PRIMARY_KEY_COLUMN

Nodes labeled with `:Rdbms:Column

1

The primary key column

Nodes labeled with :Rdbms:Sequence

Describes a database sequence.

Table 20. Properties of :Rdbms:Sequence
Name Description

name

The name of the sequence

minimumValue

The minimum value

maximumValue

The maximum value

increment

The increment

cycle

Indicates that the sequence restarts at the minimumValue if the the maximumValue has been reached.