How to use the aiosqlite.core.Connection function in aiosqlite

To help you get started, we’ve selected a few aiosqlite examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jreese / aiosqlite / aiosqlite / core.py View on Github external
) -> Connection:
    """Create and return a connection proxy to the sqlite database."""
    if loop is None:
        loop = asyncio.get_event_loop()

    def connector() -> sqlite3.Connection:
        if isinstance(database, str):
            loc = database
        elif isinstance(database, bytes):
            loc = database.decode("utf-8")
        else:
            loc = str(database)

        return sqlite3.connect(loc, **kwargs)

    return Connection(connector, loop)

aiosqlite

asyncio bridge to the standard sqlite3 module

MIT
Latest version published 10 months ago

Package Health Score

90 / 100
Full package analysis

Similar packages