feat: static page for fun
This commit is contained in:
Binary file not shown.
Binary file not shown.
2
package/c/hemar/.gitignore
vendored
Executable file
2
package/c/hemar/.gitignore
vendored
Executable file
@@ -0,0 +1,2 @@
|
||||
hemar.o
|
||||
hemar.so
|
||||
@@ -1,6 +1,6 @@
|
||||
MODULE_big = hel
|
||||
OBJS = hel.o
|
||||
EXTENSION = hel
|
||||
MODULE_big = hemar
|
||||
OBJS = hemar.o
|
||||
EXTENSION = hemar
|
||||
|
||||
DATA = $(wildcard *.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;
|
||||
@@ -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;
|
||||
@@ -1,3 +1,3 @@
|
||||
comment = 'My first extension'
|
||||
default_version = '0.1'
|
||||
module_pathname = '$libdir/hel'
|
||||
module_pathname = '$libdir/hemar'
|
||||
@@ -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."
|
||||
;;
|
||||
Reference in New Issue
Block a user