Created
September 21, 2020 10:14
-
-
Save docteurklein/1abee740f3a2f945199b894d255cade8 to your computer and use it in GitHub Desktop.
AGE demo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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