@@ -190,6 +190,7 @@ impl From<NameRefClass> for LocationKind {
190190 NameRefClass :: Policy => LocationKind :: Policy ,
191191 NameRefClass :: PreparedStatement => LocationKind :: PreparedStatement ,
192192 NameRefClass :: PropertyGraph => LocationKind :: PropertyGraph ,
193+ NameRefClass :: PropertyGraphColumn => LocationKind :: Column ,
193194 NameRefClass :: Role => LocationKind :: Role ,
194195 NameRefClass :: Schema => LocationKind :: Schema ,
195196 NameRefClass :: Sequence => LocationKind :: Sequence ,
@@ -9383,6 +9384,317 @@ create property graph g
93839384 " ) ;
93849385 }
93859386
9387+ #[ test]
9388+ fn goto_create_property_graph_sources_table ( ) {
9389+ assert_snapshot ! ( goto( "
9390+ create table v1 (
9391+ id int8 primary key,
9392+ name text
9393+ );
9394+
9395+ create table v2 (
9396+ id int8 primary key,
9397+ name text
9398+ );
9399+
9400+ create table v3 (
9401+ id int8 primary key,
9402+ name text
9403+ );
9404+
9405+ create table e1 (
9406+ id int8 primary key,
9407+ source_id int8 references v1,
9408+ destination_id int8 references v2
9409+ );
9410+
9411+ create table e2 (
9412+ id int8 primary key,
9413+ source_id int8 references v1,
9414+ destination_id int8 references v3
9415+ );
9416+
9417+ create property graph g1
9418+ vertex tables (v1, v2, v3)
9419+ edge tables (
9420+ e1 source v1$0 destination v2,
9421+ e2 source v1 destination v3);
9422+ " ) , @"
9423+ ββΈ
9424+ 2 β create table v1 (
9425+ β ββ 2. destination
9426+ β‘
9427+ 32 β e1 source v1 destination v2,
9428+ β°β΄ β 1. source
9429+ "
9430+ ) ;
9431+
9432+ assert_snapshot ! ( goto( "
9433+ create table v1 (
9434+ id int8 primary key,
9435+ name text
9436+ );
9437+
9438+ create table v2 (
9439+ id int8 primary key,
9440+ name text
9441+ );
9442+
9443+ create table v3 (
9444+ id int8 primary key,
9445+ name text
9446+ );
9447+
9448+ create table e1 (
9449+ id int8 primary key,
9450+ source_id int8 references v1,
9451+ destination_id int8 references v2
9452+ );
9453+
9454+ create table e2 (
9455+ id int8 primary key,
9456+ source_id int8 references v1,
9457+ destination_id int8 references v3
9458+ );
9459+
9460+ create property graph g1
9461+ vertex tables (v1, v2, v3)
9462+ edge tables (
9463+ e1 source v1 destination v2,
9464+ e2 source v1 destination v3$0);
9465+ " ) , @"
9466+ ββΈ
9467+ 12 β create table v3 (
9468+ β ββ 2. destination
9469+ β‘
9470+ 33 β e2 source v1 destination v3);
9471+ β°β΄ β 1. source
9472+ "
9473+ ) ;
9474+ }
9475+
9476+ #[ test]
9477+ fn goto_create_property_graph_references_table ( ) {
9478+ assert_snapshot ! ( goto( "
9479+ create table v1 (id int8 primary key);
9480+ create table v2 (id int8 primary key);
9481+ create table e1 (
9482+ id int8 primary key,
9483+ source_id int8 references v1,
9484+ destination_id int8 references v2
9485+ );
9486+
9487+ create property graph g1
9488+ vertex tables (v1, v2)
9489+ edge tables (
9490+ e1
9491+ source key (source_id) references v1$0 (id)
9492+ destination key (destination_id) references v2 (id)
9493+ );
9494+ " ) , @"
9495+ ββΈ
9496+ 2 β create table v1 (id int8 primary key);
9497+ β ββ 2. destination
9498+ β‘
9499+ 14 β source key (source_id) references v1 (id)
9500+ β°β΄ β 1. source
9501+ "
9502+ ) ;
9503+ }
9504+
9505+ #[ test]
9506+ fn goto_create_property_graph_vertex_key_column ( ) {
9507+ assert_snapshot ! ( goto( "
9508+ create table v1 (
9509+ id int8 primary key,
9510+ name text
9511+ );
9512+
9513+ create property graph g1
9514+ vertex tables (v1 key (id$0));
9515+ " ) , @"
9516+ ββΈ
9517+ 3 β id int8 primary key,
9518+ β ββ 2. destination
9519+ β‘
9520+ 8 β vertex tables (v1 key (id));
9521+ β°β΄ β 1. source
9522+ " ) ;
9523+ }
9524+
9525+ #[ test]
9526+ fn goto_create_property_graph_edge_source_key_column ( ) {
9527+ assert_snapshot ! ( goto( "
9528+ create table v1 (id int8 primary key);
9529+ create table v2 (id int8 primary key);
9530+ create table e1 (
9531+ id int8 primary key,
9532+ source_id int8 references v1,
9533+ destination_id int8 references v2
9534+ );
9535+
9536+ create property graph g1
9537+ vertex tables (v1, v2)
9538+ edge tables (
9539+ e1 key (id)
9540+ source key (source_id$0) references v1 (id)
9541+ destination key (destination_id) references v2 (id));
9542+ " ) , @"
9543+ ββΈ
9544+ 6 β source_id int8 references v1,
9545+ β βββββββββ 2. destination
9546+ β‘
9547+ 14 β source key (source_id) references v1 (id)
9548+ β°β΄ β 1. source
9549+ " ) ;
9550+ }
9551+
9552+ #[ test]
9553+ fn goto_create_property_graph_edge_source_references_column ( ) {
9554+ assert_snapshot ! ( goto( "
9555+ create table v1 (id int8 primary key);
9556+ create table v2 (id int8 primary key);
9557+ create table e1 (
9558+ id int8 primary key,
9559+ source_id int8 references v1,
9560+ destination_id int8 references v2
9561+ );
9562+
9563+ create property graph g1
9564+ vertex tables (v1, v2)
9565+ edge tables (
9566+ e1 key (id)
9567+ source key (source_id) references v1 (id$0)
9568+ destination key (destination_id) references v2 (id));
9569+ " ) , @"
9570+ ββΈ
9571+ 2 β create table v1 (id int8 primary key);
9572+ β ββ 2. destination
9573+ β‘
9574+ 14 β source key (source_id) references v1 (id)
9575+ β°β΄ β 1. source
9576+ " ) ;
9577+ }
9578+
9579+ #[ test]
9580+ fn goto_create_property_graph_edge_destination_key_column ( ) {
9581+ assert_snapshot ! ( goto( "
9582+ create table v1 (id int8 primary key);
9583+ create table v2 (id int8 primary key);
9584+ create table e1 (
9585+ id int8 primary key,
9586+ source_id int8 references v1,
9587+ destination_id int8 references v2
9588+ );
9589+
9590+ create property graph g1
9591+ vertex tables (v1, v2)
9592+ edge tables (
9593+ e1 key (id)
9594+ source key (source_id) references v1 (id)
9595+ destination key (destination_id$0) references v2 (id));
9596+ " ) , @"
9597+ ββΈ
9598+ 7 β destination_id int8 references v2
9599+ β ββββββββββββββ 2. destination
9600+ β‘
9601+ 15 β destination key (destination_id) references v2 (id));
9602+ β°β΄ β 1. source
9603+ " ) ;
9604+ }
9605+
9606+ #[ test]
9607+ fn goto_create_property_graph_edge_destination_references_column ( ) {
9608+ assert_snapshot ! ( goto( "
9609+ create table v1 (id int8 primary key);
9610+ create table v2 (id int8 primary key);
9611+ create table e1 (
9612+ id int8 primary key,
9613+ source_id int8 references v1,
9614+ destination_id int8 references v2
9615+ );
9616+
9617+ create property graph g1
9618+ vertex tables (v1, v2)
9619+ edge tables (
9620+ e1 key (id)
9621+ source key (source_id) references v1 (id)
9622+ destination key (destination_id) references v2 (id$0));
9623+ " ) , @"
9624+ ββΈ
9625+ 3 β create table v2 (id int8 primary key);
9626+ β ββ 2. destination
9627+ β‘
9628+ 15 β destination key (destination_id) references v2 (id));
9629+ β°β΄ β 1. source
9630+ " ) ;
9631+ }
9632+
9633+ #[ test]
9634+ fn goto_create_property_graph_vertex_properties_column ( ) {
9635+ assert_snapshot ! ( goto( "
9636+ create table v1 (
9637+ id int8 primary key,
9638+ name text
9639+ );
9640+
9641+ create property graph g1
9642+ vertex tables (v1 properties (id$0, name));
9643+ " ) , @"
9644+ ββΈ
9645+ 3 β id int8 primary key,
9646+ β ββ 2. destination
9647+ β‘
9648+ 8 β vertex tables (v1 properties (id, name));
9649+ β°β΄ β 1. source
9650+ " ) ;
9651+
9652+ assert_snapshot ! ( goto( "
9653+ create table v1 (
9654+ id int8 primary key,
9655+ name text
9656+ );
9657+
9658+ create property graph g1
9659+ vertex tables (v1 properties (id, nam$0e));
9660+ " ) , @"
9661+ ββΈ
9662+ 4 β name text
9663+ β ββββ 2. destination
9664+ β‘
9665+ 8 β vertex tables (v1 properties (id, name));
9666+ β°β΄ β 1. source
9667+ " ) ;
9668+ }
9669+
9670+ #[ test]
9671+ fn goto_create_property_graph_edge_properties_column ( ) {
9672+ assert_snapshot ! ( goto( "
9673+ create table v1 (id int8 primary key);
9674+ create table v2 (id int8 primary key);
9675+ create table e1 (
9676+ id int8 primary key,
9677+ source_id int8 references v1,
9678+ destination_id int8 references v2
9679+ );
9680+
9681+ create property graph g1
9682+ vertex tables (v1, v2)
9683+ edge tables (
9684+ e1
9685+ source v1
9686+ destination v2
9687+ properties (id, source_id$0, destination_id));
9688+ " ) , @"
9689+ ββΈ
9690+ 6 β source_id int8 references v1,
9691+ β βββββββββ 2. destination
9692+ β‘
9693+ 16 β properties (id, source_id, destination_id));
9694+ β°β΄ β 1. source
9695+ " ) ;
9696+ }
9697+
93869698 #[ test]
93879699 fn goto_drop_property_graph ( ) {
93889700 assert_snapshot ! ( goto( "
0 commit comments