Skip to content

nibbleai/sqlalchemy-router

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SQLAlchemy router

Dummy example to show SQLAlchemy's routing capabilities.

The goal is to easily switch db engine whether we are writing (using the master database) or reading (using read-replicas).

Inspired by Michael Bayer's blog, creator of SQLAlchemy.

Usage

Assuming you have a Python interpreter available in your PATH, with SQLAlchemy installed:

$ git clone https://github.com/nibbleai/sqlalchemy-router.git
$ cd sqlalchemy-router
$ python main.py

Now read the logs: writes are done on master.db, reads are done on either one of available replicas.

About

Demo for sqlalchemy db routing capabilities

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages