Skip to content

Session

Contains methods that are published globally, so can be invoked anywhere in the /definitions folder of a sqlanvil project.

  • Session

projectConfig: ProjectConfig

Stores the sqlanvil project configuration of the current sqlanvil project. Can be accessed via the sqlanvil global variable.

Example:

sqlanvil.projectConfig.vars.myVariableName === "myVariableValue"

assert(name: string, queryOrConfig?: AContextable‹string› | AssertionConfig): Assertion

Adds a sqlanvil assertion the compiled graph.

Available only in the /definitions directory.

see assertion for examples on how to use.

Parameters:

NameType
namestring
queryOrConfig?AContextable‹string› | AssertionConfig

Returns: Assertion


declare(config: DeclarationConfig | any): Declaration

Declares the dataset as a sqlanvil data source.

Available only in the /definitions directory.

see Declaration for examples on how to use.

Parameters:

NameType
configDeclarationConfig | any

Returns: Declaration


notebook(config: NotebookConfig): Notebook

Creates a Notebook action.

Available only in the /definitions directory.

see Notebook for examples on how to use.

Parameters:

NameType
configNotebookConfig

Returns: Notebook


operate(name: string, queryOrConfig?: ContextableIActionContext, string | string[]› | OperationConfig): Operation

Defines a SQL operation.

Available only in the /definitions directory.

see operation for examples on how to use.

Parameters:

NameType
namestring
queryOrConfig?ContextableIActionContext, string | string[]› | OperationConfig

Returns: Operation


publish(name: string, queryOrConfig?: ContextableITableContext, string› | TableConfig | ViewConfig | IncrementalTableConfig | ILegacyTableConfig | any): Table | IncrementalTable | View

Creates a table, view, or incremental table.

Available only in the /definitions directory.

see Operation for examples on how to make tables.

see View for examples on how to make views.

see IncrementalTable for examples on how to make incremental tables.

Parameters:

NameType
namestring
queryOrConfig?ContextableITableContext, string› | TableConfig | ViewConfig | IncrementalTableConfig | ILegacyTableConfig | any

Returns: Table | IncrementalTable | View


test(name: string): Test

Creates a Test action.

Available only in the /definitions directory.

see Test for examples on how to use.

Parameters:

NameType
namestring

Returns: Test