Model Import & Export

Move SQL models between Weld workspaces, back them up, or export them to dbt - all through simple zip file uploads and downloads.

Overview

Weld's model import and export features let you bulk-transfer your SQL models as .sql files packaged in a zip archive. Whether you want to migrate models between workspaces, create backups, or transition to a dbt project, these features have you covered.

Export downloads your published models as a zip archive - either in Weld-native format or as a ready-to-use dbt project.

Import lets you upload a zip of .sql files into your workspace. Weld automatically detects whether the files are Weld-native or dbt-formatted, resolves dependencies, and creates or updates models accordingly.


Export

You can export all models in your workspace, or select specific models to export. Two export formats are available:

Weld-Native Export

Downloads a zip containing:

  • One .sql file per model, organized in your existing folder structure
  • A manifest.json with metadata (model IDs, names, materializations, dependencies, documentation)

The SQL in each file uses Weld's native syntax. This format is ideal for backups or migrating models between Weld workspaces.

dbt Export

Downloads a zip containing a ready-to-use dbt project:

  • dbt_project.yml - project configuration
  • models/sources.yml - source definitions derived from your raw data dependencies
  • One .sql file per model under models/, with Jinja {{ ref() }} and {{ source() }} syntax
  • Materialization configs (e.g. {{ config(materialized='table') }}) where applicable

Import

Upload a .zip file containing .sql files to create or update models in your workspace. The import supports both Weld-native and dbt-formatted SQL files.

How It Works

  1. Upload your zip - Weld extracts and analyzes all .sql files in the archive.
  2. Automatic format detection - Weld detects whether your files are dbt (by looking for dbt_project.yml, sources.yml, or Jinja patterns like {{ ref() }}) or Weld-native.
  3. Dry run - Before any changes are applied, you get a preview showing exactly what will happen:
    • Create - New models that don't exist yet in your workspace.
    • Update - Existing models whose SQL has changed.
    • No change - Models that already match what's in the zip.
    • Error - Files that can't be imported (unresolved dependencies, unsupported Jinja, etc.).
  4. Review and commit - Once you're satisfied with the dry run results, confirm to apply the changes.

Folder Structure

The folder structure inside your zip is preserved. If you upload a file at analytics/marketing/campaign_stats.sql, Weld creates the analytics > marketing folder hierarchy and places the campaign_stats model inside it.

Dependency Resolution

During import, Weld resolves all model and source references:

  • Weld-native files: Dependencies using Weld's internal tag format are matched to existing models and raw views in your workspace.
  • dbt files: {{ ref('model_name') }} and {{ source('schema', 'table') }} references are resolved to the corresponding Weld models and synced raw data tables.

If a dependency can't be resolved, the file is flagged as an error and won't be imported.

Materialization

  • For dbt files, the {{ config(materialized='...') }} block is read and mapped to Weld materialization types (table, view).
  • If no materialization is specified, models default to view.
  • Unsupported materializations (e.g. incremental, ephemeral) are treated as view.

Limitations

Import Limitations

LimitationDetails
Max upload size50 MB (compressed zip).
Max uncompressed size200 MB total across all files.
Max number of SQL files500 per zip.
Max single file size5 MB per .sql file.
Unsupported JinjaOnly ref(), source(), and config() are supported for dbt files. Advanced Jinja (macros, if/for blocks, var(), custom tests, etc.) must be removed before importing.
Unresolved dependenciesAll referenced models and sources must already exist in your Weld workspace. If a dependency can't be matched, the file will fail to import.
Incremental / ephemeral modelsdbt incremental and ephemeral materializations are not natively supported. These are imported as view materializations.
Session expiryDry run sessions expire after 15 minutes. If you don't commit within that window, you'll need to re-upload the zip.
Data warehouse requiredYour workspace must have an active data warehouse connection. Models cannot be created without one.
No model deletionImport only creates or updates models. It does not delete models that exist in your workspace but are missing from the zip.

Export Limitations

LimitationDetails
Published models onlyOnly models with a published query are included in the export. Draft or unpublished models are excluded.
dbt compatibilityThe dbt export provides a starting point, but may require adjustments for advanced dbt features (custom macros, tests, snapshots, etc.).
Unresolved internal referencesAny {{ }} expressions in model SQL that are not ref(), source(), or config() are silently stripped during dbt export.

Rate Limits

Both import and export endpoints are rate-limited to 10 requests per hour per user to prevent abuse.

Was this page helpful?