def sqlite_engine():
    """
    Return an in-memory SQLite engine using a URI that allows sharing
    the database across connections within the same process.
    """
    # This URI creates a named in-memory database that persists
    # as long as at least one connection is open, and is shareable.
    db_uri = (
        "sqlite:///file:llamaindex_reader_test_db?mode=memory&cache=shared&uri=true"
    )
    engine = create_engine(db_uri, future=True)

    # Set up schema + sample data (ensure clean state first)
    with engine.begin() as conn:
        # Drop table if it exists from a previous potentially failed run
        conn.execute(text("DROP TABLE IF EXISTS items"))
        # Create table (no schema prefix)
        conn.execute(
            text(
                """
                CREATE TABLE items (
                    id      INTEGER PRIMARY KEY,
                    name    TEXT,
                    value   INTEGER
                )
                """
            )
        )
        # Insert data (no schema prefix)
        conn.execute(
            text(
                """
                INSERT INTO items (name, value)
                VALUES ('foo', 10), ('bar', 20)
                """
            )
        )
    # The engine is now configured with a persistent in-memory DB
    # containing the 'items' table.
    return engine

    # Optional teardown: dispose engine if needed, though usually not required
    # engine.dispose()

    Return an in-memory SQLite engine using a URI that allows sharing
    the database across connections within the same process.
    
llama-index-integrations/readers/llama-index-readers-database/tests/test_readers_database.py