Giter Club home page Giter Club logo

eventsourcing-sqlalchemy's People

Contributors

chris927 avatar dependabot[bot] avatar johnbywater avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

eventsourcing-sqlalchemy's Issues

SqlAlchemy 2.0 compatibility

Is there a plan to make this not require SQLAlchemy 1.4? Is there breakage in v2.0 that prevents the library from working?

INFRASTRUCTURE_FACTORY vs PERSISTENCE_MODULE problems

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.

How to inject existing db session?

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.