diff --git a/Dockerfile b/Dockerfile index cc8ef53..c96a6e7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -102,6 +102,7 @@ RUN apt-get update && \ # runtime requirement for using spatialite with sqlite_fdw libsqlite3-mod-spatialite \ pgagent \ + postgresql-$PG_MAJOR-age \ postgresql-$PG_MAJOR-asn1oid \ postgresql-$PG_MAJOR-credcheck \ postgresql-$PG_MAJOR-cron \ diff --git a/README.md b/README.md index bff01b4..2a97e93 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ For more detailed instructions about how to start and control your Postgres cont ## Available extensions +- [age](https://github.com/apache/age) - [asn1oid](https://github.com/df7cb/pgsql-asn1oid) - [credcheck](https://github.com/MigOpsRepos/credcheck) - [ddlx](https://github.com/lacanoid/pgddl) diff --git a/tests/create_extensions.sql b/tests/create_extensions.sql index 67cf119..0a75480 100644 --- a/tests/create_extensions.sql +++ b/tests/create_extensions.sql @@ -20,6 +20,43 @@ CREATE EXTENSION IF NOT EXISTS postgis_sfcgal; SELECT PostGIS_Full_Version(); +-- https://github.com/apache/age +CREATE EXTENSION age; +LOAD 'age'; + +BEGIN; + +SET search_path = ag_catalog, "$user", public; + +SELECT create_graph('graph_name'); + +-- create vertices +SELECT * FROM cypher('graph_name', $$CREATE (:label {property:"Node A"})$$) as (v agtype); +SELECT * FROM cypher('graph_name', $$CREATE (:label {property:"Node B"})$$) as (v agtype); + +-- create an edge between two nodes and set its properties +SELECT * FROM cypher( + 'graph_name', + $$ + MATCH (a:label), (b:label) + WHERE a.property = 'Node A' AND b.property = 'Node B' + CREATE (a)-[e:RELTYPE {property:a.property + '<->' + b.property}]->(b) + RETURN e + $$ +) as (e agtype); + +-- query the connected nodes +SELECT * from cypher( + 'graph_name', + $$ + MATCH (V)-[R]-(V2) + RETURN V,R,V2 + $$ +) as (V agtype, R agtype, V2 agtype); + +ROLLBACK; + + -- https://github.com/df7cb/pgsql-asn1oid CREATE EXTENSION IF NOT EXISTS asn1oid; SELECT '1.3.6.1.4.1'::asn1oid;