To use AgeSQL, first, update the PATH variable to a PostgreSQL version compatible with Age:-
export PATH=/path/to/postgresql/12/bin:$PATH
Then, create the database and set up the extension:
initdb agesqldb
Start the server
pg_ctl -D agesqldb -l logfile start
Create database
createdb agesqldb
Run it
./agesql agesqldb
Create extension of age in it and set the path
CREATE EXTENSION age;
LOAD 'age';
SET search_path = ag_catalog, "$user", public;
To create a graph, run the CREATE GRAPH command:
CREATE GRAPH network;
SET GRAPH = network;
SHOW GRAPH_PATH;
You can directly run sql queries in it
SELECT * FROM users;
CREATE (:person {name: 'John'});
CREATE (:person {name: 'David'});
MATCH (p:person {name: 'John'}),(k:person{name: 'David'})
CREATE (p)-[e:KNOWS]->(k)
RETURN e;
MATCH (a)
OPTIONAL MATCH (a)-[e]->(b)
RETURN a, e, b;
Apache-Age:-https://age.apache.org/
GitHub:-https://github.com/apache/age
Top comments (0)