Skip to main content

NoSQL ORM for relational db backed by SQLAlchemy

Project description

`nosql` is a schemaless ORM for relational db backed by SQLAlchemy.

It's ultermately an implementation of the schemaless ORM introduced by Bret Taylor.

No instruction is better than real code! Say you are building a `Flask` app.

import nosql
from app import db

class User(nosql.SchemalessModel):
engine = db.engine
indexes = (


user = User() = '' = 'Yixi Zhang'

# find returns a generator
>>> [ for user in User.find()]
['Yixi Zhang']

# find_one returns an instance, support any attribute
>>> User.find_one(email='').name
Yixi Zhang

# added_id & id is auto-generated

>>> user.added_id

# retrieve non-exist attr returns None
>>> user.idol

>>> user.delete()

>>> list(User.find())

Because `nosql` creates index tables, querying random attribute is fast.

Some todo's for index

* `index_updater` allows indexes to be added later on and schedule data pushing in the background.
* `sharding` on index.

Database Support
So far only tested `SQLite` and `PostgreSQL`

Do whatever you want. Hope you enjoy using it.

Project details

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page