Build SQL with native Python data structure smoothly.
Project description
The full version of this documentation is at mosql.mosky.tw.
MoSQL — More than SQL
It lets you use the common Python data structures to build SQLs. Here are the main features:
Easy-to-learn — Everything is just a plain Python object or SQL keyword.
Flexible — The query it builds fully depends on the structure you provide.
Secure — It prevents the SQL injection from both identifier and value.
Fast — It simply translates the Python data structures into SQLs.
It is just more than SQL.
MoSQL is Elegant
Here we have a dictionary which includes the information of a person:
>>> mosky = { ... 'person_id': 'mosky', ... 'name' : 'Mosky Liu', ... }
And we want to insert it into a table named person. It is easy with mosql.query:
>>> from mosql.query import insert >>> print(insert('person', mosky)) INSERT INTO "person" ("person_id", "name") VALUES ('mosky', 'Mosky Liu')
Check The Common Queries — mosql.query for detail, or there are examples which interact with real database.
Like it?
It is available on PyPI:
$ sudo pip install mosql
Or clone the source code from GitHub:
$ git clone git://github.com/moskytw/mosql.git
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
File details
Details for the file mosql-0.12.3.tar.gz
.
File metadata
- Download URL: mosql-0.12.3.tar.gz
- Upload date:
- Size: 38.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: Python-urllib/2.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f018e1e64aebf30d2b3471d4bafb42a599e08f99d3d2b180661a53e5acdf9d83 |
|
MD5 | b2614656bd87d5003fd502ea7f4338bb |
|
BLAKE2b-256 | e4f5129f11cb503ba0224100c270d397766695a73111237ba23284853834e86a |