Skip to content

Declaration

You can declare any external table as a data source in sqlanvil. Declaring external data sources that are external to sqlanvil lets you treat those data sources as sqlanvil objects.

Declaring data sources is optional, but can be useful when you want to do the following:

  • Reference or resolve declared sources in the same way as any other table in sqlanvil.
  • View declared sources in the visualized sqlanvil graph.
  • Use sqlanvil to manage the table-level and column-level descriptions of externally created tables.
  • Trigger workflow invocations that include all the dependents of an external data source.

You can create declarations in the following ways. Available config options are defined in DeclarationConfig, and are shared across all the followiing ways of creating declarations.

Using a SQLX file:

-- definitions/name.sqlx
config {
type: "declaration"
}
-- Note: no SQL should be present.

Using action configs files:

definitions/actions.yaml
actions:
- declare:
name: name

Using the Javascript API:

definitions/file.js
declare("name")
  • ActionBuilder‹Declaration›

    Declaration

columns(columns: ColumnDescriptor[]): this

deprecated Deprecated in favor of DeclarationConfig.columns.

Sets the column descriptors of columns in this table.

Parameters:

NameType
columnsColumnDescriptor[]

Returns: this


description(description: string): this

deprecated Deprecated in favor of DeclarationConfig.description.

Sets the description of this assertion.

Parameters:

NameType
descriptionstring

Returns: this