Repository navigation
feat(dashboard): add database extensions page - #5116
Merged
Merged
Conversation
Contributor
Vercel Deployment Info - dashboard
|
dbm03
force-pushed
the
feat/dashboard-database-extensions
branch
from
October 8, 2026 17:03
e1ed56f to
0b13c49
Compare
Contributor
Vercel Deployment Info - docs
|
dbm03
force-pushed
the
feat/dashboard-database-extensions
branch
3 times, most recently
from
October 23, 2026 13:24
f2dee5e to
0c7c414
Compare
dbm03
force-pushed
the
feat/dashboard-database-extensions
branch
2 times, most recently
from
November 11, 2026 22:26
98282a6 to
5fb101b
Compare
dbm03
force-pushed
the
feat/dashboard-database-extensions
branch
from
November 11, 2026 22:28
5fb101b to
1325e16
Compare
dbm03
marked this pull request as ready for review
November 11, 2026 22:30
robertkasza
approved these changes
Nov 18, 2026
dbm03
enabled auto-merge (squash)
November 19, 2026 08:54
dbm03
disabled auto-merge
November 19, 2026 09:18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #4841
Checklist
Goal
The dashboard had no way to see or manage the PostgreSQL extensions in a project database. To enable
pgvector,postgis,pg_cronor similar extensions, users had to writeCREATE EXTENSIONby hand in the SQL editor, and on local CLI projects that SQL left no migration behind. Extensions that need a library inshared_preload_librariesalso failed until users found and changed that setting themselves.This branch adds a Database → Extensions page for each data source. It lists every available extension, installs and uninstalls them after the user reviews (and optionally edits) the generated SQL, walks through preloading a library when an extension needs one, and warns about installed extensions whose library Postgres does not preload. On the Nhost platform the SQL runs directly through Hasura
/v2/query; on local CLI projects each change is recorded as a replayable Hasura migration with an up and a down step. Existing navigation and database pages keep working, and the extensions docs now match the preload behaviour.Type: Enhancement
Changes
database/extensions/[dataSourceSlug]rendersDatabaseExtensionsinsideRetryableErrorBoundary,ProjectScopeandDatabaseArea, like the other database pages. It appears as an Extensions tab between SQL Console and Backups, and as a command palette entry with the keywordspostgres,pgvectorandpostgis. The route is listed inprojectStatePagesso it is gated on a running project, andgetProjectFeaturePagePathmaps/database/extensionsto/database/extensions/defaultso switching projects keeps the page open.usePostgresExtensionsQuerysends one read-onlyrun_sqlbulk request to/v2/query. The SQL joinspg_available_extensionswithpg_available_extension_versionson the default version to get each extension'srequireslist, and returns one JSON row per extension. An unparseable row raises "Received an invalid extensions catalog."; an HTTP error is normalized and, on the first load, rethrown to the page's error boundary. A failed refresh keeps the loaded list, because refreshes fail while Postgres restarts.vector,postgis,pg_cron,uuid-ossp) sit above an "All extensions" table. The search matches name, comment and display name (vectoris shown aspgvector). An All / Installed / Available single-select toggle group filters the table, and its counts follow the search. Each extension has a docs icon link named after it, its version (vX: the installed version, or the default version when not installed), an Installed badge, and an Install or Uninstall button. Installedplpgsql,pgcryptoandcitextshow a locked "Built-in" marker with the reason, readable by screen readers, instead of Uninstall. A search without matches shows a short message under the heading.getInstallExtensionSQLproducesCREATE EXTENSION IF NOT EXISTS <name>for the default version, withCASCADEwhen the extension has dependencies; the install dialog lists the not-yet-installed dependencies thatCASCADEadds, computed transitively bygetMissingExtensionDependencies.getUninstallExtensionSQLproducesDROP EXTENSION IF EXISTS <name>withoutCASCADE, except forpg_durable, which cannot be dropped otherwise. Names are quoted withnode-pg-format, andwithPostgresRoleprefixes every statement withSET LOCAL ROLE postgres;, so the role ends with the transaction on a pooled connection even if the user edits the SQL.useSetExtensionInstalledMutationbuilds a migration withbuildExtensionMigration: the up step is the reviewed SQL verbatim; the down step is the generated reverse statement. On the platform it posts the up step as arun_sqlbulk request to/v2/query. Locally it posts the full migration, namedcreate_extension_<name>ordrop_extension_<name>, to the CLI migrations API. Success shows a toast. On success and on error it invalidates the extensions, functions and data-source queries, because a slow install can time out after Postgres committed.DROPfails while objects depend on the extension and thatCASCADEalso drops those objects and their data. Forpg_durableit warns that its workflow state is deleted and, on the platform, links to the point-in-time recovery settings.PRELOAD_LIBRARY_EXTENSIONSmirrors thePostgresPreloadLibraryvalues ofnhost.toml(the defaultsharedPreloadLibrariespluspg_durableandpg_ivm).usePreloadedLibrariesQueryreadscurrent_setting('shared_preload_libraries')from the running server aspostgres, split into one row per library in SQL, andusePreloadLibrarycompares it with the configuredpostgres.settings.sharedPreloadLibraries(an unset list means the defaults). It derives a status:preloaded,not-configured,restartingorrestart-failedon the platform,pending-local-restartlocally, plusloadinganderror. Adding the library rewrites the full configured list with the library appended, refetches the configuration and, on the platform, the project state; while the project is live and still restarting, it polls the running server every 10 seconds.nhost up, then check again. An installed extension whose library is not preloaded gets a warning icon whose popover opens a Preload dialog with the same step, and the page shows an alert naming every such extension.pg_searchandpg_durablebefore installing them.CASCADE, the preload flows (local, platform restart, errors while adding the library, deploy failure, settings failure), the not-preloaded warning, uninstall on the platform, the dependent-objects error andpg_durable. Unit tests cover the SQL and migration builders andgetMissingExtensionDependencies.Flow
Key files
dashboard/src/features/orgs/projects/database/extensions/hooks/(+444/-0) — catalog and preloaded-libraries queries, the preload status and config update, and the install/uninstall transport.dashboard/src/features/orgs/projects/database/extensions/utils/(+107/-0) — SQL builders,withPostgresRole, dependency resolution, display names, docs URLs, built-in and missing-preload checks.dashboard/src/features/orgs/projects/database/extensions/constants.tsandgql/(+51/-0) — popular, preload-required, built-in andCASCADE-on-uninstall extensions; the configured-libraries query.dashboard/src/features/orgs/projects/database/extensions/components/(+1500/-0) — the page, cards, table, action control, preload status, alert, SQL editor, install fields, and the install, preload and uninstall dialogs.DatabaseExtensions.test.tsxpage suite plus unit tests next to the hooks and utils.dashboard/src/pages/orgs/[orgSlug]/projects/[appSubdomain]/database/extensions/[dataSourceSlug].tsx(+30/-0) — route and layout.DatabaseRouteTabs.tsx,command-palette/catalog.tsxandtree.tsx,projectStatePages.ts,getProjectFeaturePagePath.ts.dashboard/src/utils/__generated__/graphql.ts(+63/-0) — generated hook forGetConfiguredPreloadLibraries.docs/src/content/docs/products/database/extensions.mdx(+3/-3) — preload guidance.