Skip to content

Instantly share code, notes, and snippets.

@zbalkan
Created April 16, 2025 17:09
Show Gist options
  • Select an option

  • Save zbalkan/d02d46b88b23e6b60cd2193bc09382d4 to your computer and use it in GitHub Desktop.

Select an option

Save zbalkan/d02d46b88b23e6b60cd2193bc09382d4 to your computer and use it in GitHub Desktop.
Lists all user-defined views in the shared DuckDB database.
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
cd "$(dirname "$0")"
db_file="investigations.db"
duckdb "$db_file" -c "
SELECT view_name, sql
FROM duckdb_views()
WHERE internal = false AND temporary = false;
"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment