Thyme
Sources & Integrations

SnowflakeSource

Polling connector for Snowflake tables - incremental reads via a cursor field.

SnowflakeSource reads from a Snowflake table incrementally, tracking a cursor field and fetching new rows on each poll.

Use case

  • Slow-moving dimensional tables that already live in Snowflake (customer attributes, product catalog)
  • Materialized views or curated marts surfacing analytics-ready event data
  • Batch-fed event tables that are insert-only

Example

from thyme import Secret
from thyme.connectors import SnowflakeSource, source

@source(
    SnowflakeSource(table="ORDERS", password=Secret(env="SNOWFLAKE_PW")),
    cursor="timestamp", every="5m", max_lateness="1h",
)
@dataset(index=True)
class Order:
    user_id:   Field[str]      = field(key=True)
    amount:    Field[float]    = field()
    timestamp: Field[datetime] = field(timestamp=True)

Parameters

ParameterRequiredDefault / env varDescription
tableYes-Table name
accountNoTHYME_SNOWFLAKE_ACCOUNTSnowflake account identifier
databaseNoTHYME_SNOWFLAKE_DATABASEDatabase name
warehouseNoTHYME_SNOWFLAKE_WAREHOUSECompute warehouse
userNoTHYME_SNOWFLAKE_USERUsername
passwordNo (Secret-capable)THYME_SNOWFLAKE_PASSWORDPassword
schemaNoTHYME_SNOWFLAKE_SCHEMA ("PUBLIC")Schema name
roleNoTHYME_SNOWFLAKE_ROLESnowflake role

Limits

  • The cursor field must be monotonically non-decreasing. Snowflake's INSERT_TIME system column is a safe default if your application can't guarantee ordering on its own column.
  • Polling intervals shorter than ~1 minute may incur unnecessary Snowflake compute cost - Thyme is designed for sub-second freshness via streaming sources, not high-frequency polling of a warehouse.

On this page