Skip to content

Add chdb_hook.control and chdb_hook_version() - #106

Merged
theory merged 1 commit into
mainfrom
chdb_hook.control
Oct 9, 2026
Merged

theory merged 1 commit into
mainfrom
chdb_hook.control

Conversation

@theory

@theory theory commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator

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
theory requested a review from serprex October 8, 2026 22:37
@theory theory self-assigned this Oct 8, 2026
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
theory force-pushed the chdb_hook.control branch from ae9d2ae to 411bc67 Compare October 8, 2026 22:57
@theory
theory merged commit 411bc67 into main Oct 9, 2026
87 checks passed
@theory
theory deleted the chdb_hook.control branch October 9, 2026 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants