Skip to main content

SQLAlchemy dependency for nameko services

Project description

A SQLAlchemy dependency for nameko, enabling services to interface with a relational database.

Usage

from nameko_sqlalchemy import Session

from .models import Model, DeclarativeBase

class Service(object):

    session = Session(DeclarativeBase)

    @entrypoint
    def write_to_db(self):
        model = Model(...)
        self.session.add(model)
        self.session.commit()

    @entrypoint
    def query_db(self):
        queryset = self.session.query(Model).filter(...)
        ...

Database drivers

You may use any database driver compatible with SQLAlchemy provided it is safe to use with eventlet. This will include all pure-python drivers. Known safe drivers are:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nameko-sqlalchemy-0.0.2.tar.gz (3.2 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page