diff --git a/flake.nix b/flake.nix index 244cfe3..64a1f4a 100644 --- a/flake.nix +++ b/flake.nix @@ -439,20 +439,20 @@ }; nativeBuildInputs = with prev; [pkg-config curl]; }; - buildHelExt = versionSuffix: let + buildHemarExt = versionSuffix: let postgresql = prev."postgresql_${versionSuffix}"; c-hectic = self.packages.${prev.system}.c-hectic; in buildPostgresqlExtension { inherit postgresql; } { - pname = "hel"; + pname = "hemar"; version = "0.1"; - src = ./package/c/hel; + src = ./package/c/hemar; nativeBuildInputs = (with prev; [pkg-config]) ++ [ c-hectic ]; dontShrinkRPath = true; postFixup = '' echo ">>> postFixup running..." - ${prev.patchelf}/bin/patchelf --set-rpath ${c-hectic}/lib $out/lib/hel.so + ${prev.patchelf}/bin/patchelf --set-rpath ${c-hectic}/lib $out/lib/hemar.so ''; preInstall = ''mkdir $out''; }; @@ -462,25 +462,25 @@ http = buildHttpExt "17"; pg_smtp_client = buildSmtpExt "17"; plhaskell = buildPlHaskellExt "17"; - hel = buildHelExt "17"; + hemar = buildHemarExt "17"; };}; postgresql_16 = prev.postgresql_16 // {pkgs = prev.postgresql_16.pkgs // { http = buildHttpExt "16"; pg_smtp_client = buildSmtpExt "16"; plhaskell = buildPlHaskellExt "16"; - hel = buildHelExt "16"; + hemar = buildHemarExt "16"; };}; postgresql_15 = prev.postgresql_15 // {pkgs = prev.postgresql_15.pkgs // { http = buildHttpExt "15"; pg_smtp_client = buildSmtpExt "15"; plhaskell = buildPlHaskellExt "15"; - hel = buildHelExt "15"; + hemar = buildHemarExt "15"; };}; postgresql_14 = prev.postgresql_14 // {pkgs = prev.postgresql_14.pkgs // { http = buildHttpExt "14"; pg_smtp_client = buildSmtpExt "14"; plhaskell = buildPlHaskellExt "14"; - hel = buildHelExt "14"; + hemar = buildHemarExt "14"; };}; writers = let writeC = @@ -560,4 +560,4 @@ }; }; }; -} +} \ No newline at end of file diff --git a/package/c/hel/hel.o b/package/c/hel/hel.o deleted file mode 100644 index bee6350..0000000 Binary files a/package/c/hel/hel.o and /dev/null differ diff --git a/package/c/hel/hel.so b/package/c/hel/hel.so deleted file mode 100755 index 85f55e8..0000000 Binary files a/package/c/hel/hel.so and /dev/null differ diff --git a/package/c/hemar/.gitignore b/package/c/hemar/.gitignore new file mode 100755 index 0000000..022e2c5 --- /dev/null +++ b/package/c/hemar/.gitignore @@ -0,0 +1,2 @@ +hemar.o +hemar.so \ No newline at end of file diff --git a/package/c/hel/Makefile b/package/c/hemar/Makefile similarity index 84% rename from package/c/hel/Makefile rename to package/c/hemar/Makefile index f8ae044..044c118 100644 --- a/package/c/hel/Makefile +++ b/package/c/hemar/Makefile @@ -1,6 +1,6 @@ -MODULE_big = hel -OBJS = hel.o -EXTENSION = hel +MODULE_big = hemar +OBJS = hemar.o +EXTENSION = hemar DATA = $(wildcard *.sql) diff --git a/package/c/hel/hel--0.1.sql b/package/c/hemar/hemar--0.1.sql similarity index 63% rename from package/c/hel/hel--0.1.sql rename to package/c/hemar/hemar--0.1.sql index 6a4d958..5e49ee4 100755 --- a/package/c/hel/hel--0.1.sql +++ b/package/c/hemar/hemar--0.1.sql @@ -1,12 +1,12 @@ -- complain if script is sourced in psql, rather than via CREATE EXTENSION -\echo Use "CREATE EXTENSION hel" to load this file. \quit +\echo Use "CREATE EXTENSION hemar" to load this file. \quit -CREATE SCHEMA hel; +CREATE SCHEMA hemar; -- Define the parse_text_with_hectic function that uses hectic library -- Expected usage: -- ```sql --- SELECT "hel"."render"( +-- SELECT "hemar"."render"( -- "declare" := -- jsonb_build_object( -- 'name', 'test', @@ -15,12 +15,12 @@ CREATE SCHEMA hel; -- 'limit', 100 -- ) -- ), --- "template" := $hel$ +-- "template" := $hemar$ -- {{ name }} {{ config.limit }} --- $hel$ +-- $hemar$ -- ); -- ``` -CREATE FUNCTION "hel"."render"("declare" json, "template" text) +CREATE FUNCTION "hemar"."render"("declare" json, "template" text) RETURNS text -AS 'hel', 'render' +AS 'hemar', 'render' LANGUAGE C STRICT; \ No newline at end of file diff --git a/package/c/hel/hel.c b/package/c/hemar/hemar.c similarity index 96% rename from package/c/hel/hel.c rename to package/c/hemar/hemar.c index 4e1df17..16ab98b 100755 --- a/package/c/hel/hel.c +++ b/package/c/hemar/hemar.c @@ -9,7 +9,7 @@ PG_MODULE_MAGIC; #endif -/* Helper function to get a JSON value by key path */ +/* helper function to get a JSON value by key path */ static Json *json_get_by_path(Arena *arena, const Json *context, const char *key_path) { char *path_copy; diff --git a/package/c/hel/hel.control b/package/c/hemar/hemar.control similarity index 61% rename from package/c/hel/hel.control rename to package/c/hemar/hemar.control index fae58b8..3c07454 100755 --- a/package/c/hel/hel.control +++ b/package/c/hemar/hemar.control @@ -1,3 +1,3 @@ comment = 'My first extension' default_version = '0.1' -module_pathname = '$libdir/hel' \ No newline at end of file +module_pathname = '$libdir/hemar' \ No newline at end of file diff --git a/package/c/hel/make.sh b/package/c/hemar/make.sh similarity index 95% rename from package/c/hel/make.sh rename to package/c/hemar/make.sh index 5afb639..07e0ba2 100755 --- a/package/c/hel/make.sh +++ b/package/c/hemar/make.sh @@ -93,11 +93,11 @@ case "$MODE" in HECTIC_LIB="$HECTIC_PATH/lib" # shellcheck disable=SC2086 - gcc $CFLAGS $OPTFLAGS -I$PG_INCLUDE -I$HECTIC_INCLUDE -shared -o target/hel.so hel.c -L$HECTIC_LIB -lhectic + gcc $CFLAGS $OPTFLAGS -I$PG_INCLUDE -I$HECTIC_INCLUDE -shared -o target/hemar.so hemar.c -L$HECTIC_LIB -lhectic # Copy extension files to target directory - cp hel.control target/ - cp hel--0.1.sql target/ + cp hemar.control target/ + cp hemar--0.1.sql target/ echo "Build complete. Files available in target/ directory." ;; diff --git a/package/c/hel/test/01-test.c b/package/c/hemar/test/01-test.c similarity index 100% rename from package/c/hel/test/01-test.c rename to package/c/hemar/test/01-test.c