How snowflake-labs/sc.ddlexportscripts works
Project type and purpose
• This is neither a monolithic full-stack app nor a GUI tool; it is an extensible collection of command-line export scripts (“plugins”) targeted at different relational and Big Data engines (Teradata, SQL Server, Oracle, Redshift, Netezza, Vertica, DB2, Hive, BigQuery, Databricks).
• Its sole purpose is to extract DDL/code from various database platforms in formats ingestible by the SnowConvert migration engine.
File structure
• Top-level directories: one vendor per folder (e.g., Teradata/, SQLServer/, Oracle/, …). Each contains:
• executable scripts (shell, PowerShell, .bat) under bin/ or directly at root
• SQL templates or helper libraries under scripts/ or similar
• “AlternativeSQLServerExtractionMethods” holds community/PowerShell variants.
• Tests/ covers automated validation per vendor (e.g., Tests/Teradata/).
• CI pipeline definitions under .github/workflows drive code-quality, packaging, and release.
README for additional insights
• README confirms the pattern: “Export Scripts for X” linking each vendor’s subfolder.
• No central orchestration code—each module runs independently.
a. Main components
• Script Launcher / CLI (user entrypoint)
• Vendor-Specific Export Modules (one per platform)
• Output: DDL Files (flat files or STDOUT)
• SnowConvert Migration Engine (external service/consumer)
• Test Harness (internal QA)
• CI/CD Pipelines (.github workflows)
b. Relationships & interactions
1. User/Automation triggers CLI
2. CLI invokes chosen Vendor Module
3. Module connects to target DB instance → extracts DDL → writes to storage (local FS or stream)
4. Extracted artifacts passed to SnowConvert (via API or file drop)
5. Test Harness invokes modules in containerized DB environments (e.g., Docker) and verifies expected outputs
6. CI/CD workflows run linting, tests, packaging, and release asset uploads
c. Architectural patterns
• Plugin-style modularity: each vendor’s scripts are isolated and interchangeable
• Separation of concerns: extraction logic vs. testing vs. CI/CD
• Script-based orchestration (no heavy frameworks)
d. Key technologies
• Shell scripts (bash, .sh)
• PowerShell scripts (.ps1)
• Python modules (Vertica, possibly Databricks)
• CI: GitHub Actions
• Containerization for Tests: Docker (e.g., DB2, Teradata)
Capturing essential architectural elements
• Shared utilities or configuration files (e.g., .env) if relevant.