Silly DB
Quick and easy SQLite ORM for local python applications.
Is it really an ORM ?
It is indeed a reversed ORM:
- The structure of the DB is built from classic .sql files.
- Then the magic occures to get the models from the DB itself. Usually, an ORM does the contrary.
Some minimum SQL knowledge is required, the purpose of Silly DB is not to get rid of SQL (actualy, SQL is the best language to manage... a SQL database), but to handle the annoying things, and let you focus on your application with a minimum amount of code.
Installation
$ pip install silly-db
Fast way to begin
Create a new directory and open a console in there.
Get a basic working structure with 'plop':
$ silly-db plop db
Congratulations ! You've got your database ready to work ! To understand how it works, open the differents files provided and read the comments, it will be easy to adapt to your own needs.
get more info with:
$ silly-db -h
and more about the plop options here:
$ silly-db plop
Examples (simple CRUD)
Cat = db.model('cat') # model created from the existing database
Cat.sil.insert(name="Kutty", owner_id=1)
cats = Cat.sil.filter("name like 'K%'")
print(cats.jsonify())
>>>[{'id': 58, 'name': 'Kutty', 'owner_id': 1}]
Cat.sil.update("id=58", name="Duke")
cat = Cat.sil.get("id=58")
print(cat.name)
>>> 'Duke'
print(cat.jsonify())
>>>{'id': 58, 'name': 'Duke', 'owner_id': 1}
Cat.sil.delete("id=58")
Documentation
Take a look at the wiki here
Metadata
Release files for silly-db 2.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| silly-db-2.0.2.tar.gz | 11.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| silly_db-2.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 25.2 kB
Release files / silly-db-2.0.2.tar.gz
| Download URL | silly-db-2.0.2.tar.gz |
|---|---|
| Size | 11.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9115e91d72171e21f45947279e0933e8239bb50401b4ea6c5144a0f36df3c857
|
|
BLAKE2b-256 checksum How to use checksums |
0e0d2a4669f484af4f83d587c82fb3c792059fe3bbb5dd91043dd10e4a435009
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.6
|
Release files / silly_db-2.0.2-py3-none-any.whl
| Download URL | silly_db-2.0.2-py3-none-any.whl |
|---|---|
| Size | 13.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a63ca5491d957818a265e2b937ff9fb868e632dd7dbab2910aaa3d2db6f490ac
|
|
BLAKE2b-256 checksum How to use checksums |
d21d447a36e1cc5091d6066eee8d4d01130d401c4022ec24fbe14a4d62395089
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.6
|