16 lines
795 B
MySQL
16 lines
795 B
MySQL
|
|
-- Enable pg_duckdb so the database can read the app's Parquet climate cache
|
||
|
|
-- directly (ad-hoc analytics via DuckDB's read_parquet / read_csv / etc.).
|
||
|
|
--
|
||
|
|
-- This runs once, on first cluster init (empty PGDATA), from
|
||
|
|
-- /docker-entrypoint-initdb.d. Because the compose `db` service keeps its data
|
||
|
|
-- on a persistent named volume, init scripts do NOT re-run on an existing
|
||
|
|
-- database -- to enable pg_duckdb on a DB that was created before this image,
|
||
|
|
-- run it by hand:
|
||
|
|
--
|
||
|
|
-- docker compose exec db psql -U thermograph -d thermograph \
|
||
|
|
-- -c 'CREATE EXTENSION IF NOT EXISTS pg_duckdb;'
|
||
|
|
--
|
||
|
|
-- pg_duckdb requires shared_preload_libraries='pg_duckdb'; the base image's
|
||
|
|
-- postgresql.conf.sample already sets it, so it is active on fresh init.
|
||
|
|
CREATE EXTENSION IF NOT EXISTS pg_duckdb;
|