Metadata-Version: 1.1
Name: link.dbrequest
Version: 0.2
Summary: Database agnostic query system
Home-page: https://github.com/linkdd/link.dbrequest
Author: David Delassus
Author-email: david.jose.delassus@gmail.com
License: MIT
Description: link.dbrequest
        ==============
        
        **link.dbrequest** is a database agnostic query system.
        
        See documentation_ for more informations.
        
        .. _documentation: https://linkdbrequest.readthedocs.io
        
        .. image:: https://img.shields.io/pypi/l/link.dbrequest.svg?style=flat-square
           :target: https://pypi.python.org/pypi/link.dbrequest/
           :alt: License
        
        .. image:: https://img.shields.io/pypi/status/link.dbrequest.svg?style=flat-square
           :target: https://pypi.python.org/pypi/link.dbrequest/
           :alt: Development Status
        
        .. image:: https://img.shields.io/pypi/v/link.dbrequest.svg?style=flat-square
           :target: https://pypi.python.org/pypi/link.dbrequest/
           :alt: Latest release
        
        .. image:: https://img.shields.io/pypi/pyversions/link.dbrequest.svg?style=flat-square
           :target: https://pypi.python.org/pypi/link.dbrequest/
           :alt: Supported Python versions
        
        .. image:: https://img.shields.io/pypi/implementation/link.dbrequest.svg?style=flat-square
           :target: https://pypi.python.org/pypi/link.dbrequest/
           :alt: Supported Python implementations
        
        .. image:: https://img.shields.io/pypi/wheel/link.dbrequest.svg?style=flat-square
           :target: https://travis-ci.org/linkdd/link.dbrequest
           :alt: Download format
        
        .. image:: https://travis-ci.org/linkdd/link.dbrequest.svg?branch=master&style=flat-square
           :target: https://travis-ci.org/linkdd/link.dbrequest
           :alt: Build status
        
        .. image:: https://coveralls.io/repos/github/linkdd/link.dbrequest/badge.png?style=flat-square
           :target: https://coveralls.io/r/linkdd/link.dbrequest
           :alt: Code test coverage
        
        .. image:: https://img.shields.io/pypi/dm/link.dbrequest.svg?style=flat-square
           :target: https://pypi.python.org/pypi/link.dbrequest/
           :alt: Downloads
        
        .. image:: https://landscape.io/github/linkdd/link.dbrequest/master/landscape.svg?style=flat-square
           :target: https://landscape.io/github/linkdd/link.dbrequest/master
           :alt: Code Health
        
        .. image:: https://www.quantifiedcode.com/api/v1/project/d2ac1cf45f6f4cdeb938f34fcb2f2214/badge.svg
          :target: https://www.quantifiedcode.com/app/project/d2ac1cf45f6f4cdeb938f34fcb2f2214
          :alt: Code issues
        
        Installation
        ------------
        
        .. code-block:: text
        
           pip install link.dbrequest
        
        Features
        --------
        
         * database agnostic
         * lazy query resolving
         * cached queries
         * queries are unique
        
        Examples
        --------
        
        Getting a backend:
        
        .. code-block:: python
        
           from link.middleware.core import Middleware
        
           # Will open a QueryManager using a MongoDB backend
           manager = Middleware.get_middleware_by_uri('query+mongo://localhost:27107/mydatabase/mycollection')
           # Will open a QueryManager using a SQL backend
           manager = Middleware.get_middleware_by_uri('query+sql://localhost:5432/mydatabase/mytable')
        
        
        Operations on the backend:
        
        .. code-block:: python
        
           from link.dbrequest.expression import E, F
           from link.dbrequest.assignment import A
           from link.dbrequest.comparison import C
        
        
           query = manager.all()  # get an iterable over all elements
        
           manager.create(A('foo', 'bar'))  # put document {'foo': 'bar'} into database
        
           doc = manager.get(C('foo') != 'bar')  # get single element, or None
        
        Operations on queries:
        
        .. code-block:: python
        
           docs = list(query)  # iterate over query to execute the request
           docs = list(query)  # use cache when iterating again
        
           # create a new query from the first one
           q2 = query.filter(C('foo') == 'bar')
           assert query is not q2
        
           # exclude documents without a field named "bar"
           q3 = q2.exclude(~C('bar'))
        
           # filter documents "weight > 5" and "prop1 < prop2 * 5"
           q4 = q3.filter((C('weight') > 5) & (C('prop1') < (E('prop2') * 5)))
        
           # set "prop3 = prop1 + prop2" on q2 result
           docs = q2.update(A('prop3', E('prop1') + E('prop2')))
        
           # delete documents
           q3.delete()
        
        Operations on documents:
        
        .. code-block:: python
        
           # save/delete a single document
           doc.save()
           doc.delete()
        
Keywords: link database request
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Utilities
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: Implementation :: CPython
