Skip to main content

OpenObject Query Parser

Project description

Python 2.7 and >=3.5

Parsers OpenObjectes queries like:

import pyscopg2

from oopgrade.oopgrade import get_foreign_keys
from ooquery import OOQuery

conn = psycopg2.connect("dbname=test user=postgres")
with conn.cursor() as cursor:
    def fk_function(table):
        return get_foreign_keys(cursor, table)

    q = OOQuery('account_invoice', fk_function)
    sql =['number', 'state']).where([
        ('state', '=', 'open'),
        ('', '=', 'Pepito')

Support for reading from joined tables

q = OOQuery('account_invoice', fk_function)
sql =['number', '', 'partner_id.vat']).where([
    ('state', '=', 'open')

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ooquery-0.8.2.tar.gz (3.0 kB view hashes)

Uploaded source

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