A sql wrapper made to mimic the pymongo syntax in order to simplify sql syntax.
Project description
A sql wrapper made to mimic the pymongo syntax in order to simplify sql syntax.
Docs
Usage
from pymongo_the_sql.pymongo_the_sql import PyMongoTheSql
PyMongoTheSql("../tests/test.sqlite3")
<pymongo_the_sql.pymongo_the_sql.PyMongoTheSql object at 0x7f60878e8e80>
client = PyMongoTheSql("../tests/test.sqlite3")
client = PyMongoTheSql("../tests")
db = client.get_database("test")
db["users"]
<pymongo_the_sql.pymongo_the_sql.PyMongoTheSql object at 0x7f6087763400>
users = db["users"]
users.find({"id": "1"})
Api
Update
Updates values for all specified columns where the conditions are True.
update(columns_values: dict, conditions: dict[Optional], operator: str[Optional]) -> bool
Updates values for all specified columns where the conditions are True. Use the values tuple to update Blob type objects.
update_blob(columns_values: dict, values: tuple[Optional], conditions: dict[Optional], operator: str[Optional])
Updates values for all specifed columns on the first row where the conditions are True.
update_one(columns_values: dict, conditions: dict[Optional])
Updates values for all specified columns on every row.
update_all(columns_values: dict[Optional]) -> bool
Find
Returns the specified columns on all rows the conditions are True.
find(conditions: dict, columns: dict, operator: str) -> dict
Returns the specified columns on the first row the conditions are True.
find_one(conditions: dict, columns: list, operator: str) -> dict
Returns the whole table. find_all() -> dict
Returns the specified columns on the last row the conditions are True.
find_last(conditions: dict[Optional], columns: list[Optional], operator: str[Optional]) -> dict
Returns how many rows in the table. findall_and_count() -> int
Returns how many rows the conditions are True.
find_and_count(conditions: dict[Optional], columns: list[Optional], operator: str[Optional]) -> int
Insert
Inserts the values in the specified columns. insert(columns_values: dict) -> bool
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pymongo-the-sql-0.0.4.tar.gz.
File metadata
- Download URL: pymongo-the-sql-0.0.4.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.7 CPython/3.9.2 Linux/5.10.0-kali7-amd64
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3404b7ece2f628f688fcfa4336002d37ff98d96ac8d8ef51c330cd64006ae791
|
|
| MD5 |
951dd0b3638563dcdcb538bdcff82489
|
|
| BLAKE2b-256 |
bc3023ba805f1a96e79967718543bd90ee55f148d893228de2b65b7a1704ebd4
|
File details
Details for the file pymongo_the_sql-0.0.4-py3-none-any.whl.
File metadata
- Download URL: pymongo_the_sql-0.0.4-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.7 CPython/3.9.2 Linux/5.10.0-kali7-amd64
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9240846ac53a89794b2b194a75985fd5d40d280dbbd8d3bde9520b462d454d58
|
|
| MD5 |
94f2a19a8b4a01962ed8ee2b10f5a290
|
|
| BLAKE2b-256 |
05ad37c34006554669f659f60eeb99b7cc82d6e4e7387409a7c3b3651452c2f7
|