Skip to main content

Construct SQL commands and queries using Python classes.

Project description

Construct SQL commands and queries using Python classes.

from sqlclasses import sql

login = "me"
password = "secred"

query = sql.select( ("firstname", "lastname", "login",),
                    ("users",),
                    sql.where("login = ", sql.string_literal(login),
                              " AND ",
                              "password = ", sql.string_literal(password)) )

print(repr(query))

# >> select: <SELECT firstname, lastname, login FROM users WHERE login = 'me' AND password = 'secred'>

This used to be at the core of my Object Ralational Membrane years ago. I have ported it to Python 3 and re-publish it here. More documentation forthcomming.

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

sqlclasses-1.3.tar.gz (20.2 kB view hashes)

Uploaded Source

Built Distribution

sqlclasses-1.3-py3-none-any.whl (20.4 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