Metadata-Version: 1.0
Name: sqlalchemy_nuodb
Version: 2.0
Summary: NuoDB Dialect and ORM Extension for SQLAlchemy
Home-page: https://github.com/nuodb/nuodb-sqlalchemy
Author: NuoDB
Author-email: info@nuodb.com
License: BSD licence, see LICENCE.txt
Description: NuoDB - SQLAlchemy
        ==================
        
        [![Build Status](https://travis-ci.org/nuodb/nuodb-sqlalchemy.png?branch=master)](https://travis-ci.org/nuodb/nuodb-sqlalchemy)
        
        This is the official SQLAlchemy pip package for [NuoDB](http://www.nuodb.com). It leverages the NuoDB [Python Driver](https://github.com/nuodb/nuodb-python)
        
        Note: At this time the Python/SQLAlchemy Interface does not support Windows.
        
        ### Requirements
        
        If you haven't already, [Download and Install NuoDB](http://nuodb.com/download-nuodb/)
        
        ### Install
        
        Install from source by cloning the repository and then running
        
        ```bash
        cd nuodb-sqlalchemy
        sudo python setup.py install
        ```
        
        Or install from pip
        
        ```
        pip install sqlalchemy_nuodb
        ```
        
        ### Example
        
        ```python
        """ This assumes that you have the quickstart database running (test@localhost).
        If you don't, you can start it by running /opt/nuodb/run-quickstart
        """
        import sqlalchemy_nuodb
        
        from sqlalchemy.orm             import sessionmaker
        from sqlalchemy                 import create_engine
        from sqlalchemy.ext.declarative import declarative_base
        from sqlalchemy                 import Column, Integer, String
        
        # perform simple query
        engine = create_engine("nuodb://dba:goalie@localhost:48004/test?schema=hockey", echo=True)
        results = engine.execute("select * from hockey")
        
        for result in results:
            print result
            
        # do same as above declaratively
        Base = declarative_base()
        
        # define hockey object
        class Hockey(Base):
            __tablename__ = 'hockey'
        
            id          = Column(Integer, primary_key=True)
            number      = Column(Integer)
            name        = Column(String)
            position    = Column(String)
            team        = Column(String)
            
            def __init__(self, id, number, name, position, team):
                self.id         = id
                self.number     = number
                self.name       = name
                self.position   = position
                self.team       = team
        
            def __repr__(self):
                return "<Hockey('%s','%s','%s','%s','%s')>" % (self.id, self.number, self.name, self.position, self.team)
        
        # bind to previously created engine & create a session
        Session = sessionmaker(bind=engine)
        session = Session()
        
        # print each row
        for row in session.query(Hockey).all():
            print row
        ```
        
        ### License
        
        [NuoDB License](https://github.com/nuodb/nuodb-sqlalchemy/blob/master/LICENSE)
        
        [![githalytics.com alpha](https://cruel-carlota.pagodabox.com/18bfc30e250393c3c9ac513a06d4a25b "githalytics.com")](http://githalytics.com/nuodb/nuodb-sqlalchemy)
        
Keywords: nuodb sqlalchemy orm scalable cloud database
Platform: UNKNOWN
