Skip to content

new 0.8 version for sqlite connection with '?mode=ro' not working, Error can't open database #585

Open
@Pythonbeginer2014

Description

@Pythonbeginer2014
from contextlib import asynccontextmanager
from databases import Database


@asynccontextmanager
async def async_sqlite_conn(db_name):
    database = Database(f'sqlite+aiosqlite:///example.db?mode=ro', uri=True)
    try:
        await database.connect()
        yield database
    finally:
        await database.disconnect()

when call this function and query data, get error " can't open database"

Thanks ,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions