Summary
This connector reads the result of a SQL query from a Snowflake warehouse and turns each row into a document in a Moss search index.
It uses the official snowflake-connector-python driver, so it works against any Snowflake account — standard, enterprise, or Snowflake-on-Azure.
To get started
- Read
_template/README.md.
- Copy the template:
cd packages/moss-data-connector
cp -r _template moss-connector-snowflake
cd moss-connector-snowflake
- Rename
TemplateConnector → SnowflakeConnector in src/connector.py, update src/__init__.py to re-export it, and fill in pyproject.toml.
- Implement
__iter__ using snowflake.connector. Use DictCursor (from snowflake.connector import DictCursor) so rows come back as dicts instead of tuples.
Deliverables
The caller should be able to write:
from moss_connector_snowflake import SnowflakeConnector, ingest
from moss import DocumentInfo
source = SnowflakeConnector(
account="xy12345.us-east-1",
user="your_user",
password="your_password",
warehouse="COMPUTE_WH",
database="MY_DB",
schema="PUBLIC",
query="SELECT id, title, body FROM articles",
mapper=lambda row: DocumentInfo(
id=str(row["ID"]),
text=row["BODY"],
metadata={"title": row["TITLE"]},
),
)
await ingest(source, project_id="...", project_key="...", index_name="articles")
Files:
Required for review / PR acceptance
Summary
This connector reads the result of a SQL query from a Snowflake warehouse and turns each row into a document in a Moss search index.
It uses the official
snowflake-connector-pythondriver, so it works against any Snowflake account — standard, enterprise, or Snowflake-on-Azure.To get started
_template/README.md.TemplateConnector→SnowflakeConnectorinsrc/connector.py, updatesrc/__init__.pyto re-export it, and fill inpyproject.toml.__iter__usingsnowflake.connector. UseDictCursor(from snowflake.connector import DictCursor) so rows come back as dicts instead of tuples.Deliverables
The caller should be able to write:
Files:
src/connector.py—SnowflakeConnectorclasssrc/__init__.py— re-exportsSnowflakeConnectorandingestsrc/ingest.py— copy from_template/src/ingest.pypyproject.toml— listssnowflake-connector-python>=3.0tests/test_snowflake.py— unit test with mockedsnowflake.connector.connectandMossClienttests/test_integration_snowflake_moss.py— live test, skips withoutSNOWFLAKE_ACCOUNT,SNOWFLAKE_USER,SNOWFLAKE_PASSWORD, and Moss credsREADME.mdpackages/moss-data-connector/README.mdRequired for review / PR acceptance