Inspect, audit, and manage the per-database SQL execution log. The history records every query the engine processes against a given database file, including metadata about duration and outcome.
Retrieve query execution history for a database with an optional limit.
Name In Type Required Description dbquery string Yes Database file path limitquery integer No Maximum number of entries to return. Default: 100
"query" : " SELECT id, email FROM users WHERE active = 1 " ,
"query" : " UPDATE users SET last_login = ? WHERE id = ? " ,
"message" : " Invalid database path "
Error Code Title Description Resolution INVALID_DB_PATHInvalid database path The provided database path is invalid or inaccessible Provide a valid absolute path, or use bare name / ./name shorthand (resolved to /hoody/databases/*.db) INVALID_PARAMETERSInvalid request parameters One or more request parameters are invalid or malformed Check parameter types and values against the API specification INVALID_SQLITE_HEADERNot a valid SQLite database The file exists but is not a valid SQLite database Ensure the file is a valid SQLite database with proper header PATH_IS_DIRECTORYPath is a directory Expected a .db file but got a directory (use table parameter for directory mode) Use a .db file path or add table parameter for directory mode KV store
const result = await client . sqlite . history . list ( {
Retrieve aggregated statistics about query execution history.
Name In Type Required Description dbquery string Yes Database file path
"successful_queries" : 1829 ,
"first_entry" : 1715000000 ,
"message" : " Invalid database path "
Error Code Title Description Resolution INVALID_DB_PATHInvalid database path The provided database path is invalid or inaccessible Provide a valid absolute path, or use bare name / ./name shorthand (resolved to /hoody/databases/*.db) INVALID_PARAMETERSInvalid request parameters One or more request parameters are invalid or malformed Check parameter types and values against the API specification INVALID_SQLITE_HEADERNot a valid SQLite database The file exists but is not a valid SQLite database Ensure the file is a valid SQLite database with proper header PATH_IS_DIRECTORYPath is a directory Expected a .db file but got a directory (use table parameter for directory mode) Use a .db file path or add table parameter for directory mode KV store
"error" : " Internal Server Error " ,
"message" : " Database operation failed "
Error Code Title Description Resolution DATABASE_ERRORDatabase operation failed An internal database error occurred Check server logs for details. Database may be corrupted or locked. FILE_SYSTEM_ERRORFile system error Failed to read or write filesystem in directory mode Check file permissions and disk space
const stats = await client . sqlite . history . getStats ( {
Delete all query history entries for a database.
Name In Type Required Description dbquery string Yes Database file path
"message" : " Invalid database path "
Error Code Title Description Resolution INVALID_DB_PATHInvalid database path The provided database path is invalid or inaccessible Provide a valid absolute path, or use bare name / ./name shorthand (resolved to /hoody/databases/*.db) INVALID_PARAMETERSInvalid request parameters One or more request parameters are invalid or malformed Check parameter types and values against the API specification INVALID_SQLITE_HEADERNot a valid SQLite database The file exists but is not a valid SQLite database Ensure the file is a valid SQLite database with proper header PATH_IS_DIRECTORYPath is a directory Expected a .db file but got a directory (use table parameter for directory mode) Use a .db file path or add table parameter for directory mode KV store
"error" : " Internal Server Error " ,
"message" : " Database operation failed "
Error Code Title Description Resolution DATABASE_ERRORDatabase operation failed An internal database error occurred Check server logs for details. Database may be corrupted or locked. FILE_SYSTEM_ERRORFile system error Failed to read or write filesystem in directory mode Check file permissions and disk space
await client . sqlite . history . clear ({
Delete a specific query history entry by ID.
Name In Type Required Description indexpath integer Yes History entry ID dbquery string Yes Database file path
"message" : " Invalid database path "
Error Code Title Description Resolution INVALID_DB_PATHInvalid database path The provided database path is invalid or inaccessible Provide a valid absolute path, or use bare name / ./name shorthand (resolved to /hoody/databases/*.db) INVALID_PARAMETERSInvalid request parameters One or more request parameters are invalid or malformed Check parameter types and values against the API specification INVALID_SQLITE_HEADERNot a valid SQLite database The file exists but is not a valid SQLite database Ensure the file is a valid SQLite database with proper header PATH_IS_DIRECTORYPath is a directory Expected a .db file but got a directory (use table parameter for directory mode) Use a .db file path or add table parameter for directory mode KV store
"message" : " Entry not found "
Error Code Title Description Resolution KEY_NOT_FOUNDKey not found The requested key does not exist in the KV store Verify the key name and database/table parameters DATABASE_NOT_FOUNDDatabase file does not exist The specified database file was not found Check the file path or use create_db_if_missing=true to create it KEY_EXPIREDKey expired The key existed but has expired due to TTL The key was automatically deleted. Store a new value if needed.
"error" : " Internal Server Error " ,
"message" : " Database operation failed "
Error Code Title Description Resolution DATABASE_ERRORDatabase operation failed An internal database error occurred Check server logs for details. Database may be corrupted or locked. FILE_SYSTEM_ERRORFile system error Failed to read or write filesystem in directory mode Check file permissions and disk space
await client . sqlite . history . deleteEntry ({
Reconstruct a key or an entire table at a specific moment in time, compare two moments to see exactly what changed, and roll back operations when something went wrong. These endpoints read the operation log produced by every KV write.
Retrieve the operation history for a specific key, showing all changes over time.
Name In Type Required Description keypath string Yes Key name dbquery string Yes Database file path tablequery string No Custom table name. Default: "kv_store" limitquery integer No Maximum number of operations to return (0 → default 50, clamped to maximum 1000). Default: 50
"key" : " session:user:42 " ,
"value" : " { \" theme \" : \" dark \" } " ,
"actor" : " session-service "
"value" : " { \" theme \" : \" light \" } " ,
"actor" : " session-service "
"actor" : " session-service "
"message" : " Invalid limit value "
Error Code Title Description Resolution INVALID_DB_PATHInvalid database path The provided database path is invalid or inaccessible Provide a valid absolute path, or use bare name / ./name shorthand (resolved to /hoody/databases/*.db) INVALID_PARAMETERSInvalid request parameters One or more request parameters are invalid or malformed Check parameter types and values against the API specification INVALID_SQLITE_HEADERNot a valid SQLite database The file exists but is not a valid SQLite database Ensure the file is a valid SQLite database with proper header PATH_IS_DIRECTORYPath is a directory Expected a .db file but got a directory (use table parameter for directory mode) Use a .db file path or add table parameter for directory mode KV store
"error" : " Internal Server Error " ,
"message" : " Database operation failed "
Error Code Title Description Resolution DATABASE_ERRORDatabase operation failed An internal database error occurred Check server logs for details. Database may be corrupted or locked. FILE_SYSTEM_ERRORFile system error Failed to read or write filesystem in directory mode Check file permissions and disk space
const history = await client . sqlite . kvStore . getHistory ( {
Reconstruct the value of a key as it was at a specific operation number.
Name In Type Required Description keypath string Yes Key name dbquery string Yes Database file path tablequery string No Custom table name. Default: "kv_store" op_numberquery integer Yes Operation number to reconstruct from
"key" : " session:user:42 " ,
"reconstructed_at" : 1717689000 ,
"value" : " { \" theme \" : \" light \" } " ,
"message" : " Invalid database path "
Error Code Title Description Resolution INVALID_DB_PATHInvalid database path The provided database path is invalid or inaccessible Provide a valid absolute path, or use bare name / ./name shorthand (resolved to /hoody/databases/*.db) INVALID_PARAMETERSInvalid request parameters One or more request parameters are invalid or malformed Check parameter types and values against the API specification INVALID_SQLITE_HEADERNot a valid SQLite database The file exists but is not a valid SQLite database Ensure the file is a valid SQLite database with proper header PATH_IS_DIRECTORYPath is a directory Expected a .db file but got a directory (use table parameter for directory mode) Use a .db file path or add table parameter for directory mode KV store
"message" : " Operation not found for key "
Error Code Title Description Resolution KEY_NOT_FOUNDKey not found The requested key does not exist in the KV store Verify the key name and database/table parameters DATABASE_NOT_FOUNDDatabase file does not exist The specified database file was not found Check the file path or use create_db_if_missing=true to create it KEY_EXPIREDKey expired The key existed but has expired due to TTL The key was automatically deleted. Store a new value if needed.
"error" : " Internal Server Error " ,
"message" : " Database operation failed "
Error Code Title Description Resolution DATABASE_ERRORDatabase operation failed An internal database error occurred Check server logs for details. Database may be corrupted or locked. FILE_SYSTEM_ERRORFile system error Failed to read or write filesystem in directory mode Check file permissions and disk space
const snapshot = await client . sqlite . kvStore . getSnapshot ( {
Reconstruct the entire KV table state as it was at a specific timestamp. Use prefix to narrow the candidate set when the table is large.
Name In Type Required Description dbquery string Yes Database file path tablequery string No Custom table name. Default: "kv_store" timestampquery integer Yes Unix timestamp to reconstruct from limitquery integer No Maximum number of keys to return. Default: 100 prefixquery string No Filter keys by prefix
"config:feature_flags" : " { \" new_checkout \" :true} " ,
"rate_limit:ip:10.0.0.1" : " { \" count \" :7} "
"candidate_truncated" : false
"message" : " Invalid database path "
Error Code Title Description Resolution INVALID_DB_PATHInvalid database path The provided database path is invalid or inaccessible Provide a valid absolute path, or use bare name / ./name shorthand (resolved to /hoody/databases/*.db) INVALID_PARAMETERSInvalid request parameters One or more request parameters are invalid or malformed Check parameter types and values against the API specification INVALID_SQLITE_HEADERNot a valid SQLite database The file exists but is not a valid SQLite database Ensure the file is a valid SQLite database with proper header PATH_IS_DIRECTORYPath is a directory Expected a .db file but got a directory (use table parameter for directory mode) Use a .db file path or add table parameter for directory mode KV store
"error" : " Internal Server Error " ,
"message" : " Database operation failed "
Error Code Title Description Resolution DATABASE_ERRORDatabase operation failed An internal database error occurred Check server logs for details. Database may be corrupted or locked. FILE_SYSTEM_ERRORFile system error Failed to read or write filesystem in directory mode Check file permissions and disk space
"error" : " Service Unavailable " ,
"message" : " Request deadline exceeded before commit "
const snapshot = await client . sqlite . kvStore . getTableSnapshot ( {
Compare the KV table state between two timestamps to see exactly which keys were created, modified, and deleted in the window.
Name In Type Required Description dbquery string Yes Database file path tablequery string No Custom table name. Default: "kv_store" fromquery integer Yes Starting timestamp (Unix) toquery integer Yes Ending timestamp (Unix) keysquery string No Comma-separated list of keys to compare (optional)
"key" : " session:user:99 " ,
"key" : " session:user:42 " ,
"from" : " { \" theme \" : \" light \" } " ,
"to" : " { \" theme \" : \" dark \" } "
"candidate_truncated" : false
"message" : " Invalid database path "
Error Code Title Description Resolution INVALID_DB_PATHInvalid database path The provided database path is invalid or inaccessible Provide a valid absolute path, or use bare name / ./name shorthand (resolved to /hoody/databases/*.db) INVALID_PARAMETERSInvalid request parameters One or more request parameters are invalid or malformed Check parameter types and values against the API specification INVALID_SQLITE_HEADERNot a valid SQLite database The file exists but is not a valid SQLite database Ensure the file is a valid SQLite database with proper header PATH_IS_DIRECTORYPath is a directory Expected a .db file but got a directory (use table parameter for directory mode) Use a .db file path or add table parameter for directory mode KV store
"error" : " Internal Server Error " ,
"message" : " Database operation failed "
Error Code Title Description Resolution DATABASE_ERRORDatabase operation failed An internal database error occurred Check server logs for details. Database may be corrupted or locked. FILE_SYSTEM_ERRORFile system error Failed to read or write filesystem in directory mode Check file permissions and disk space
"error" : " Service Unavailable " ,
"message" : " Request deadline exceeded before commit (large candidate set or heavy maintenance contention) "
const diff = await client . sqlite . kvStore . compareSnapshots ( {
keys: " session:user:42,session:user:99 " ,
Roll back a key to its previous state by undoing the last N operations. Each undo writes a new compensating operation to the history chain.
Name In Type Required Description keypath string Yes Key name dbquery string Yes Database file path tablequery string No Custom table name. Default: "kv_store" stepsquery integer No Number of operations to rollback. Default: 1
"key" : " session:user:42 " ,
"restored_value" : " { \" theme \" : \" light \" } "
"message" : " Invalid database path "
Error Code Title Description Resolution INVALID_DB_PATHInvalid database path The provided database path is invalid or inaccessible Provide a valid absolute path, or use bare name / ./name shorthand (resolved to /hoody/databases/*.db) INVALID_PARAMETERSInvalid request parameters One or more request parameters are invalid or malformed Check parameter types and values against the API specification INVALID_SQLITE_HEADERNot a valid SQLite database The file exists but is not a valid SQLite database Ensure the file is a valid SQLite database with proper header PATH_IS_DIRECTORYPath is a directory Expected a .db file but got a directory (use table parameter for directory mode) Use a .db file path or add table parameter for directory mode KV store
"message" : " No history found for key "
Error Code Title Description Resolution KEY_NOT_FOUNDKey not found The requested key does not exist in the KV store Verify the key name and database/table parameters DATABASE_NOT_FOUNDDatabase file does not exist The specified database file was not found Check the file path or use create_db_if_missing=true to create it KEY_EXPIREDKey expired The key existed but has expired due to TTL The key was automatically deleted. Store a new value if needed.
"error" : " Internal Server Error " ,
"message" : " Database operation failed "
Error Code Title Description Resolution DATABASE_ERRORDatabase operation failed An internal database error occurred Check server logs for details. Database may be corrupted or locked. FILE_SYSTEM_ERRORFile system error Failed to read or write filesystem in directory mode Check file permissions and disk space
const result = await client . sqlite . kvStore . rollback ( {
Roll back the entire KV table to a specific timestamp. Because this is a destructive operation that can delete and overwrite many keys, it requires explicit confirmation.
Name In Type Required Description dbquery string Yes Database file path tablequery string No Custom table name. Default: "kv_store" to_timestampquery integer Yes Target timestamp to rollback to (Unix) dry_runquery boolean No Preview changes without applying. Default: false confirmquery string No Must be 'yes' to execute actual rollback
This endpoint takes no request body.
"to_timestamp" : 1717680000 ,
"message" : " Missing confirmation: confirm=yes required "
Error Code Title Description Resolution INVALID_DB_PATHInvalid database path The provided database path is invalid or inaccessible Provide a valid absolute path, or use bare name / ./name shorthand (resolved to /hoody/databases/*.db) INVALID_PARAMETERSInvalid request parameters One or more request parameters are invalid or malformed Check parameter types and values against the API specification INVALID_SQLITE_HEADERNot a valid SQLite database The file exists but is not a valid SQLite database Ensure the file is a valid SQLite database with proper header PATH_IS_DIRECTORYPath is a directory Expected a .db file but got a directory (use table parameter for directory mode) Use a .db file path or add table parameter for directory mode KV store
"message" : " Time-travel chain gap (cannot rollback deterministically) "
"error" : " Internal Server Error " ,
"message" : " Database operation failed "
Error Code Title Description Resolution DATABASE_ERRORDatabase operation failed An internal database error occurred Check server logs for details. Database may be corrupted or locked. FILE_SYSTEM_ERRORFile system error Failed to read or write filesystem in directory mode Check file permissions and disk space
const preview = await client . sqlite . kvStore . rollbackTable ( {
to_timestamp: 1717680000 ,
const result = await client . sqlite . kvStore . rollbackTable ( {
to_timestamp: 1717680000 ,