asqlite


Nameasqlite JSON
Version 2.0.0 PyPI version JSON
download
home_pagehttps://github.com/Rapptz/asqlite/
SummaryA simple and easy to use async wrapper for sqlite3.
upload_time2024-06-25 12:15:35
maintainerNone
docs_urlNone
authorRapptz
requires_python>=3.8.0
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ### asqlite

A simple and easy to use async wrapper for `sqlite3`.

This is basically the same as `sqlite3` except you use `async with` and `await` in front of most operations.

```python
import asyncio
import asqlite

async def main():
    async with asqlite.connect('example.db') as conn:
        async with conn.cursor() as cursor:
            # Create table
            await cursor.execute('''CREATE TABLE stocks
                                    (date text, trans text, symbol text, qty real, price real)''')

            # Insert a row of data
            await cursor.execute("INSERT INTO stocks VALUES ('2006-01-05','BUY','RHAT',100,35.14)")

            # Save (commit) the changes
            await conn.commit()

asyncio.run(main())
```

### Install

To install this via PyPI, use the `asqlite` package:

```
python3 -m pip install -U asqlite
```

### Differences from `sqlite3`

This module differs from `sqlite3` in a few ways:

1. Connections are created with `journal_mode` set to `wal`.
2. Connections have foreign keys enabled by default.
3. [Implicit transactions are turned off][implicit-transactions]
4. The [`row_factory`][row_factory] is set to [`sqlite3.Row`][Row].
5. A `asqlite.Pool` is provided for connection pooling

[implicit-transactions]: https://docs.python.org/3/library/sqlite3.html#transaction-control
[row_factory]: https://docs.python.org/3/library/sqlite3.html#sqlite3.Connection.row_factory
[Row]: https://docs.python.org/3/library/sqlite3.html#sqlite3.Row

### License

MIT

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Rapptz/asqlite/",
    "name": "asqlite",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8.0",
    "maintainer_email": null,
    "keywords": null,
    "author": "Rapptz",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/c3/c6/8349e97598590d1da0675b7ffbbb1c6293af5e9421d0c8683552e1ccab1b/asqlite-2.0.0.tar.gz",
    "platform": null,
    "description": "### asqlite\r\n\r\nA simple and easy to use async wrapper for `sqlite3`.\r\n\r\nThis is basically the same as `sqlite3` except you use `async with` and `await` in front of most operations.\r\n\r\n```python\r\nimport asyncio\r\nimport asqlite\r\n\r\nasync def main():\r\n    async with asqlite.connect('example.db') as conn:\r\n        async with conn.cursor() as cursor:\r\n            # Create table\r\n            await cursor.execute('''CREATE TABLE stocks\r\n                                    (date text, trans text, symbol text, qty real, price real)''')\r\n\r\n            # Insert a row of data\r\n            await cursor.execute(\"INSERT INTO stocks VALUES ('2006-01-05','BUY','RHAT',100,35.14)\")\r\n\r\n            # Save (commit) the changes\r\n            await conn.commit()\r\n\r\nasyncio.run(main())\r\n```\r\n\r\n### Install\r\n\r\nTo install this via PyPI, use the `asqlite` package:\r\n\r\n```\r\npython3 -m pip install -U asqlite\r\n```\r\n\r\n### Differences from `sqlite3`\r\n\r\nThis module differs from `sqlite3` in a few ways:\r\n\r\n1. Connections are created with `journal_mode` set to `wal`.\r\n2. Connections have foreign keys enabled by default.\r\n3. [Implicit transactions are turned off][implicit-transactions]\r\n4. The [`row_factory`][row_factory] is set to [`sqlite3.Row`][Row].\r\n5. A `asqlite.Pool` is provided for connection pooling\r\n\r\n[implicit-transactions]: https://docs.python.org/3/library/sqlite3.html#transaction-control\r\n[row_factory]: https://docs.python.org/3/library/sqlite3.html#sqlite3.Connection.row_factory\r\n[Row]: https://docs.python.org/3/library/sqlite3.html#sqlite3.Row\r\n\r\n### License\r\n\r\nMIT\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A simple and easy to use async wrapper for sqlite3.",
    "version": "2.0.0",
    "project_urls": {
        "Homepage": "https://github.com/Rapptz/asqlite/",
        "Issue Tracker": "https://github.com/Rapptz/asqlite/issues/"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1b29bc22327700c07d08894dfcbfb5a82349f533a0190171b3fd2d8b7dc7b8c8",
                "md5": "61816ad06a4b732d6fa615f870e16219",
                "sha256": "271b4206dbab14da93ff191fb03f3166d11d8feec90467653762636810f040b5"
            },
            "downloads": -1,
            "filename": "asqlite-2.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "61816ad06a4b732d6fa615f870e16219",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8.0",
            "size": 8899,
            "upload_time": "2024-06-25T12:15:34",
            "upload_time_iso_8601": "2024-06-25T12:15:34.501149Z",
            "url": "https://files.pythonhosted.org/packages/1b/29/bc22327700c07d08894dfcbfb5a82349f533a0190171b3fd2d8b7dc7b8c8/asqlite-2.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c3c68349e97598590d1da0675b7ffbbb1c6293af5e9421d0c8683552e1ccab1b",
                "md5": "746562066bd465a1ab9c8b69555a2191",
                "sha256": "97645200037f822c170e7dafa8b8422f85983a36e03060e47dcd932c0e1714a3"
            },
            "downloads": -1,
            "filename": "asqlite-2.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "746562066bd465a1ab9c8b69555a2191",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8.0",
            "size": 9077,
            "upload_time": "2024-06-25T12:15:35",
            "upload_time_iso_8601": "2024-06-25T12:15:35.711155Z",
            "url": "https://files.pythonhosted.org/packages/c3/c6/8349e97598590d1da0675b7ffbbb1c6293af5e9421d0c8683552e1ccab1b/asqlite-2.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-25 12:15:35",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Rapptz",
    "github_project": "asqlite",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "asqlite"
}
        
Elapsed time: 1.02893s