Repository navigation
Add chdb_hook.control and chdb_hook_version() - #106
Merged
Merged
Conversation
It has not been possible, up to now, to query the server to determine whether chdb_hook is installed, although the presence of `chdb` in `pg_available_extensions` is a fine substitute. But it can be useful to make `chdb_hook` available there, too. So add `chdb_hook.control` so it can be listed in `pg_available_extensions` and added to a database via `CREATE EXTENSION chdb_hook`. Add the `chdb_hook_version()` function so that there's a handle one can use to load the module after creating the extension, effectively the same as `LOAD`, but with the advantage of supplying the version, as well. Refactor the `Makefile` to support both extensions, so that it creates `sql/chdb_hook-$VERSION.sql` and installs it. Add `EXT_NAME` as the package name, `chdb`, since `EXTENSION` now includes the names of both extensions. Document this functionality in `chdb_hook.md`, including how to load the module via the extension objects. But recommend loading the module in `session_preload_libraries`. Modify the `extension.sql` test to load both extensions and compare their versions, both the full `x.y.z` version of the modules as well as the `x.y` versions of the extensions.
theory
force-pushed
the
chdb_hook.control
branch
from
October 8, 2026 22:57
ae9d2ae to
411bc67
Compare
serprex
approved these changes
Oct 8, 2026
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.
It has not been possible, up to now, to query the server to determine whether chdb_hook is installed, although the presence of
chdbinpg_available_extensionsis a fine substitute. But it can be useful to makechdb_hookavailable there, too.So add
chdb_hook.controlso it can be listed inpg_available_extensionsand added to a database viaCREATE EXTENSION chdb_hook. Add thechdb_hook_version()function so that there's a handle one can use to load the module after creating the extension, effectively the same asLOAD, but with the advantage of supplying the version, as well.Refactor the
Makefileto support both extensions, so that it createssql/chdb_hook-$VERSION.sqland installs it. AddEXT_NAMEas the package name,chdb, sinceEXTENSIONnow includes the names of both extensions.Document this functionality in
chdb_hook.md, including how to load the module via the extension objects. But recommend loading the module insession_preload_libraries.Modify the
extension.sqltest to load both extensions and compare their versions, both the fullx.y.zversion of the modules as well as thex.yversions of the extensions.