Docs/Streams/Features

Database Structure Options

Structure options control which parts of the target table definition DBConvert Streams creates when Create structure is enabled.

Use this page when:

  • you want DBConvert Streams to create target tables for you
  • you want to skip indexes, foreign keys, or check constraints during the initial run
  • you need to understand what the advanced toggles in the wizard actually do

In the API, these settings live in target.spec.db.structureOptions.

How the UI works

In the stream wizard, the Structure & Data step has a master Create structure checkbox.

When that checkbox is enabled, you can open Advanced options and choose:

  • Tables
  • Indexes
  • Foreign keys
  • Check constraints

These toggles refine structure creation. They do not currently backfill indexes, foreign keys, or check constraints onto existing tables by themselves when table creation is off.

Options

Label in UIAPI fieldWhat it affects during table creationIgnored when
TablestablesCreates target tables when they do not exist.Create structure is off.
IndexesindexesCreates primary keys, unique indexes, and secondary indexes as part of table materialization.Create structure is off, or table creation is off.
Foreign keysforeignKeysAdds foreign key constraints after tables are created.Create structure is off, or table creation is off.
Check constraintscheckConstraintsIncludes check constraints in generated table DDL.Create structure is off, or table creation is off.

All four options default to true.

Common setups

GoalTablesIndexesForeign keysCheck constraints
Strict schema copyOnOnOnOn
Faster initial loadOnOffOffOn
DBA-managed existing schemaOffOffOffOff
Create missing tables but avoid relationship enforcementOnOnOffOn

When to disable each option

OptionDisable it when
TablesThe target schema is managed outside the stream and DBConvert Streams should only write data.
IndexesYou want to reduce write overhead during a large initial load and create indexes later.
Foreign keysYou want to avoid insert-order issues or reduce enforcement overhead during loading.
Check constraintsThe source constraints use engine-specific expressions that may not translate cleanly.

What does not happen

If Tables is off, the other toggles are not used as standalone “patch existing schema” actions for already-existing tables.

Use Target Schema and Data Policies with this page: structure options decide what to create, schema policy decides whether creation is allowed, and write mode decides what to do with existing rows.

API example

This example creates tables and check constraints, but skips indexes and foreign keys:

{
  "target": {
    "id": "conn_TARGET_ID",
    "spec": {
      "db": {
        "database": "target_db",
        "structureOptions": {
          "tables": true,
          "indexes": false,
          "foreignKeys": false,
          "checkConstraints": true
        }
      }
    }
  }
}

If structure creation fails

A failed structure step leaves the target the way it found it, so a failed run never becomes the reason the next one fails.

  • Before the first table is created, DBConvert Streams builds the CREATE TABLE statement for every selected table. If one of them cannot be built — for example a column name longer than the target allows — the run stops with that table named, and nothing has been created.
  • If a statement is rejected by the target while it runs — missing rights, an engine limit, a name already taken by another object — the tables this run had already created are removed again. Tables that were on the target before the run are never touched.

The run failure tells you which of the two happened. In both cases you fix the cause and start the stream again; there is nothing to clean up by hand.

The exception is schema policy Drop and recreate, which drops existing target tables on purpose before creating new ones. That drop is what you asked for, and it is not undone.

Verification

After you start the stream:

  • confirm the stream reaches structure creation instead of stopping on schema policy validation
  • if the run failed during structure creation, confirm the target holds no half-created tables from it — the failed run removes its own
  • if indexes or foreign keys are disabled, verify that the target tables exist without those extra objects
  • if Tables is off, do not expect DBConvert Streams to backfill missing indexes or constraints onto existing tables