# 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()
```
Raw data
{
"_id": null,
"home_page": null,
"name": "database-wrapper-sqlite",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "database, wrapper, python, sqlite",
"author": null,
"author_email": "Gints Murans <gm@gm.lv>",
"download_url": "https://files.pythonhosted.org/packages/cb/34/13af814e3a4873eb2879a99f20a88654d47d4bd9b0478e6ce5b969cbd4a7/database_wrapper_sqlite-0.1.73.tar.gz",
"platform": null,
"description": "# database_wrapper_sqlite\n\n_Part of the `database_wrapper` package._\n\nThis python package is a database wrapper for [sqlite](https://www.sqlite.org/) database.\n\n## !!! IMPORTANT !!!\n\nThis package is not yet implemented. The README is a placeholder for future implementation.\n\n## Installation\n\n```bash\npip install database_wrapper[sqlite]\n```\n\n## Usage\n\n```python\nfrom database_wrapper_sqlite import Sqlite, DBWrapperSqlite\n\ndb = Sqlite({\n \"database\": \"my_database.db\",\n})\ndb.open()\ndbWrapper = DBWrapperSqlite(dbCursor=db.cursor)\n\n# Simple query\naModel = MyModel()\nres = await dbWrapper.getByKey(\n aModel,\n \"id\",\n 3005,\n)\nif res:\n print(f\"getByKey: {res.toDict()}\")\nelse:\n print(\"No results\")\n\n# Raw query\nres = await dbWrapper.getAll(\n aModel,\n customQuery=\"\"\"\n SELECT t1.*, t2.name AS other_name\n FROM my_table AS t1\n LEFT JOIN other_table AS t2 ON t1.other_id = t2.id\n \"\"\"\n)\nasync for record in res:\n print(f\"getAll: {record.toDict()}\")\nelse:\n print(\"No results\")\n\ndb.close()\n```\n",
"bugtrack_url": null,
"license": "GNU General Public License v3.0 (GPL-3.0)",
"summary": "database_wrapper for PostgreSQL database",
"version": "0.1.73",
"project_urls": {
"Changes": "https://github.com/gintsmurans/py_database_wrapper",
"Code": "https://github.com/gintsmurans/py_database_wrapper",
"Documentation": "https://github.com/gintsmurans/py_database_wrapper",
"Download": "https://pypi.org/project/database_wrapper/",
"Homepage": "https://github.com/gintsmurans/py_database_wrapper",
"Issue Tracker": "https://github.com/gintsmurans/py_database_wrapper/issues"
},
"split_keywords": [
"database",
" wrapper",
" python",
" sqlite"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d758778a6134ae757e55ab09b449b7b85d7298d05d7cbe0c1865a1378efa0659",
"md5": "17b8cc5529dfb5fb4ce8e3d7669bab62",
"sha256": "d990e6232d3c849ec61c1d6ce0de57db12e8756660644dcfb887f2907b1b0a93"
},
"downloads": -1,
"filename": "database_wrapper_sqlite-0.1.73-py3-none-any.whl",
"has_sig": false,
"md5_digest": "17b8cc5529dfb5fb4ce8e3d7669bab62",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 3541,
"upload_time": "2024-12-22T02:13:06",
"upload_time_iso_8601": "2024-12-22T02:13:06.407875Z",
"url": "https://files.pythonhosted.org/packages/d7/58/778a6134ae757e55ab09b449b7b85d7298d05d7cbe0c1865a1378efa0659/database_wrapper_sqlite-0.1.73-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "cb3413af814e3a4873eb2879a99f20a88654d47d4bd9b0478e6ce5b969cbd4a7",
"md5": "f3c4db7a57cdac972f2bb1e0d95bce26",
"sha256": "2d22da2170290ee90bfe56ffa14e3b408eab26d46caafa5eff5e07842ac9ef96"
},
"downloads": -1,
"filename": "database_wrapper_sqlite-0.1.73.tar.gz",
"has_sig": false,
"md5_digest": "f3c4db7a57cdac972f2bb1e0d95bce26",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 3050,
"upload_time": "2024-12-22T02:13:15",
"upload_time_iso_8601": "2024-12-22T02:13:15.878921Z",
"url": "https://files.pythonhosted.org/packages/cb/34/13af814e3a4873eb2879a99f20a88654d47d4bd9b0478e6ce5b969cbd4a7/database_wrapper_sqlite-0.1.73.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-22 02:13:15",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "gintsmurans",
"github_project": "py_database_wrapper",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "database-wrapper-sqlite"
}