Version

    DBCatalogExport

    DBCatalogExport 64x64

    Short description

    Ports

    Metadata

    DBCatalogExport attributes

    Details

    Compatibility

    See also

    This component is currently in the incubation phase. Although it is available for use, it is under active development and may be subject to changes. We welcome feedback and encourage users to explore its capabilities.

    Short description

    DBCatalogExport reads the schemas, tables, and columns of a database and writes them to a JSON file, the database catalog. The data lineage of graphs uses the catalog to resolve the columns that SQL queries of DatabaseReader components read.

    Reading the catalog of a large database takes a long time. The component therefore runs once and writes the result to a file, and the lineage reads the file instead of the database.

    Same input metadata Sorted inputs Inputs Outputs Each to all outputs Java CTL Auto-propagated metadata

    -

    -

    0

    0-1

    -

    ⨯

    ⨯

    ✓

    Ports

    Port type Number Required Description Metadata

    Output

    0

    ⨯

    Export statistics: one record per exported schema with at least one table or view, and one record with the totals

    Statistics

    The component has no input port.

    Metadata

    DBCatalogExport propagates metadata to its output port. The output port receives one record per exported schema, followed by one record with the totals. A schema without tables and views gets no record and does not count in the totals. In the totals record, the catalog and schema fields are empty.

    Field Type Description

    catalog

    string

    The catalog the schema belongs to.

    schema

    string

    The name of the schema.

    tables

    integer

    The number of tables.

    views

    integer

    The number of views.

    columns

    integer

    The number of columns.

    fileURL

    string

    The value of the Catalog output file attribute.

    generatedAt

    date

    When the catalog was read.

    durationMs

    long

    How long the export took, in milliseconds. All records carry the same value.

    DBCatalogExport attributes

    Attribute Req Description Possible values

    Basic

    Database connection

    yes

    The database connection to read the catalog from.

    Catalog output file

    yes

    The file the catalog is written to. An existing file is overwritten.

    Schemas to export

    no

    The schemas to export. Each pattern is schema or catalog.schema and can contain the % (any characters) and _ (one character) wildcards. Separate several patterns with a semicolon or a new line.

    all schemas (default)

    Compress (GZIP)

    no

    Writes the file compressed with GZIP.

    false (default)
    true

    Advanced

    Log extraction progress

    no

    Logs the progress of the export to the graph log: the first step of each phase, the other steps at most every 10 seconds, and the end.

    false (default)
    true

    Details

    The catalog file contains the schemas, tables, and views of the database, their columns with types and comments, and the primary and foreign keys. The header of the file says when the catalog was read, which connection it was read from, and which schema patterns limited it. The header stores the database product and version and the JDBC URL of the connection. The component removes the user name and the password from the URL before it writes the file.

    The component does not add a file extension. We recommend the .dbcatalog.json suffix, or .dbcatalog.json.gz for a compressed file. The lineage reads plain, GZIP-compressed, and ZIP-packed catalog files.

    When the graph is aborted, the component stops the export between two metadata queries and writes no file.

    At the end of the export, the component writes the number of schemas, tables, views, and columns and the duration to the graph log.

    Using the catalog for data lineage

    The catalog file is read by the tools of the CloverDX MCP API:

    • graph_lineage takes catalog files in its dbSchemas parameter, one per database connection of the graph. With a catalog, the columns of the SQL queries resolve to table.column; without one, they are reported by position.

    • db_get_schema answers from a catalog file given in its catalogFile parameter, without connecting to the database.

    Both tools read the file from a sandbox: graph_lineage takes a path within the graph’s sandbox or a sandbox://<sandbox>/<path> URL, db_get_schema takes a sandbox://<sandbox>/<path> URL. Write the catalog file into a sandbox.

    The catalog describes the database at the time of the export. When the database structure changes, run the component again. To keep the file current, run the graph with the component in a scheduled job.

    See MCP tools reference for the tools.

    Compatibility

    Version Compatibility notice

    7.6.2

    DBCatalogExport is available since CloverDX 7.6.2, in the Incubation category.