Skip to main content

Copy database files into an in-memory database on startup

Project description

datasette-copy-to-memory

PyPI Changelog Tests License

Copy database files into an in-memory database on startup

This plugin is highly experimental. It currently exists to support Datasette performance research, and is not designed for actual production usage.

Installation

Install this plugin in the same environment as Datasette.

datasette install datasette-copy-to-memory

Usage

On startup, Datasette will create an in-memory named database for each attached database. This database will have the same name but with _memory at the end.

So running this:

datasette fixtures.db

Will serve two databases: the original at /fixtures and the in-memory copy at /fixtures_memory.

Demo

A demo is running on latest-with-plugins.datasette.io - the /fixtures_memory table there is provided by this plugin.

Configuration

By default every attached database file will be loaded into a _memory copy.

You can use plugin configuration to specify just a subset of the database. For example, to create github_memory but not fixtures_memory you would use the following metadata.yml file:

plugins:
  datasette-copy-to-memory:
    databases:
    - github

Then start Datasette like this:

datasette github.db fixtures.db -m metadata.yml

Development

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

cd datasette-copy-to-memory
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-copy-to-memory-0.1a3.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

datasette_copy_to_memory-0.1a3-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file datasette-copy-to-memory-0.1a3.tar.gz.

File metadata

File hashes

Hashes for datasette-copy-to-memory-0.1a3.tar.gz
Algorithm Hash digest
SHA256 707651bffafe17629988dd592c9052b2ae7a0e36975b24226a5a28a39fec18fa
MD5 b9fe26eef2f1e11c4e633067537bb5de
BLAKE2b-256 bfc66b8e493eb9612ec3d1ffea6f7babb284cf283597734e3c639ad56359aeb4

See more details on using hashes here.

File details

Details for the file datasette_copy_to_memory-0.1a3-py3-none-any.whl.

File metadata

File hashes

Hashes for datasette_copy_to_memory-0.1a3-py3-none-any.whl
Algorithm Hash digest
SHA256 d5a831bf84f07f1ad99db23b0b38dbdcf42e3b69b3eea4e7f63725ede071026b
MD5 a7531064f1000c839ad855e05144d6cb
BLAKE2b-256 cd5db0d1d228fddf715f9049fb91563bf1a6b8a830987ddcc1480acf16fc9704

See more details on using hashes here.

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