Skip to content

Single JSON Export

In single mode (-format single) the exporter writes one file — metadata.json by default — whose root is a Sqlflow object. The whole document is built in memory and serialized at once, so single mode is bounded by an approximately 1 GB single-document ceiling. For larger estates use the sharded export.

Serialization omits null values and empty collections, and boolean flags are emitted only when they are known to be true — an unknown or false flag is simply absent rather than written as false. So a real document contains a subset of the keys below, depending on the source database.

Root object — Sqlflow

Key Type Holds
createdBy string Tool and version, e.g. sqlflow-ingester v1.5.1.
physicalInstance string Source database host or IP.
createTime string Export time, yyyy-MM-dd HH:mm:ss.
servers Server[] The payload. In practice a single entry.
errorMessages Error[] Non-fatal errors collected during extraction. Omitted when empty.

Server

Key Type Holds
name string Server host name.
dbVendor string Dialect, the GSP EDbVendor enum name, e.g. dbvoracle (see values).
supportsCatalogs boolean The vendor has a catalog / database tier.
supportsSchemas boolean The vendor has a schema tier.
databases Database[] Catalogs, when supportsCatalogs is true.
schemas Schema[] Top-level schemas, on schema-only servers.
queries Query[] A flat list of every DDL / source object — views, materialized views, procedures, functions, triggers, packages and package bodies, and foreign-key constraints. In single mode this is where all SQL text lives.
dbLinks DBLink[] Oracle-style database links.

Where a table lands depends on the vendor's tiers: catalog + schema vendors nest tables under databases[].schemas[].tables[]; catalog-only vendors under databases[].tables[]; schema-only vendors (Oracle) under servers[].schemas[].tables[].

Database and Schema

A Database carries the object lists below. A Schema is identical except it has no nested schemas. Object names are normalized identifiers.

Key Type Holds
name string Catalog / schema name.
schemas Schema[] Nested schemas (Database only).
tables / views / others Table[] Tables, views, and other table-like objects (e.g. materialized views), pre-split by type.
procedures / functions / triggers Procedure[] Routine metadata, pre-split by type.
packages Package[] Packages (Oracle-style).
synonyms Synonym[] Synonyms / aliases.
sequences Sequence[] Sequences.
processes Process[] Process objects, where the vendor has them.

Table (also views, materialized views, and other table-like objects)

Key Type Holds
name string Object name.
type string table, view, materialized view, or another table-like type.
databaseName string Owning catalog. Always present.
schemaName string Owning schema. Always present.
columns Column[] The columns.
displayName, alias, subType, dbLink, fromDDL string Optional; usually absent.
coordinates Coordinate[] Optional source positions; absent in database exports.

Column

Key Type Holds
name string Column name.
dataType string SQL type with length / precision / scale embedded, e.g. NUMBER(10,2).
comment string Column comment.
primaryKey boolean Part of the primary key.
foreignKey boolean Part of a foreign key.
indexKey boolean Part of an index.
unqiueKey boolean Has a unique constraint. The key is spelled unqiueKey — this typo is part of the on-disk contract; read it verbatim.
nullable boolean Allows NULL. Tri-state: absent means unknown.
identity boolean Identity / auto-increment column.
computed boolean Computed / generated column.
persisted boolean Computed value is physically stored.
computedDefinition string The computed-column expression.
defaultValue string DEFAULT constraint expression.
defaultName string DEFAULT constraint name.
source string Optional source / derivation expression.

The extended attributes — nullable, identity, computed, persisted, computedDefinition, defaultValue, defaultName — are populated chiefly for SQL Server; other vendors typically leave them unset (and therefore absent).

Query — the DDL / source-code carrier

Every view, materialized view, procedure, function, trigger, package, and package body, plus every foreign key, appears here as an entry in servers[].queries[]. This is where all SQL text lives in single mode.

Key Type Holds
type string view, materialized view, procedure, function, trigger, package, package body, macro (Teradata), or foreignkey.
database string Owning catalog.
schema string Owning schema.
name string Object name.
groupName string Qualified / grouping name, typically schema.name.
sourceCode string The full DDL text. Absent when the object exists but its definition could not be read.
sourceUnavailable boolean true only when the object exists but its DDL could not be read (SQL Server / Azure SQL).
sourceUnavailableReason string encrypted, permission_denied, or unknown.

Foreign keys are synthesized as type: "foreignkey" entries whose sourceCode is an ALTER TABLE … ADD CONSTRAINT … FOREIGN KEY (…) REFERENCES …(…) statement. The catalog objects themselves only carry the per-column foreignKey: true flag; the actual constraint definition lives here.

Procedure (also functions and triggers)

Key Type Holds
name string Routine name.
type string procedure, function, or trigger.
databaseName / schemaName string Owning catalog / schema.
arguments Argument[] Parameters. Each Argument is { name, dataType, inout }, where inout is IN, OUT, or INOUT. Argument detail is populated mainly for Oracle.

The routine body is not stored here — it is a matching Query entry with the same database/schema/name and the DDL in sourceCode.

Other objects

Object Keys
Package name; procedures / functions / triggers; databaseName / schemaName. The spec / body DDL is a Query of type package / package body.
Synonym name, sourceSchema, sourceName, sourceDbLinkName, and the owner keys database / schema (note: not databaseName/schemaName).
Sequence name, incrementBy, and the owner keys database / schema.
DBLink owner, name, userName, host.
Error errorMessage, errorType, coordinate, file, originCoordinate.
Coordinate x, y, hashCode. Rare; suppressed in database exports.

dbVendor values

Server.dbVendor records the dialect once, at the server level, as the GSP EDbVendor enum name. There is no per-object vendor field. Supported values:

dbvoracle, dbvmssql, dbvazuresql, dbvpostgresql, dbvmysql, dbvredshift, dbvgreenplum, dbvnetezza, dbvsnowflake, dbvteradata, dbvdb2, dbvhive, dbvimpala.

Example

A trimmed, annotated Oracle export:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
{
  "createdBy": "sqlflow-ingester v1.5.1",
  "physicalInstance": "10.0.0.12",
  "createTime": "2026-06-20 14:31:09",
  "servers": [{
    "name": "10.0.0.12",
    "dbVendor": "dbvoracle",              // EDbVendor enum name
    "supportsCatalogs": true,
    "supportsSchemas": true,
    "databases": [{
      "name": "ORCL",
      "schemas": [{
        "name": "HR",
        "tables": [{
          "name": "EMPLOYEES", "type": "table",
          "databaseName": "ORCL", "schemaName": "HR",   // owner keys, always present
          "columns": [
            { "name": "EMPLOYEE_ID",   "dataType": "NUMBER(6)",  "primaryKey": true },
            { "name": "DEPARTMENT_ID", "dataType": "NUMBER(4)",  "foreignKey": true },
            { "name": "SALARY",        "dataType": "NUMBER(8,2)", "comment": "monthly" }
          ]
        }],
        "sequences": [
          { "name": "EMP_SEQ", "incrementBy": "1", "database": "ORCL", "schema": "HR" }
        ]
      }]
    }],
    "queries": [                          // ALL DDL text lives here in single mode
      {
        "type": "view", "database": "ORCL", "schema": "HR", "name": "EMP_DETAILS_V",
        "groupName": "HR.EMP_DETAILS_V",
        "sourceCode": "CREATE VIEW emp_details_v AS SELECT ..."
      },
      {
        "type": "foreignkey", "database": "ORCL", "schema": "HR", "name": "EMP_DEPT_FK",
        "sourceCode": "ALTER TABLE HR.EMPLOYEES ADD CONSTRAINT EMP_DEPT_FK FOREIGN KEY (DEPARTMENT_ID) REFERENCES HR.DEPARTMENTS (DEPARTMENT_ID)"
      }
    ],
    "dbLinks": [
      { "owner": "HR", "name": "REMOTE_DB", "userName": "reporting", "host": "//remote:1521/RPT" }
    ]
  }]
}

For the same objects split into a streamable, integrity-checked directory, see the sharded export.