Schemas

Clone a schema to another dialect

Cloning makes a new schema from an existing one, targeted at a different SQL dialect. Tables, columns, keys, indexes, relationships and enums are copied as they are. The SQL in views, procedures, functions and scripts, plus column defaults and computed expressions that don’t carry across, is converted by AI. You then review each conversion.

Use it to move a design from, say, SQL Server to Snowflake, or to keep a PostgreSQL copy of the sample schema.

In the app: Data Model › Schemas › Create SchemaDuplicate an Existing Schema

[screenshot]
The Review converted SQL page with the status badges, and one item expanded to show its before-and-after diff.

Before you start

  • You need Read/Write access, and the organization must not be in read-only mode.
  • The conversion uses your organization’s AI allowance. If the allowance is used up, the clone won’t start.
  • The target dialect must differ from the source schema’s dialect.
  • Only one clone of a given source schema can run at a time. A second is refused with A duplicate of this schema is already in progress.

What is and isn’t copied

Copied Not copied
Tables, columns, primary keys, indexes, relationships Pipelines
Enums and their values Star-schema plans
Views, procedures, functions and scripts (SQL converted by AI)
Schema settings, such as naming conventions

Start the clone

  1. On the Schemas page, click Create Schema.
  2. Enter a Schema Name for the new schema and pick the target Database System. Click Next.
  3. Choose Duplicate an Existing Schema and click Next.
  4. Pick the Source schema. The wizard confirms Will be created as <target dialect>.
  5. Read the preflight:
    • how many code objects and expressions will be AI-converted;
    • how many column type warnings there are. Click the warning line to see each table.column and why its type may not carry over.
  6. Click Duplicate Schema.
  7. On the Schema created step, click Review changes.

If you picked the same dialect as the source, the wizard asks you to go back and change the target or the source.

Watch the conversion

The Review converted SQL page shows the source and target dialects and when the clone started. While it’s converting, you see Converting SQL to <dialect>… with a progress bar and counts of items converted and failed.

The new schema is usable straight away. Converted SQL lands in it as each item finishes. You can leave the page; the conversion carries on.

Tip: Bookmark the review page. There’s no link back to it from the schema once you leave.

Review the results

When conversion finishes, the page shows badges for converted, failed, accepted, reverted and pending items, and a collapsed Type warnings (N) section listing column types that couldn’t be carried over. Fix those on the new schema.

Each row in the grid is one item:

  • Status: Pending, Converted, Failed, Accepted or Reverted.
  • Kind: SQL script (a view, procedure, function or script body), Column default or Computed expression.
  • Object and Type.
  • Warnings: how many notes the conversion raised.

Expand a row to see a before-and-after diff, any Warnings and Changes notes, and the error for a failed item. If nothing was converted, you see the original SQL with “Not converted — the duplicated schema still holds the original SQL”.

If the source had nothing that needed converting, the page says Nothing needed conversion — the schema structure was copied directly.

Accept, re-run or revert

Converted SQL is already in the new schema. Review is how you record that you’ve checked it, or undo it.

Button Available when What it does
Accept Converted Marks the item as reviewed. Doesn’t change the SQL.
Accept all converted (N) Any items converted Accepts every converted item at once.
Re-run Converted or failed Asks AI to convert the item again.
Revert to original Any status except pending Puts the source dialect’s original SQL back. The item shows as Reverted.

When you’re done, click Finish review. Finishing doesn’t require every item to be accepted, and after you finish you can still accept, re-run or revert individual items.

Warning: AI conversion is a starting point, not a guarantee. Read converted SQL for anything with unusual syntax or type-specific behaviour, and test it against the target database.

If the clone fails

If the copy itself fails, the page shows the reason and the half-made schema is removed. Fix the cause and start again.