pyeventsourcing / eventsourcing-sqlalchemy Goto Github PK
View Code? Open in Web Editor NEWPython package for eventsourcing with SQLAlchemy
License: BSD 3-Clause "New" or "Revised" License
Python package for eventsourcing with SQLAlchemy
License: BSD 3-Clause "New" or "Revised" License
Is there a plan to make this not require SQLAlchemy 1.4? Is there breakage in v2.0 that prevents the library from working?
During an exploratory test
os.environ['INFRASTRUCTURE_FACTORY'] = 'eventsourcing_sqlalchemy.factory:Factory'
os.environ["SQLALCHEMY_URL"] = "sqlite:///wtf.sqlite3"
and running a demo application as described in the readme, we see a wtf.sqlite3 DB file created correctly while
os.environ["PERSISTENCE_MODULE"] = "eventsourcing_sqlalchemy"
os.environ["SQLALCHEMY_URL"] = "sqlite:///wtf.sqlite3"
does not cause the same effect.
Any ideas what could be the root cause?
Also we noticed that
os.environ["PERSISTENCE_MODULE"] = "any_random_string"
does not make the application crash, while changes to INFRASTRUCTURE_FACTORY are validated right away.
Hi @johnbywater
First, thanks for promoting and supporting eventsourcing through your excellent work!
In my scenario, I have an existing Postgres session (see code snippet below). I would like to re-use this session in my application recorder, which is derived from SQLAlchemyApplicationRecorder
. The reason for this is that I do CRUD operations in the database first (outside of the scope of the eventsourced application), and then change my eventsourced application; and I need to achieve atomicity for both my CRUD changes and the eventsourced changes together.
I looked at the infrastructure factory in eventsourcing_sqlalchemy/factory.py
, and the SQLAlchemyDatastore
, but could not find out how to inject my own session.
Can you help?
This is how I define SessionLocal
, which I then use to create my session, outside of my eventsourced application:
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
engine = create_engine(url) : Engine
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
I'd appreciate any hints on this!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.