Skip to main content

Log Datasette events to a database table

Project description

datasette-events-db

PyPI Changelog Tests License

Log Datasette events to a database table

Installation

Install this plugin in the same environment as Datasette.

datasette install datasette-events-db

This plugin depends on Datasette 1.0a8 or higher.

Usage

Once installed, all Datasette events will be logged to a table called datasette_events. This table will be created in the private 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 example create-table
  • created is an ISO formatted UTC timestamp
  • actor_id will be populated with the ID of the responsible actor, or null if not available
  • database_name will be the database property recorded by the event, if present
  • table_name will be the table property recorded by the event, if present
  • properties 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

datasette_events_db-0.1a2.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

datasette_events_db-0.1a2-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file datasette_events_db-0.1a2.tar.gz.

File metadata

  • Download URL: datasette_events_db-0.1a2.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for datasette_events_db-0.1a2.tar.gz
Algorithm Hash digest
SHA256 9f5643dc8805e94d011ae82748ba4f5b6b7a0ead080b2b69cb3c94b64fdc6686
MD5 1711e14b37779a84e9c2cf711d649374
BLAKE2b-256 04c0b8cbbb10d82c43a9a738df1eeb78e9cc8137a8d184f784b940465d2f2e1f

See more details on using hashes here.

Provenance

The following attestation bundles were made for datasette_events_db-0.1a2.tar.gz:

Publisher: publish.yml on datasette/datasette-events-db

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file datasette_events_db-0.1a2-py3-none-any.whl.

File metadata

File hashes

Hashes for datasette_events_db-0.1a2-py3-none-any.whl
Algorithm Hash digest
SHA256 43835c4655a0baed5fecc01cefce3ccd3f8362bea9e2b31adc464ad956c48bba
MD5 ca4c0d9a68b9336609dfc5d2a6e3b017
BLAKE2b-256 460c57f9b2e2fdc3fae9b0fd34bcb5b8d548312747a7dedf5604ac548bcf2848

See more details on using hashes here.

Provenance

The following attestation bundles were made for datasette_events_db-0.1a2-py3-none-any.whl:

Publisher: publish.yml on datasette/datasette-events-db

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page