sfu-db / lineagex

62 stars 4 forks source link

feat: allow passing variables that may exist in the loaded SQL files #7

Open lancetipton opened 3 months ago

lancetipton commented 3 months ago

Example

Original SQL

select zip, street from ${schema}_places.${type}_address;

Lineagex Call

    variables={
      '${schema}': 'staging',
      '${type}': 'home',
    }

    lineagex(sql='/path/to/sql/files', conn_string='...', variables=variables)

SQL after variable replacement

select zip, street from staging_places.home_address;