Metadata-Version: 2.1
Name: pymongo-the-sql
Version: 0.0.3
Summary: A sql wrapper made to mimic the pymongo syntax in order to simplify sql syntax.
Home-page: https://appsight.se
License: MIT
Author: Marcus Bader
Author-email: marcus@appsight.se
Requires-Python: >=3.6,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Project-URL: Repository, https://github.com/marbad1994/pymongo-the-sql
Description-Content-Type: text/x-rst

pymongo-the-sql
===============

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. find\_all\_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``


