Skip to content

feat: Write native destination plugin DDL to files with out executing them on destination #19258

Open

Description

@DougEverly

Which problem is this feature request solving?

I would like to write the DDL that will be executed to files, without executing them on the destination.

This will allow for:

  • inspection before executing on the destination
  • executing them manually or out-of-band on the desintation as-is
  • allow for modifications before executing (like additional indexes, etc)

An example is given GCP source and Postgresql destination configs, write the SQL to create the tables files without creating/migrating the tables and without syncing.

Describe the solution you'd like

Perhaps adding "ddl" or "native" format to the --format flag.

cloudquery tables ./directory --filter spec --format native

The output is whatever code is generated to create the destination object (table, etc).

  • postgresql would emit SQL
  • etc

Pull request (optional)

  • I can submit a pull request

Activity

  1. erezrokah commented on Oct 1, 2024

    @erezrokah
    Member

    Hi @DougEverly, that's an interesting feature to have. Please note some plugins don't have a DDL per say, for example the S3 destination (or any file based destination). Others create the schema via Go APIs (like the BigQuery destination).

    For the use case you outlines I belive the following:

    • executing them manually or out-of-band on the desintation as-is
    • allow for modifications before executing (like additional indexes, etc)

    Can be solved by the cloudquery migrate command, possible with the cloudquery sync --no-migrate command and flag.

    For

    • inspection before executing on the destination

    Could be solved in a bit more involved way I think of running cloudquery migrate towards a temporary/dedicate schema

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions