feat(db): warn at mount when TimescaleDB extension is missing#45
Merged
Conversation
History features (.history/, .log/, .savepoint/, .undo/) require
TimescaleDB. The .build/<app> handler already refuses ',history'
builds with a clear FSError when the extension is absent
(fs/build.go:79-92), so users can't accidentally trigger raw SQL
errors from CREATE TABLE WITH (tsdb.hypertable, ...).
What was missing: proactive notice at mount time. A user on vanilla
PostgreSQL had no signal until they tried to opt into history.
This commit adds:
- Client.WarnIfTimescaleDBMissing(ctx): probes pg_extension and logs
a single Warn-level line with an actionable hint when the
extension is absent. Non-blocking; probe errors are swallowed
rather than gating startup.
- Wired into all three mount entry points (fuse/mount_ops.go,
fuse/fs.go, nfs/mount_darwin.go) immediately after the DB client
is created.
- Two unit tests on the existing .build/<app> guard: absent ->
FSError{ErrInvalidPath} with a hint mentioning TimescaleDB and
CREATE EXTENSION; present -> guard falls through (no
TimescaleDB-shaped error).
Surface coverage:
- Source-table CRUD: works on vanilla Postgres (no TimescaleDB).
- ',history' build: blocked at build-time with hint.
- .history/, .log/, .savepoint/, .undo/: unreachable unless the
build succeeded, so the build-time guard is the only gate.
- Mount itself: never blocked; the warning is a heads-up.
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.
History features (.history/, .log/, .savepoint/, .undo/) require TimescaleDB. The .build/ handler already refuses ',history' builds with a clear FSError when the extension is absent (fs/build.go:79-92), so users can't accidentally trigger raw SQL errors from CREATE TABLE WITH (tsdb.hypertable, ...).
What was missing: proactive notice at mount time. A user on vanilla PostgreSQL had no signal until they tried to opt into history.
This commit adds:
FSError{ErrInvalidPath} with a hint mentioning TimescaleDB and CREATE EXTENSION; present -> guard falls through (no TimescaleDB-shaped error).
Surface coverage: