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
Release history Release notifications | RSS feed
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.2.tar.gz
(20.1 kB
view hashes)
Built Distribution
sqlclasses-1.2-py3-none-any.whl
(20.3 kB
view hashes)