Re: [I] how to create constraints [age]

2024-06-03 Thread via GitHub


JourneyToSilius commented on issue #1635:
URL: https://github.com/apache/age/issues/1635#issuecomment-2146281375

   @NathanFrund here is a demo implementation of how I did it in Go:
   
   ```
   func (s *store) CreateUniquePropertyFunction() error {
   
queryFormat := `CREATE OR REPLACE FUNCTION 
graph.aggregated.get_vertex_address(properties agtype) 
RETURNS agtype
AS
$BODY$
SELECT graph.ag_catalog.agtype_access_operator($1, '"address"');
$BODY$
LANGUAGE sql
IMMUTABLE;`
   
_, err := s.AgePoolConnector.Pool.Exec(context.Background(), 
queryFormat)
if err != nil {
return fmt.Errorf("failed to execute query: %v", err)
}
return nil
   }
   
   
   func (s *store) CreateUniqueVertexConstraint() error {
   
queryFormat := `CREATE UNIQUE INDEX idx_v2vertex_address_constraint ON 
graph.aggregated.v2vertex(get_vertex_address(properties));`
_, err := s.AgePoolConnector.Pool.Exec(context.Background(), 
queryFormat)
if err != nil {
return handleQueryError(err)
}
   
return nil
   }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@age.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [I] how to create constraints [age]

2024-06-03 Thread via GitHub


NathanFrund commented on issue #1635:
URL: https://github.com/apache/age/issues/1635#issuecomment-2146187036

   @JourneyToSilius, have you figured out how to apply constraints in the graph?
   
   I'm just now tarting to exploring this.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@age.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [I] how to create constraints [age]

2024-03-26 Thread via GitHub


JourneyToSilius closed issue #1635: how to create constraints 
URL: https://github.com/apache/age/issues/1635


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@age.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [I] how to create constraints [age]

2024-03-07 Thread via GitHub


JourneyToSilius commented on issue #1635:
URL: https://github.com/apache/age/issues/1635#issuecomment-1983205530

   Hi, thanks. So how are constraints created ? Is this possible ? The thing 
is, I can't find anything in the docs


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@age.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [I] how to create constraints [age]

2024-03-06 Thread via GitHub


dehowef commented on issue #1635:
URL: https://github.com/apache/age/issues/1635#issuecomment-1981651206

   Hello, we are aware of this syntax, though is not yet implemented. Thanks 
for your interest.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@age.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[I] how to create constraints [age]

2024-03-02 Thread via GitHub


JourneyToSilius opened a new issue, #1635:
URL: https://github.com/apache/age/issues/1635

   `CREATE CONSTRAINT ON (person:Person) ASSERT person.id IS UNIQUE;`
   
   Is there  a way to create constraints like this om AGE ? If there is, sorry 
since I can't find documentation about it, would appreciate if you can point out


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@age.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org