Skip to content

Releases

Release notes for Resource Surveillance (surveilr) 0.21.0

We are excited to announce the release of new features in surveilr, specifically focusing on the shell command. This release brings a lightweight, unopinionated alternative to sqlite3 or duckdb, allowing users to execute SQL scripts easily, while offering minimal logging compared to the highly opinionated orchestrate command.

The shell and orchestrate commands are now closely related, with shell providing a simpler execution flow without detailed tracking. In contrast, orchestrate offers robust logging and support functions.

New Features

1. Default Engine

  • surveilr shell --engine rusqlite: Rusqlite is the default engine for the shell command unless the --engine option is overridden.

2. Multi-Script Execution

  • surveilr shell first.sql second.sql https://site.com/third.sql:
    • Supports executing multiple SQL scripts passed as arguments, whether from local or remote locations.
    • Globs: You can now use globs such as **/*.sql and **/*.sql.ts to match and execute files in sorted depth-first order.
    • File Type Handling:
      • Files ending in .sql are treated as direct SQL files.
      • Files ending in other extensions (like .sql.ts) are treated as potentially runnable files:
        • Local Executable: If the file is local and executable, it will be run, and the STDOUT output will be used for SQL execution.
        • Remote Executable: For security reasons, remote executable files cannot be run and will produce an error message: remote files cannot be executed due to safety reasons.

3. Command-Line SQL Execution

  • surveilr shell --cmd "select * from table": Now supports executing SQL commands passed directly through the command line, similar to sqlite3’s -cmd option.

4. STDIN Support

  • cat my.sql | surveilr shell and surveilr shell < my.sql: surveilr now supports executing SQL scripts via STDIN, allowing seamless integration with piping or file redirection.

5. Observability and Logging

  • Logging Execution: Unless the --no-observability flag is used, surveilr shell will log the execution into the orchestration tables:
    • orchestration_nature: Logs the nature of the execution as shell-<engine> (e.g., shell-rusqlite).
    • orchestration_session: Logs a new session for each execution.
    • orchestration_session_log: Logs any exceptions or errors that occur during the execution for better debugging and traceability.

Assets

Please find the release here.