Repository navigation
feat(snowflake): Snowflake edition of the DIRECT Framework - #52
Merged
Merged
Conversation
Adds a snowflake folder with the framework in Snowflake Scripting: the OMD repository schemas, tables and reference data, registration and instance procedures, Batch and Module evaluation with rollback, RUN_MODULE and RUN_BATCH with load windows and a Batch hierarchy, a Task-based queue, processing and reporting views, deployment scripts for the Snowflake CLI and a README. Includes a regression test suite (23 Snowflake Scripting tests and a runner that deploys into a scratch database) that mirrors the SQL Server integration tests. The suite has not been run against Snowflake yet. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018oFuRFsRbFpqwLoZNGcjN4
Invoke-SqlFile returned the Snowflake CLI output together with the exit code, so the runner reported a failed deployment whenever the CLI printed anything. The output now goes to the host and only the exit code is returned. Verified on Snowflake: 22 tests pass, the queue test is skipped for a role without EXECUTE TASK. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018oFuRFsRbFpqwLoZNGcjN4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
snowflakefolder with the DIRECT Framework in Snowflake Scripting, so that a Snowflake solution registers its Batches and Modules in the same repository model as the SQL Server edition and runs them inside Snowflake. The folder is self-contained; nothing in the dacpac, the T-SQL procedures, the integration tests or the version files changes.What is in it
sql/01tosql/10: the OMD, OMD_METADATA, OMD_PROCESSING and OMD_REPORTING schemas inside the solution database (every object fully qualified through a<% database %>token), the repository tables with sequences, the reference data and settings, lookup functions, and the procedures:REGISTER_BATCH,REGISTER_MODULE,ADD_MODULE_TO_BATCH,ADD_BATCH_TO_PARENT_BATCH,SET_SETTING;INSERT_INTO_EVENT_LOG,CREATE_BATCH_INSTANCE,CREATE_MODULE_INSTANCE,UPDATE_BATCH_INSTANCE,UPDATE_MODULE_INSTANCE,SET_SOURCE_CONTROL_VALUES;BATCH_EVALUATIONandMODULE_EVALUATIONwith the abort, cancel and full or partial rollback semantics of 2.1.2;RUN_MODULE(load window, executable with:ModuleInstanceId,:StartValue,:EndValueand:ConsistencyDateTimetokens) andRUN_BATCH(Modules in sequence, then child Batches recursively,STOP_BATCH_ON_MODULE_FAILURE,THROW_ON_FAILURE);START_QUEUE,STOP_QUEUEandREMOVE_QUEUEfor a Task per Batch; processing and reporting views.Direct_Snowflake.sql: the single deployment file built from thesqlfolder (scripts/Build-DirectSnowflake.ps1), deployed withsnow sql -f Direct_Snowflake.sql -D database=<name> --enable-templating STANDARD. Rerunnable: tables and settings are kept, procedures and views replaced.scripts/: build, deploy, run a Batch, set or stop the schedule, andRun-DirectSnowflakeTests.ps1.tests/: a regression suite of 23 Snowflake Scripting tests (basic run, custom query, failure with and without throw, failure logging, abort on an unregistered relationship, rollback, one-off cancel, repeated failures and recovery, unregistered Module, Batch with one Module, Batch with a failing Module, partial rollback, hierarchy registration and run, disabled Module, relationship and Batch, load windows, the two update procedures, concurrency abort, queue Task) that mirror the SQL Server integration tests. Each test asserts its own outcome intoOMD_TEST.TEST_RESULT; the runner deploys into a scratch database and drops it afterwards.README.md: how a Batch runs, the executable contract, the queue, settings, deployment, testing, folder layout and the differences from the SQL Server edition.Not ported:
GetConsistencyTimestamp,TableCondensing, the external orchestration pairCreateBatchModuleInstancesandEndBatchModuleInstances(the executables run inside Snowflake), and the exception views that depend on SQL Server catalogs.Verification
ALTER TASK RESUMEneedsEXECUTE TASKon the account, which the test role lacks. Two full runs, about 15 minutes each.Notes
snowflake/Direct_Snowflake.sqlfrom the main branch of this repository, so the sample PR depends on this one.Generated by Claude Code