Skip to content

Instantly share code, notes, and snippets.

@willvousden
willvousden / serialize.py
Created January 29, 2018 15:25 — forked from khayrov/serialize.py
Serializable transactions and retry in SQLAlchemy
from sqlalchemy import (create_engine, event,
Column, Integer,
ForeignKey)
from sqlalchemy import event
from sqlalchemy.orm import sessionmaker, scoped_session
from sqlalchemy.orm import relationship
from sqlalchemy.ext.declarative import declarative_base, declared_attr
from sqlalchemy.exc import DBAPIError
import sqlite3