Metadata-Version: 2.1
Name: wcpan-drive-sqlite
Version: 1.0.4
Summary: sqlite3 snapshot service for wcpan.drive
Home-page: https://github.com/legnaleurc/wcpan.drive.sqlite
License: MIT
Author: Wei-Cheng Pan
Author-email: legnaleurc@gmail.com
Requires-Python: >=3.12,<4.0
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries
Classifier: Typing :: Typed
Requires-Dist: wcpan-drive-core (>=4.1.0,<5.0.0)
Project-URL: Repository, https://github.com/legnaleurc/wcpan.drive.sqlite
Description-Content-Type: text/markdown

# wcpan.drive.sqlite

sqlite3 snapshot service for wcpan.drive.

## Example Usage

```python
from contextlib import asynccontextmanager

from wcpan.drive.core import create_drive
from wcpan.drive.core.types import FileService
from wcpan.drive.sqlite import create_service


@asynccontextmanager
async def create_sqlite_service():
    async with create_service(dsn="/path/to/sqlite") as snapshot:
        yield snapshot


# Assumes we already know how to create FileService
async def simple_demo(create_file_service: FileService):
    async with create_drive(
        file=create_file_service,
        snapshot=create_sqlite_service,
    ) as drive:
        ...
```

