Skip to content

Example of using vitess with sqlalchemy

Notifications You must be signed in to change notification settings

jawabuu/sqlalchemy-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Demo of Vitess with SQLAlchamy

This is a simple demo showing the basics of using Vitess with SQLALchamy.

Instructions

  1. Create the vitess cluster using cluster.yaml and the Planetscale Operator 1a. Forward the ports from the vitess cluster to your local development machine
kubectl port-forward service/vtctld-example-uswest 15000& kubectl port-forward service/vtctld-example-uswest 15999& kubectl port-forward service/vtgate-example-uswest 3306&
  1. Load the lookup_vschema.json and alchemy_vschema.json files
vtctlclient -server localhost:15999 ApplyVSchema -vschema "$(cat lookup_vschema.json)" lookup
vtctlclient -server localhost:15999 ApplyVSchema -vschema "$(cat alchemy_vschema.json)" lookup
  1. Load the lookup SQL
cat lookup.sql |  mysql -h 127.0.0.1 -P 3306 -u mysql_user -pmysql_password lookup
  1. Run the sample program
python schema.py

About

Example of using vitess with sqlalchemy

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published