79515135

Date: 2025-03-17 16:19:50
Score: 0.5
Natty:
Report link

How about moving this to something like `table_config.js`?

e.g. declare/create the variables for <table_database>/ <table_schema>/<table_name> in includes/table_config.js:

var table_database="tb_db";
var table_schema="tb_sch";
var table_name="tb_nm";

module.exports = {
table_database,
table_schema,
table_name
}

config then have a definition for the table that uses table_config to run it e.g.

definitions/source/final_table01.sqlx

config {
    type: "declaration",
    database: table_config.table_database,
    schema: table_config.table_schema,
    name: table_config.table_name
}

Then whenever you want to call it you use:

SELECT * FROM ${ref(table_config.table_name)}
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Starts with a question (0.5): How
  • Low reputation (0.5):
Posted by: aclong