All Projects → siddhantgoel → Tornado Sqlalchemy

siddhantgoel / Tornado Sqlalchemy

Licence: mit
SQLAlchemy support for Tornado

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Tornado Sqlalchemy

Python For Entrepreneurs Course Demos
Contains all the "handout" materials for Talk Python's Python for Entrepreneurs course. This includes notes and the final version of the website code.
Stars: ✭ 247 (+120.54%)
Mutual labels:  orm, sqlalchemy, database
Sandman2
Automatically generate a RESTful API service for your legacy database. No code required!
Stars: ✭ 1,765 (+1475.89%)
Mutual labels:  orm, sqlalchemy, database
Sqlservice
The missing SQLAlchemy ORM interface.
Stars: ✭ 159 (+41.96%)
Mutual labels:  orm, sqlalchemy, database
Gino
GINO Is Not ORM - a Python asyncio ORM on SQLAlchemy core.
Stars: ✭ 2,299 (+1952.68%)
Mutual labels:  asyncio, orm, sqlalchemy
Piccolo
A fast, user friendly ORM and query builder which supports asyncio.
Stars: ✭ 219 (+95.54%)
Mutual labels:  asyncio, orm, database
Qb
The database toolkit for go
Stars: ✭ 524 (+367.86%)
Mutual labels:  orm, sqlalchemy, database
Architect
A set of tools which enhances ORMs written in Python with more features
Stars: ✭ 320 (+185.71%)
Mutual labels:  orm, sqlalchemy, database
Tornado Celery
Non-blocking Celery client for Tornado
Stars: ✭ 561 (+400.89%)
Mutual labels:  asyncio, asynchronous, tornado
Orator
The Orator ORM provides a simple yet beautiful ActiveRecord implementation.
Stars: ✭ 1,234 (+1001.79%)
Mutual labels:  orm, database
Aiomysql
aiomysql is a library for accessing a MySQL database from the asyncio
Stars: ✭ 1,252 (+1017.86%)
Mutual labels:  asyncio, sqlalchemy
Sqla Wrapper
A friendly wrapper for SQLAlchemy
Stars: ✭ 111 (-0.89%)
Mutual labels:  sqlalchemy, database
Data Driven Web Apps With Pyramid And Sqlalchemy
Demos and handouts for Talk Python's Data-Driven Web Apps with Pyramid and SQLAlchemy course
Stars: ✭ 79 (-29.46%)
Mutual labels:  sqlalchemy, database
Ef6
This is the codebase for Entity Framework 6 (previously maintained at https://entityframework.codeplex.com). Entity Framework Core is maintained at https://github.com/dotnet/efcore.
Stars: ✭ 1,218 (+987.5%)
Mutual labels:  orm, database
Evolutility Server Node
Model-driven REST or GraphQL backend for CRUD and more, written in Javascript, using Node.js, Express, and PostgreSQL.
Stars: ✭ 84 (-25%)
Mutual labels:  orm, database
Rdbc
Asynchronous database access for Scala and Java
Stars: ✭ 78 (-30.36%)
Mutual labels:  asynchronous, database
Entityworker.core
EntityWorker is an object-relation mapper(ORM) that enable .NET developers to work with relations data using objects. EntityWorker is an alternative to entityframwork. is more flexible and much faster than entity framework.
Stars: ✭ 91 (-18.75%)
Mutual labels:  orm, database
Nymph
Data objects for JavaScript and PHP.
Stars: ✭ 97 (-13.39%)
Mutual labels:  orm, database
Sqlalchemy Hana
SQLAlchemy Dialect for SAP HANA
Stars: ✭ 75 (-33.04%)
Mutual labels:  orm, sqlalchemy
Prisma
Next-generation ORM for Node.js & TypeScript | PostgreSQL, MySQL, MariaDB, SQL Server, SQLite & MongoDB (Preview)
Stars: ✭ 18,168 (+16121.43%)
Mutual labels:  orm, database
Oreilly reactive python for data
Resources for the O'Reilly online video "Reactive Python for Data"
Stars: ✭ 98 (-12.5%)
Mutual labels:  sqlalchemy, database

tornado-sqlalchemy

.. image:: https://travis-ci.org/siddhantgoel/tornado-sqlalchemy.svg?branch=stable :target: https://travis-ci.org/siddhantgoel/tornado-sqlalchemy

.. image:: https://badge.fury.io/py/tornado-sqlalchemy.svg :target: https://pypi.python.org/pypi/tornado-sqlalchemy

.. image:: https://readthedocs.org/projects/tornado-sqlalchemy/badge/?version=latest :target: https://tornado-sqlalchemy.readthedocs.io/en/latest/

.. image:: https://img.shields.io/pypi/pyversions/tornado-sqlalchemy.svg :target: https://pypi.python.org/pypi/tornado-sqlalchemy

Python helpers for using SQLAlchemy_ with Tornado_.

Installation

.. code-block:: bash

$ pip install tornado-sqlalchemy

In case you prefer installing from the Github repository, please note that :code:master is the development branch so :code:stable is what you should be installing from.

Usage

.. code-block:: python

from tornado.gen import coroutine
from tornado.web import Application, RequestHandler
from tornado_sqlalchemy import as_future, SessionMixin, SQLAlchemy

class NativeCoroutinesRequestHandler(SessionMixin, RequestHandler):
    async def get(self):
        with self.make_session() as session:
            count = await as_future(session.query(User).count)

        self.write('{} users so far!'.format(count))

class GenCoroutinesRequestHandler(SessionMixin, RequestHandler):
    @coroutine
    def get(self):
        with self.make_session() as session:
            count = yield as_future(session.query(User).count)

        self.write('{} users so far!'.format(count))

class SynchronousRequestHandler(SessionMixin, RequestHandler):
    def get(self):
        with self.make_session() as session:
            count = session.query(User).count()

        self.write('{} users so far!'.format(count))

handlers = (
   (r'/native-coroutines', NativeCoroutinesRequestHandler),
   (r'/gen-coroutines', GenCoroutinesRequestHandler),
   (r'/sync', SynchronousRequestHandler),
)

app = Application(
   handlers,
   db=SQLAlchemy('postgres://user:[email protected]/database')
)

Documentation

Documentation is available at Read The Docs_.

Development

Please make sure you have Python 3.5+ and Poetry_ installed.

Since we run tests against multiple databases (currently MySQL, PostgreSQL, and SQLite), we use docker-compose_ to make our lives easier.

  1. Git clone the repository - :code:git clone https://github.com/siddhantgoel/tornado-sqlalchemy

  2. Install the packages required for development - :code:poetry install

  3. Ensure that the MySQL and PostgreSQL services (containers) are up - :code:docker-compose up -d

  4. That should basically be it. You should now be able to run the test suite - :code:poetry run py.test tests/.

.. _docker-compose: https://docs.docker.com/compose/ .. _Poetry: https://poetry.eustace.io/ .. _Read The Docs: https://tornado-sqlalchemy.readthedocs.io/en/stable/ .. _SQLAlchemy: http://www.sqlalchemy.org/ .. _tornado: https://www.tornadoweb.org/en/stable/

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].