Skip to content

Instantly share code, notes, and snippets.

@sorrell
Last active April 21, 2023 20:05
Show Gist options
  • Save sorrell/2d2111428306517b0bb1219f4757736e to your computer and use it in GitHub Desktop.
Save sorrell/2d2111428306517b0bb1219f4757736e to your computer and use it in GitHub Desktop.
AGE smoketest
#!/bin/bash
# docker build . -t test-age:1.3.0
# docker run -d --rm --name testage -e POSTGRES_PASSWORD=pass test-age:1.3.0
# docker exec -it testage bash
# now in container which should be running PG
su postgres
# as postgres user
psql
# in psql
create extension age;
load 'age';
set search_path = ag_catalog, "$user", public;
create table test(a int, b text);
insert into test values (1, 'abc');
select * from test;
select create_graph('testgraph');
select create_vlabel('testgraph', 'label');
select * from cypher('testgraph', $$ CREATE(c:Customer {code: "Cust1"}) SET c.name = "Bitnine" RETURN c $$) as (a agtype);
select * from ag_catalog.ag_label;
exit
# exit psql
exit
# exit postgres user
# root again
# create non-root user to run initdb in installcheck
useradd johndoe --create-home
chown -R johndoe:root age/
su johndoe
# as johndoe user
cd /age && make installcheck
exit
# exit johndoe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment