Metadata-Version: 2.4
Name: database_wrapper_sqlite
Version: 0.1.80
Summary: database_wrapper for PostgreSQL database
Author-email: Gints Murans <gm@gm.lv>
License: GNU General Public License v3.0 (GPL-3.0)
Project-URL: Homepage, https://github.com/gintsmurans/py_database_wrapper
Project-URL: Documentation, https://github.com/gintsmurans/py_database_wrapper
Project-URL: Changes, https://github.com/gintsmurans/py_database_wrapper
Project-URL: Code, https://github.com/gintsmurans/py_database_wrapper
Project-URL: Issue Tracker, https://github.com/gintsmurans/py_database_wrapper/issues
Project-URL: Download, https://pypi.org/project/database_wrapper/
Keywords: database,wrapper,python,sqlite
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Database
Classifier: Topic :: Database :: Front-Ends
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: database_wrapper==0.1.80

# database_wrapper_sqlite

_Part of the `database_wrapper` package._

This python package is a database wrapper for [sqlite](https://www.sqlite.org/) database.

## !!! IMPORTANT !!!

This package is not yet implemented. The README is a placeholder for future implementation.

## Installation

```bash
pip install database_wrapper[sqlite]
```

## Usage

```python
from database_wrapper_sqlite import Sqlite, DBWrapperSqlite

db = Sqlite({
    "database": "my_database.db",
})
db.open()
dbWrapper = DBWrapperSqlite(dbCursor=db.cursor)

# Simple query
aModel = MyModel()
res = await dbWrapper.getByKey(
    aModel,
    "id",
    3005,
)
if res:
    print(f"getByKey: {res.toDict()}")
else:
    print("No results")

# Raw query
res = await dbWrapper.getAll(
    aModel,
    customQuery="""
        SELECT t1.*, t2.name AS other_name
        FROM my_table AS t1
        LEFT JOIN other_table AS t2 ON t1.other_id = t2.id
    """
)
async for record in res:
    print(f"getAll: {record.toDict()}")
else:
    print("No results")

db.close()
```
