Let an app ask for PostgreSQL extensions its user can't make
coreapp.toml's [postgres] extensions = ["vector"]: the installer checks the Core's PostgreSQL has each one (refusing before anything changes if not) and makes them in the app's database as the superuser, with CASCADE, on install and every update. Ones taken off the list are kept, since the data may use them. Also fixes the check refusing needs with both postgres and mysql, which never ran. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -222,6 +222,17 @@ The Core's own scripts trace secrets, so their output goes to
|
||||
disk (btrfs) and what's not offered. As an app's database user,
|
||||
`CREATE EXTENSION pg_trgm` works and `CREATE EXTENSION vector` is
|
||||
refused ("Must be superuser").
|
||||
5c. `[postgres] extensions`: a `coreapp new --postgres` app with
|
||||
`[postgres]` `extensions = ["vector"]` deploys with "Enabling PostgreSQL
|
||||
extension(s) vector"; on the Core, its database has vector (owned by
|
||||
postgres), and as the app's user a `vector(3)` table, a distance query
|
||||
and an HNSW index work. Adding `"postgis"` is refused before anything
|
||||
changes ("this Core's PostgreSQL doesn't have postgis"); adding
|
||||
`"pg_trgm"` enables only that; `"earthdistance"` brings cube with it.
|
||||
An update that fails (a wrong `port`) rolls back with the extensions,
|
||||
the table and its index. `[postgres]` without `"postgres"` in needs, an
|
||||
unknown setting or a bad name is refused; so is `needs` with both
|
||||
postgres and mysql.
|
||||
6. `coreapp status` (address and port), `coreapp logs`, `coreapp shell`
|
||||
(exit with `exit`), `coreapp shell 'id; echo $APP_URL'` (prints both,
|
||||
no terminal needed, also when piped), `coreapp list` (all apps installed
|
||||
|
||||
Reference in New Issue
Block a user