Skip to main content

No project description provided

Project description

datasette-litestream

PyPI Changelog Tests License

An experimental Datasette <-> Litestream plugin.

Installation

Install this plugin in the same environment as Datasette.

datasette install datasette-litestream

Usage

plugins:
  datasette-litestream:
    metrics-addr: :9090
    all-replicate:
      - file://$PWD/$DB-backup

Replicate a single database to a local directory

databases:
  my_database:
    plugins:
      datasette-litestream:
        replicas:
          - path: ./my_database-backup

Replicate a single database to S3

databases:
  my_database:
    plugins:
      datasette-litestream:
        replicas:
          - url: s3://my-bucket/my_database
  1. Environment variables LITESTREAM_ACCESS_KEY_ID and LITESTREAM_SECRET_ACCESS_KEY. AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY
  2. Environment variables with access-key-id and secret-access-key config options.
  3. Raw values in secret-access-key and secret-access-key config options.

Replicate all databases

plugins:
  datasette-litestream:
    all-replicate:
      - s3://my-bucket/$DB

Config

Top-level

The following are valid keys that are allowed when specifying top-evel

  • all-replicate
  • access-key-id
  • secret-access-key
  • metrics-addr

None of these keys are required.

Example:

plugins:
  datasette-litestream:
    all-replicate:
      - XXX
      - YYY
    access-key-id: $YOUR_KEY
    secret-access-key: $YOUR_SECRET
    metrics-addr: :5001

Database-level

  • replicas
  • monitor-interval
  • checkpoint-interval
  • min-checkpoint-page-count
  • max-checkpoint-page-count
databases:
  my_database:
    plugins:
      datasette-litestream:
        replicas:
          - XXX
          - XXX
        monitor-interval: XXX
        checkpoint-interval: XXX
        min-checkpoint-page-count: XXX
        max-checkpoint-page-count: XXX

Development

To set up this plugin locally, first checkout the code. Then create a new virtual environment:

cd datasette-litestream
python3 -m venv venv
source venv/bin/activate

Now install the dependencies and test dependencies:

pip install -e '.[test]'

To run the tests:

pytest

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

datasette-litestream-0.0.1a10.tar.gz (10.9 kB view hashes)

Uploaded Source

Built Distributions

datasette_litestream-0.0.1a10-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (8.7 MB view hashes)

Uploaded Python 3 manylinux: glibc 2.17+ ARM64

datasette_litestream-0.0.1a10-py3-none-macosx_11_0_arm64.whl (9.1 MB view hashes)

Uploaded Python 3 macOS 11.0+ ARM64

datasette_litestream-0.0.1a10-py3-none-macosx_10_6_x86_64.whl (10.0 MB view hashes)

Uploaded Python 3 macOS 10.6+ x86-64

datasette_litestream-0.0.1a10-py3-none-any.whl (11.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