Skip to content

Instantly share code, notes, and snippets.

@docteurklein
Created September 21, 2020 10:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save docteurklein/1abee740f3a2f945199b894d255cade8 to your computer and use it in GitHub Desktop.
Save docteurklein/1abee740f3a2f945199b894d255cade8 to your computer and use it in GitHub Desktop.
AGE demo
load 'age';
SET search_path = ag_catalog, "$user", public;
create table if not exists history (year, event) as values (1996, 'postgresql'), (2016, 'agensgraph');
select drop_graph('g', true);
select create_graph('g');
select * from cypher('g', $$
create (:dev {name: 'someone', year: 2015})
$$) as (a agtype);
select * from cypher('g', $$
create (:dev {name: 'somebody', year: 2016})
$$) as (a agtype);
select n as name from history, cypher('g', $$
match (n:dev) return n.year
$$) as dev (n agtype)
-- where history.year > n::numeric
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment