Skip to main content

Python function to extract all the rows from a SQLite database, without loading the entire file into memory or disk

Project description

stream-sqlite CircleCI Test Coverage

Work in progress. This README serves as a rough design spec

Usage

from stream_sqlite import stream_sqlite
import httpx

def sqlite_bytes():
    # Iterable that yields the bytes of a sqlite file
    with httpx.stream('GET', 'https://www.example.com/my.sqlite') as r:
        yield from r.iter_bytes(chunk_size=65536)

# A table is not guarenteed to be contiguous in a sqlite file, so can appear
# multiple times while iterating
for table_name, table_info, rows in stream_sqlite(sqlite_bytes()):
    for row in rows:
        print(row)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stream-sqlite-0.0.2.tar.gz (4.7 kB view hashes)

Uploaded Source

Built Distribution

stream_sqlite-0.0.2-py3-none-any.whl (5.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page