Titan-Systems / titan

Titan Core - Snowflake infrastructure-as-code. Provision environments, automate deploys, CI/CD. Manage RBAC, users, roles, and data access. Declarative Python Resource API. Change Management tool for the Snowflake data warehouse.
Apache License 2.0
412 stars 24 forks source link

BUG: wrong order of keywords on creating transient database #97

Closed aleenprd closed 1 month ago

aleenprd commented 2 months ago
titan_test_db = Database(
    name="TITAN_TEST_DB",
    comment="This is a database used for testing of titan[core].",
    transient=True,
    owner="SYSADMIN",
    data_retention_time_in_days=None,
    max_data_extension_time_in_days=None,
)

results in

snowflake.connector.errors.ProgrammingError: 001003: failed to execute sql, [CREATE DATABASE TITAN_TEST_DB TRANSIENT COMMENT = $$This is a database used for testing of titan[core].$$]

The correct syntax is: CREATE TRANSIENT DATABASE TITAN_TEST_DB COMMENT = $$This is a database used for testing of titan[core].$$;

aleenprd commented 2 months ago

Same thing for schemassnowflake.connector.errors.ProgrammingError: 001003: failed to execute sql, [CREATE SCHEMA TITAN_TEST_DB.TITAN_TEST_SCHEMA TRANSIENT COMMENT = $$This is a schema used for testing purposes of titan[core].$$]

teej commented 1 month ago

Fixed in v0.9