SQLAlchemy object relational mapper ( ORM ) development services by RasadaCrea, Grenoble - France. Database server with SQLAlchemy upon mysql database, postgresql, sqlite

Skip header | smaller text web accessibility bigger text web accessibility | easy print web main content share this web document with a partner

Universal SQL database abstraction to python objects with SQLAlchemy

sqlalchemy databases architectures and design services

SQLAlchemy object relational mapper ORM makes it trivial talking to any SQL database

custom mysql, postgresql, oracle, pysql, ms-sql database developments by RasadaCrea, Grenoble - France

Covered by the MIT License, SQLAlchemy object relational mapper ( ORM ) is the fundamental python SQL database toolkit, giving web application developers full seamless talking power to relational sql databases. Designed for efficient universal sql database access via simple python objects, SQLAlchemy includes implementations for various sql database back-ends such as SQLite, Postgresql, MySQL, Oracle, MS-SQL, Firebird, Sybase and more, most of which support multiple DBAPI.

Its data abstraction layer allows for both construction and manipulation of SQL expressions in a platform agnostic way. With his clean design and powerful features SQLAlchemy is by no doubt the best ORM possible choice made available by RasadaCrea to secure your web services applications and company data analysis :

  • All in one batch flush coupled with a queue dependency sort to respect inter-row dependencies
  • Function-based query construction via standard python programming functions and expressions
  • Interchangeable eager objects loading and lazy loading for best database access flexibility
  • Composite multiple-column primary keys and self referential tables and mappers
  • Single table, concrete table, and joined table inheritance

Robust database design made simple with SQLAlchemy ORM & python programming

>>> from sqlalchemy import create_engine, Table, Column, Integer, String, MetaData, Sequence
>>> from sqlalchemy.orm import mapper, sessionmaker
>>> engine = create_engine('sqlite:///:memory:')            ##connection to db
>>> metadata = MetaData()                                   ##knows about reflecting objects
>>> users_table = Table('users', metadata,
...     Column('id', Integer, Sequence('user_id_seq'), primary_key=True),
...     Column('name', String(50)), )
>>> metadata.create_all(engine)                             ##create the table
>>> class User(object):                                     ##python application object
...     def __init__(self, name):
...         self.name = name
...     def __repr__(self):
...         return "<User('%s')>" % (self.name)
>>> mapper(User, users_table)                               ##map python object to db table
>>> Session = sessionmaker(bind=engine); session=Session()  ##talking to db with a Session
>>> user_dan = User('dan')                                  ##a python user
>>> session.add(user_dan)                                   ##session buffer prior db flushing
>>> user = session.query(User).filter_by(name='dan').first()
>>> user is user_dan