Internal Stored Procedures
APPLY_INBOUND_SYNC_SETTINGS
Applies settings to an inbound sync/branch. If a BRANCH_NAME other than 'main' is provided and the branch doesn't exist, it will be created. If MATCH_REQUIRED is true and the provided SYNC_PARAMETERS and STREAMS_CONFIGURATION don't match, then the response 'data' element 'settingsApplied' will be false, along with 'mismatchDetails' which describe why. This is used by external schedulers such as dbt to know when their configuration definition is the correct one.
Arguments
SYNC_ID
FLOAT
SYNC_SLUG
VARCHAR
CONNECTION_SLUG
VARCHAR
BRANCH_NAME
VARCHAR
MATCH_REQUIRED
BOOLEAN
SYNC_PARAMETERS
OBJECT
SYNC_PARAMETERS_BRANCH
OBJECT
STREAMS_CONFIGURATION
OBJECT
ACTIVATE_BRANCH
BOOLEAN
INBOUND_RECORDS_BEHAVIOUR
VARCHAR
INBOUND_STREAM_STATE_BEHAVIOUR
VARCHAR
REOPEN_BEHAVIOUR
VARCHAR
INBOUND_STORAGE_LOCATION
OBJECT
Return Type
OBJECT
APPLY_OUTBOUND_SYNC_SETTINGS
Applies settings to an outbound sync/branch. If a BRANCH_NAME other than 'main' is provided and the branch doesn't exist, it will be created. If MATCH_REQUIRED is true and the provided SYNC_PARAMETERS and STREAMS_CONFIGURATION don't match, then the response 'data' element 'settingsApplied' will be false, along with 'mismatchDetails' which describe why. This is used by external schedulers such as dbt to know when their configuration definition is the correct one.
Arguments
SYNC_ID
FLOAT
SYNC_SLUG
VARCHAR
CONNECTION_SLUG
VARCHAR
BRANCH_NAME
VARCHAR
SOURCE_DATABASE
VARCHAR
SOURCE_SCHEMA
VARCHAR
SOURCE_TABLE
VARCHAR
SOURCE_ID_COLUMN
VARCHAR
MATCH_REQUIRED
BOOLEAN
SYNC_PARAMETERS
OBJECT
SYNC_PARAMETERS_BRANCH
OBJECT
FIELD_MAPPINGS
OBJECT
ACTIVATE_BRANCH
BOOLEAN
OUTBOUND_RECORD_STATE_BEHAVIOUR
VARCHAR
REOPEN_BEHAVIOUR
VARCHAR
OUTBOUND_BRANCH_RECORD_FILTER
ARRAY
Return Type
OBJECT
DELETE_OUTBOUND_STAGED_RECORDS_BY_APPLY_STATE
Deletes outbound records from the OUTBOUND_SYNC_RECORD_STATE table, if they match the given APPLY_STATE. This procedure is intended to only be used manually in emergencies, such as if duplicate identifiers somehow make their way past the checks into the table.
Arguments
SYNC_SLUG
VARCHAR
BRANCH_NAME
VARCHAR
APPLY_STATE
VARCHAR
Return Type
OBJECT
GET_INBOUND_ALL_STREAMS_VIEW_DEFINITIONS
Provides normalized view definitions to external systems like dbt, if it's their job to create them instead of the sync engine.
Arguments
SYNC_SLUG
VARCHAR
BRANCH_NAME
VARCHAR
Return Type
OBJECT
GET_INBOUND_STREAM_VIEW_DEFINITION
Provides a normalized view definition to external systems like dbt, if it's their job to create them instead of the sync engine.
Arguments
SYNC_SLUG
VARCHAR
BRANCH_NAME
VARCHAR
STREAM_NAME
VARCHAR
Return Type
OBJECT
MARK_RECORDS_FOR_SKIP
Marks a specific list of outbound records (by identifier) for skip in bulk.
Arguments
SYNC_SLUG
VARCHAR
BRANCH_NAME
VARCHAR
APPLY_STATE
VARCHAR
RECORD_IDS
ARRAY
Return Type
OBJECT
MARK_STREAMS_FOR_FULL_REFRESH
Marks a set of streams for full refresh at the next scheduled run. Includes a flag which determines whether or not to truncate the tables.
Arguments
SYNC_ID
NUMERIC
BRANCH_NAME
VARCHAR
STREAMS
ARRAY
TRUNCATE
BOOLEAN
Return Type
OBJECT
PAUSE_SYNC
Marks a sync as being paused, and suspends any related Snowflake tasks.
Arguments
SYNC_SLUG
VARCHAR
BRANCH_NAME
VARCHAR
Return Type
OBJECT
RESUME_SYNC
Marks a sync as scheduled, and resumes any associated Snowflake tasks.
Arguments
SYNC_SLUG
VARCHAR
BRANCH_NAME
VARCHAR
Return Type
OBJECT
RUN_SYNC
Enqueues a sync run for processing, and optionally waits for it to finish. If WAIT_FOR_COMPLETION is false, the result of this call is information about whether the sync run was able to be enqueued. In this situation, a second task is manually ran which performs the processing.
Arguments
SYNC_ID
FLOAT
If you provide this, SYNC_SLUG must be null.
SYNC_SLUG
VARCHAR
If you provide this, SYNC_ID must be null.
BRANCH_NAME
VARCHAR
Pass in 'main' for the main sync.
RUN_SOURCE_NAME
VARCHAR
Provide the value 'external' if you are calling this proc from your own external scheduler.
RUN_SOURCE_METADATA
OBJECT
Provide any values relevant to your external scheduler that you'd like to track.
WAIT_FOR_COMPLETION
BOOLEAN
'true' to execute the proc until the run completes, 'false' to return immediately and run asynchronously.
Return Type
OBJECT
SET_INBOUND_SYNC_STATE
Manually overrides the current sync state for an inbound sync. Only intended to be used under the direction of support staff, as it's safest for plugins to maintain their own state.
Arguments
SYNC_SLUG
VARCHAR
STREAM_NAME
VARCHAR
STREAM_STATE
OBJECT
Return Type
OBJECT
SET_SYNC_NAME
Updates the name of a sync.
Arguments
SYNC_SLUG
VARCHAR
SYNC_NAME
VARCHAR
Return Type
OBJECT
Last updated