Skip to content

uberclerk/nameko-sqlalchemy

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nameko-sqlalchemy

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:

About

SQLAlchemy dependency for nameko services

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%