Pipelines & Events
A pipeline runs a fixed sequence of points; plugins attach handlers to a point (<pipeline>.<point>) at a priority, and VDB's own handlers run at priority 10. A handler error stops the pipeline and fails the operation that ran it. An event is a notification after something happened; subscriber errors are logged and change nothing.
Pipelines
| Pipeline | Runs when | Points |
|---|---|---|
vdb.server.start | VDB starts, after plugins connect | configure (persistence plugins return change sets), launch, emit |
vdb.connection.opened | A client connects | accept (an error refuses the connection), track, emit |
vdb.connection.closed | A client disconnects | cleanup, release, emit |
vdb.query.received | Before a statement is parsed | intercept (rewrite Query), emit |
vdb.transaction.begin | A transaction starts | authorize (an error refuses it), emit |
vdb.transaction.commit | A transaction commits, with its change set | apply (persistence plugins below 10), emit |
vdb.transaction.rollback | A rollback or rollback to a savepoint | apply, emit |
vdb.records.source | Each batch of Source rows, only when a plugin is attached | transform, emit |
vdb.records.merged | Each batch of merged rows, only when a plugin is attached | transform, emit |
vdb.write.insert, .update, .delete, .truncate | Each write | apply, emit |
Every pipeline also starts with a build_context point. A plugin, written in any language, receives each payload as a JSON object and returns it, changed or not. Connection IDs are integers; a row is an array of column values in the order of the payload's Columns, each a string when its bytes are valid UTF-8, null for SQL NULL, and {"base64": "..."} otherwise.
Events
| Event | When |
|---|---|
vdb.server.stopped | VDB has stopped |
vdb.connection.opened, vdb.connection.closed | A client connected or disconnected |
vdb.transaction.started, .committed, .rolledback | A transaction began, committed (with its change set) or rolled back |
vdb.query.completed | A statement finished: duration, rows, error code |
vdb.record.inserted, .updated, .deleted | Rows were written to the Delta |
vdb.table.truncated | A table was truncated and detached from the Source |
vdb.schema.loaded, vdb.schema.invalidated | A table was discovered; a table was changed by the Source or a client |
vdb.source.requested | VDB read the Source: shape, table, duration, rows, bytes |
vdb.snapshot.expired | A Source snapshot reached its age limit |
vdb.limit.reached | The memory or lock limit refused work |
vdb.key.conflict | A Source row was hidden by a Delta row with the same key |