LocalStack Extension: Snowflake
Project description
LocalStack is a cloud software development framework to develop and test your Snowflake data pipelines locally.
Overview •
Install •
Quickstart •
Base Image Tags •
Releases •
Support •
License
📖 Docs •
☑️ Function coverage
Overview
LocalStack is a cloud service emulator that runs in a single container on your laptop or in your CI environment. LocalStack Snowflake emulator replicates the functionality of the real Snowflake platform, allowing you to perform operations without an internet connection or a Snowflake account. This is valuable for developing and testing Snowflake data pipelines entirely on the local machine (and in CI pipelines), enabling quick feedback cycles, and not incurring costs of using the real system.
LocalStack Snowflake emulator supports the following features:
- Basic operations on warehouses, databases, schemas, and tables
- Storing files in user/data/named stages
- Snowpark libraries
- Snowpipe streaming with Kafka connector
- JavaScript and Python UDFs
- … and more!
Install
You can use the Snowflake Docker image to run the LocalStack Snowflake emulator. The Snowflake Docker image is available on the LocalStack Docker Hub. To pull the Snowflake Docker image, execute the following command:
docker pull localstack/snowflake
You can start the Snowflake Docker container using the following methods:
Note: Before starting, ensure you have a valid
LOCALSTACK_AUTH_TOKEN
to access the LocalStack Snowflake emulator. Refer to the Auth Token guide to obtain your Auth Token and specify it in theLOCALSTACK_AUTH_TOKEN
environment variable.
localstack
CLI
To start the Snowflake Docker container using the localstack
CLI, execute the following command:
export LOCALSTACK_AUTH_TOKEN=<your-auth-token>
IMAGE_NAME=localstack/snowflake localstack start
docker
CLI
To start the Snowflake Docker container using the docker
CLI, execute the following command:
docker run \
--rm -it \
-p 4566:4566 \
-e LOCALSTACK_AUTH_TOKEN=${LOCALSTACK_AUTH_TOKEN:?} \
localstack/snowflake
Docker Compose
Create a docker-compose.yml
file with the specified content:
version: "3.8"
services:
localstack:
container_name: "localstack-main"
image: localstack/snowflake
ports:
- "127.0.0.1:4566:4566"
environment:
- LOCALSTACK_AUTH_TOKEN=${LOCALSTACK_AUTH_TOKEN:?}
volumes:
- "./volume:/var/lib/localstack"
Start the Snowflake Docker container with the following command:
docker-compose up
Quickstart
After starting the Snowflake Docker container, you can use the Snowflake Python Connector to interact with the LocalStack Snowflake emulator. The following example demonstrates how to create a Snowflake table using the Snowflake Python Connector:
connection = snowflake.connector.connect(
user="test",
password="test",
account="test",
database="test",
host="snowflake.localhost.localstack.cloud",
)
connection.cursor().execute("CREATE TABLE table1(col1 INT)")
Check out our documentation for more examples and guides.
Base Image Tags
We currently push the latest
tag as our default tag. This tag is fully tested using our extensive integration test suite. This tag should be used if you want to stay up-to-date with the latest changes.
Releases
Please refer to our changelog page to see the complete list of changes for each release.
Support
Get in touch with the LocalStack Team to report issues & request new features, on the following channels:
License
(c) 2024 LocalStack
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file localstack-extension-snowflake-0.1.24.tar.gz
.
File metadata
- Download URL: localstack-extension-snowflake-0.1.24.tar.gz
- Upload date:
- Size: 49.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e2fbf41408184c1bd87714e45c03a9623af2ae32fe87bbef5832fbe15e406e2 |
|
MD5 | 9d3a5ad82e99afdc71dd00c14fd1b8ce |
|
BLAKE2b-256 | 021468dd1ae7223d55a035f6a86c187c8b56e7e33a7dd9b51dc842ff3190fff3 |