Declaration
Class: Declaration
Section titled “Class: 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.sqlxconfig { type: "declaration"}-- Note: no SQL should be present.Using action configs files:
actions:- declare: name: nameUsing the Javascript API:
declare("name")Hierarchy
Section titled “Hierarchy”-
ActionBuilder‹Declaration›
↳ Declaration
Methods
Section titled “Methods”Methods
Section titled “Methods”columns
Section titled “columns”▸ columns(columns: ColumnDescriptor[]): this
deprecated Deprecated in favor of
DeclarationConfig.columns.
Sets the column descriptors of columns in this table.
Parameters:
| Name | Type |
|---|---|
columns | ColumnDescriptor[] |
Returns: this
description
Section titled “description”▸ description(description: string): this
deprecated Deprecated in favor of
DeclarationConfig.description.
Sets the description of this assertion.
Parameters:
| Name | Type |
|---|---|
description | string |
Returns: this