Log Datasette events to a database table
Project description
datasette-events-db
Log Datasette events to a database table
Installation
Install this plugin in the same environment as Datasette.
datasette install datasette-events-db
Usage
Once installed, all Datasette events will be logged to a table called datasette_events
. This table will be created in the _internal
database, but can be moved to another database using the following plugin configuration option:
plugins:
datasette-events-db:
database: my_database
The table will be created when Datasette starts up, if it does not already exist.
Table schema
create table if not exists datasette_events (
id integer primary key,
event text,
created text,
actor_id text,
database_name text,
table_name text,
properties text -- JSON other properties
)
event
is the text name of the event, for examplecreate-table
created
is an ISO formatted UTC timestampactor_id
will be populated with the ID of the responsible actor, ornull
if not availabledatabase_name
will be thedatabase
property recorded by the event, if presenttable_name
will be thetable
property recorded by the event, if presentproperties
will be a JSON object containing any other properties recorded by the event
Development
To set up this plugin locally, first checkout the code. Then create a new virtual environment:
cd datasette-events-db
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file datasette-events-db-0.1a0.tar.gz
.
File metadata
- Download URL: datasette-events-db-0.1a0.tar.gz
- Upload date:
- Size: 7.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 02f58008e43f3b411cc031c6561987093d422ac240b3d3051fafc908a6675444 |
|
MD5 | f930e3fe629739fddb2205115ad8f7f1 |
|
BLAKE2b-256 | 4708510134b505f29b8500fb92f637df1185b3d68df5eb5ab5c8c13118aedcbf |
File details
Details for the file datasette_events_db-0.1a0-py3-none-any.whl
.
File metadata
- Download URL: datasette_events_db-0.1a0-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6bcdf9667a8b654bcc79fc418f0bfd0dfdaa807a33ac6c03a9979ff9acd7e117 |
|
MD5 | 917b4adf4f595515d9a9538cb179badf |
|
BLAKE2b-256 | 3a2943b1a4096799864f109c4bcb88cfce7dd692092d47a95c9913f02f78ac30 |