Skip to main content

simple postgres orm for python

Project description

Pgorm

Pgorm is a simple orm for postgre in python

install

pip install py-pgorm==0.0.8

Usage

import pgorm 
def getCursor():
    dbconf={
        "database":"<dbname>",
        "user":"<user>", 
        "password": "<password>"
    }
    cursor = pgorm.getDbCursor(dbconf)
    return cursor

def test_create_table():

    cursor = getCursor()
    sql = '''
        drop table t;
        create table if not exists t(
            code varchar(10) not null, 
            label real not null
        );'''

    try:
        cursor.execute(sql) 
    except Exception as e:
        pass

Examples

Refer to examples

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

py-pgorm-0.0.10.tar.gz (4.6 kB view hashes)

Uploaded Source

Built Distribution

py_pgorm-0.0.10-py3-none-any.whl (3.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page