You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have managed to successfully use pg_extism to build a replacement for a C-language postgres user-defined function by compiling it to webassembly and running it on Amazon RDS using pg_extism with PLV8. This is great, thanks!
However, in order to do this, I had to use a pre-1.0 version of the extism c-pdk, as it seems a number of host interfaces are missing in pg_extism. In case others may find this useful, I found the current version of pg_extism works well with c-pdk commit ref 01064c00d7de7532132e7bf7305c4eaf486b6658.
Some of the things that are used by c-pdk plugins in v1.1 that seem to be missing from pg_extism are host functions in extism:host/env:
The extism c-pdk v1.1 high level input loading function extism_load_input has been updated to use the input_offset function, so it is fairly essential to plugin function for this to work with versions of the c-pdk after the v1.0 release.
The text was updated successfully, but these errors were encountered:
@mhmd-azeez while the update does now compile and run with c-pdk 1.1.0, I've found that neither logging nor higher level input functions appear to work properly. My testing earlier was still using the lower-level input loading rather than the extism_load_input function - when I use this, I get empty input.
I have managed to successfully use pg_extism to build a replacement for a C-language postgres user-defined function by compiling it to webassembly and running it on Amazon RDS using pg_extism with PLV8. This is great, thanks!
However, in order to do this, I had to use a pre-1.0 version of the extism c-pdk, as it seems a number of host interfaces are missing in pg_extism. In case others may find this useful, I found the current version of pg_extism works well with c-pdk commit ref 01064c00d7de7532132e7bf7305c4eaf486b6658.
Some of the things that are used by c-pdk plugins in v1.1 that seem to be missing from pg_extism are host functions in
extism:host/env
:input_offset
functionlog_trace
functionget_log_level
functionThe latter two seem fairly trivial to add (both can just be adopted from current versions in js-sdk: https://github.com/extism/js-sdk/blob/b46fb76549ee006e099129a395926406dde1d122/src/call-context.ts#L415-L419), but the
input_offset
function in js-sdk seems like it is based around an input data structure that has been changed significantly in js-sdk compared to the version in pg_extism. The current implementation in js-sdk (https://github.com/extism/js-sdk/blob/b46fb76549ee006e099129a395926406dde1d122/src/call-context.ts#L263-L266) is referring to aBlock
class that pg_extism does not seem to be using.The extism c-pdk v1.1 high level input loading function
extism_load_input
has been updated to use theinput_offset
function, so it is fairly essential to plugin function for this to work with versions of the c-pdk after the v1.0 release.The text was updated successfully, but these errors were encountered: