datasette-copy-to-memory
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
If you don't want to have a fixtures and fixtures_memory database, you can use replace: true to have the plugin replace the file-backed database with the new in-memory one, reusing the same database name:
plugins:
datasette-copy-to-memory:
replace: true
Then:
datasette github.db fixtures.db -m metadata.yml
This will result in both /github and /fixtures but no /github_memory or /fixtures_memory.
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
Metadata
Release files for datasette-copy-to-memory 0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| datasette-copy-to-memory-0.2.tar.gz | 7.0 kB | Without provenance | Details for datasette-copy-to-memory-0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| datasette_copy_to_memory-0.2-py3-none-any.whl | Python 3 | none | any | Details for datasette_copy_to_memory-0.2-py3-none-any.whl |
Total release size: 14.5 kB
Release files / datasette-copy-to-memory-0.2.tar.gz
| Download URL | datasette-copy-to-memory-0.2.tar.gz |
|---|---|
| Size | 7.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f2407e030db46fd6985ebec0557c00811ca0efc4df4fe0a5a235884d6d3c096f
|
|
BLAKE2b-256 checksum How to use checksums |
ba96b6d695d5af7335652234bbfdcbdd9ee6618e86e23d060ac4ce07df340129
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.10.4
|
Release files / datasette_copy_to_memory-0.2-py3-none-any.whl
| Download URL | datasette_copy_to_memory-0.2-py3-none-any.whl |
|---|---|
| Size | 7.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5caa50b3570436518282b2fcd3914d1d0549815e4ba9881abf74073789b387a3
|
|
BLAKE2b-256 checksum How to use checksums |
8cd03060d48ee8b24b4053cae41af13d209315f80270de99561993b1577b5c26
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.10.4
|
Security for datasette-copy-to-memory 0.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.