Skip to main content

Dead simple RDBMS handling lib

Project description

Dead simple RDBMS handling library

Dead simple wrapper for Python DB API 2 compatible database modules that supports very basic SQL generation and result handling.

Because I hate ORMs.

This library creates a simple manager object from a database connection, that exposes the following API:

  • select
  • insert
  • update
  • delete
  • raw
  • commit
  • rollback
  • connection
  • cursor



pip install dsql


Any database connection object that implements the Python DB API 2.0 (PEP 0249) is supported. Also, the database connection must be configured to return a DictCursor when a cursor is requested.

Example Usage (mysql):

import MySQLdb
import MySQLdb.cursors
import dsql

conn = MySQLdb.connect(host='localhost', user='root', db='lorem',

db = dsql.make(conn, dialect='mysql')

itemiter ='products', 'id,name,description')
item =

last_insert_id = db.insert('products', {
    'name': 'falan',
    'description': 'harika bir urun!!',

last_insert_id = db.insert('products', {
    'name': 'falan',
    'description': 'harika bir urun!!',
}, commit=False)

affected_rowcount = db.update('products', {
    'name': 'lorem ipsum',
    'id =': 888,

affected_rowcount = db.delete('products', {
    'id =': 777,

Example Usage (postgres):

import psycopg2
import psycopg2.extras
import dsql

conn = psycopg2.connect(host='localhost', user='root', database='lorem',

db = dsql.make(conn)

itemiter ='products', 'id,name,description')
item =


Project details

Download files

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

Files for dsql, version 0.2.4
Filename, size File type Python version Upload date Hashes
Filename, size dsql-0.2.4.tar.gz (4.9 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page