It lets you use the common Python's data structures to build SQLs.
Project description
The full version of this documentation is at mosql.mosky.tw.
MoSQL — More than SQL
It lets you use the common Python’s data structures to build SQLs. Here are the main features:
Easy-to-learn — Everything is just plain data structure or SQL keyword.
Flexible — The queries it builds fully depends on the structure you provide.
Secure — It prevents the SQL injection from both identifier and value.
Fast — It just builds the SQLs from Python’s data structures.
It is just more than SQL.
Some of the modules are deprecated after v0.6, check The Module Deprecated after v0.6 for more information.
MoSQL is Elegent
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')
How about to send it to db directly? Yes, it is in the to-do, but not for now.
You can check The Common Queries — mosql.query for the detail usage, or there are also many examples which really interact with database.
Like it?
It is easy to install MoSQL with pip:
$ 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.6.1.tar.gz
.
File metadata
- Download URL: mosql-0.6.1.tar.gz
- Upload date:
- Size: 27.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d751ef49f6190ae50cb5b0d5147d03930ca2dc67903faf7d45f0202642bcbb57 |
|
MD5 | 44f6bdd4f7e804c3c6a66b596cdd1ff3 |
|
BLAKE2b-256 | 711649ce706c3b61f3048738916c575fb8d375d48e32d5ccede7df68eb095a78 |