-
Install requirements in a virtual environment.
python -m venv venv source venv/bin/activate pip install -r requirements.txt
-
Create a
.env
file to connect to Materialize. Here is an example:export MZ_HOST=<id>.<region>.aws.materialize.cloud export [email protected] export MZ_PASSWORD=<app password> export MZ_PORT=6875 export MZ_DB=materialize export MZ_CLUSTER=chuck export MZ_SCHEMA=public export MZ_TRANSACTION_ISOLATION=serializable
-
Create a table in Materialize (e.g. from the Console SQL Shell).
create table t (id int, content text); insert into t values (1, 'hi'), (2, 'hello');
-
Run the application.
python app.py
Output:
ID: 1 Content: 'hi' ID: 2 Content: 'hello'
chuck-alt-delete / mz-sqlalchemy-example Goto Github PK
View Code? Open in Web Editor NEWSimple example for connecting SQL Alachemy to Materialize
License: MIT License