Skip to main content

SQLPile - SQL-Based Multi-Layered Caching (Arrow + SQLite + Postgres)

Full-featured multi-layered distributed cache using SQL databases. Why build a cache on top of a database? Largely because SQL has similar interfaces across many different databases, and it's easy to scale out. This project is a work in progress, and is not yet ready for production use.

Think about this project as if it's like Ibis, but for SQL caching. The goal is to have a simple interface that can be used to cache data in a SQL database. The project is designed to be used with a SQL database, and is not designed to be used with a NoSQL database. Just use redis at that point.

Installation

pip install sqlpile

Usage

from sqlpile import sqlpile
import sleep


@sqlpile
def expensive_function():
    sleep.sleep(10)
    return 1


def main():
    for _ in range(10):
        # Moves slow at first, but speeds up over time
        print(expensive_function)

Features

  • Multi-layered caching using local (SQLite) and remote (Postgres) databases
  • Serialization and compression of cached values using cloudpickle and lz4
  • Hashing of cache keys using xxhash for efficient lookup
  • Automatic caching of function results using a decorator
  • Asynchronous support with asyncio and aiosqlite
  • Dependency management using pyproject.toml and hatch
  • Code style enforcement with ruff

Configuration

from sqlpile.config import Config

config = ApplicationSettings(
    local_database_type="sqlite",
    local_database_name="cache.db",
    remote_database_type="postgresql",
    # ...
)

Metadata

Release files for sqlpile 0.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sqlpile 0.3.2
File Size Uploaded Provenance Actions
sqlpile-0.3.2.tar.gz 2.6 MB Without provenance Details for sqlpile-0.3.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sqlpile 0.3.2
File Interpreter ABI Platform Actions
sqlpile-0.3.2-py3-none-any.whl Python 3 none any Details for sqlpile-0.3.2-py3-none-any.whl

Total release size: 2.6 MB

Release files / sqlpile-0.3.2.tar.gz

Download URL sqlpile-0.3.2.tar.gz
Size 2.6 MB
Tags Source
SHA-256 checksum
How to use checksums
855a37ba30ed48ff9935e5c0d9d90620ac5cc9f58212da0c46b7ff0d56dcc594
BLAKE2b-256 checksum
How to use checksums
349e3f80ffc8e43f4a3f6ba594ff4656c7b091fb24f7b9b94905f5a31e7befc3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.12.1

Release files / sqlpile-0.3.2-py3-none-any.whl

Download URL sqlpile-0.3.2-py3-none-any.whl
Size 10.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
10f7c35eeba481a77e24d7e0f412d09a4fb9bbc9f830614483ac5ed63df6503f
BLAKE2b-256 checksum
How to use checksums
35ecf0b41361bec1fc155fffc9514088342eb58229290a5a8089fdab3dc98301
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.12.1

Security for sqlpile 0.3.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page