You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@age.apache.org by GitBox <gi...@apache.org> on 2021/12/13 16:18:00 UTC

[GitHub] [incubator-age] afidegnum opened a new issue #158: no binary output function available for type agtype!

afidegnum opened a new issue #158:
URL: https://github.com/apache/incubator-age/issues/158


   I decided to step into the Rust AGE development by starting with few tests and I'm greeted with the following error. 
   
   `Row { columns: [Column { name: "count", type: Int8 }] }`
   `Error: db error: ERROR: no binary output function available for type agtype!`
   
   this is what I've written so far. 
   
   
   ```
   pub fn graph_list() -> Result<(), Error> {
       let conn_string = "host=localhost port=5432 dbname=texttest user=afidegnum password=chou1979";
       let mut client= Client::connect(conn_string, NoTls)?;
   
   
       
       &client
           .batch_execute("LOAD \'age\'")?;
   
   
       &client
           .batch_execute("SET search_path = ag_catalog, \"$user\", public")?;
   
        for types in &client.query("SELECT count(*) FROM ag_graph WHERE name= '\text_test\'", &[])?{
            println!("{:?}", types)
        }
   
          
   
   
       for row in client.query("SELECT * from cypher('text_test', $$ MATCH (V:node) RETURN V $$) as (V agtype)", &[])? {
           println!("{:?}", row);
       }
       Ok(())
   }
   
   
   let res = graph_list();
   match res {
           Ok(r) => {println!("Succeeded! {:?} ", r);},
           Err(e) => {println!("Error: {}!", e);}
       }
   
   ```


-- 
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-unsubscribe@age.apache.org

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



[GitHub] [incubator-age] joe-fagan commented on issue #158: no binary output function available for type agtype!

Posted by GitBox <gi...@apache.org>.
joe-fagan commented on issue #158:
URL: https://github.com/apache/incubator-age/issues/158#issuecomment-994219135


   Notice in your code
   WHERE name= '\text_test
   Should it read
   WHERE name= \'text_test


-- 
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-unsubscribe@age.apache.org

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



[GitHub] [incubator-age] joefagan commented on issue #158: no binary output function available for type agtype!

Posted by GitBox <gi...@apache.org>.
joefagan commented on issue #158:
URL: https://github.com/apache/incubator-age/issues/158#issuecomment-996903853


   @afidegnum 
   Please can we close out this issue first. IE
   
   - Did the Cypher code I separated out work for you?
   - Did correcting the order of backslash and quote work for you?
   
   Please answer those questions.
   
   Please raise this new ANTLR question as a new issue, 


-- 
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-unsubscribe@age.apache.org

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



[GitHub] [incubator-age] joe-fagan commented on issue #158: no binary output function available for type agtype!

Posted by GitBox <gi...@apache.org>.
joe-fagan commented on issue #158:
URL: https://github.com/apache/incubator-age/issues/158#issuecomment-994218777


   Notice in your code 
   WHERE name= '\text_test
   Should it read
   WHERE name= \'text_test
   ?


-- 
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-unsubscribe@age.apache.org

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



[GitHub] [incubator-age] afidegnum commented on issue #158: no binary output function available for type agtype!

Posted by GitBox <gi...@apache.org>.
afidegnum commented on issue #158:
URL: https://github.com/apache/incubator-age/issues/158#issuecomment-993932376


   any update?


-- 
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-unsubscribe@age.apache.org

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



[GitHub] [incubator-age] afidegnum commented on issue #158: no binary output function available for type agtype!

Posted by GitBox <gi...@apache.org>.
afidegnum commented on issue #158:
URL: https://github.com/apache/incubator-age/issues/158#issuecomment-994677964


   yes, since the quey is enclosed in a string, I need to escape additional quotes so it can be consumed by the db engine 


-- 
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-unsubscribe@age.apache.org

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



[GitHub] [incubator-age] afidegnum commented on issue #158: no binary output function available for type agtype!

Posted by GitBox <gi...@apache.org>.
afidegnum commented on issue #158:
URL: https://github.com/apache/incubator-age/issues/158#issuecomment-996949432


   Ok, thanks, The first query works, I was able to count the rows, but the second query didn't work, Rust need to convert the binary output to a textual output, which leads to the question on ANTLR. I'm opening a new issue. 


-- 
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-unsubscribe@age.apache.org

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



[GitHub] [incubator-age] joefagan commented on issue #158: no binary output function available for type agtype!

Posted by GitBox <gi...@apache.org>.
joefagan commented on issue #158:
URL: https://github.com/apache/incubator-age/issues/158#issuecomment-994161803


   I've tried your commands in Postgres with AGE extension using the command line utility psql. I get the following - all as expected - shown below.
   
   Does it work correctly using psql?
   Can you isolate the line in your code that produces the error?
   
   Maybe someone else can help with the error "no binary output function available for type" which I think is coming from postgres.
   
   ```
   /* These are the queries I tried that appears in your code */
   SELECT create_graph('text_test');
   
   SELECT count(*) from ag_graph where name='text_test';
   
   SELECT * from cypher('text_test', $$ 
           CREATE (:node {Name: '1st Node'})
           CREATE (:node {Name: '2nd Node'})   
   $$) as ( col agtype);
   
   SELECT * from cypher('text_test', $$ MATCH (V:node) RETURN V $$) as (V agtype);
   ```
   
   
   postgres=# SELECT create_graph('text_test');
   NOTICE:  graph "text_test" has been created
    create_graph
   --------------
   
   (1 row)
   
   postgres=# SELECT count(*) from ag_graph where name='text_test';
    count
   -------
        1
   (1 row)
   
   postgres=# SELECT * from cypher('text_test', $$
   postgres$#         CREATE (:node {Name: '1st Node'})
   postgres$#         CREATE (:node {Name: '2nd Node'})
   postgres$# $$) as ( col agtype);
    col
   -----
   (0 rows)
   
   postgres=#
   postgres=# SELECT * from cypher('text_test', $$ MATCH (V:node) RETURN V $$) as (V agtype);
                                             v
   --------------------------------------------------------------------------------------
    {"id": 844424930131969, "label": "node", "properties": {"Name": "1st Node"}}::vertex
    {"id": 844424930131970, "label": "node", "properties": {"Name": "2nd Node"}}::vertex
   (2 rows)
   


-- 
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-unsubscribe@age.apache.org

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



[GitHub] [incubator-age] afidegnum commented on issue #158: no binary output function available for type agtype!

Posted by GitBox <gi...@apache.org>.
afidegnum commented on issue #158:
URL: https://github.com/apache/incubator-age/issues/158#issuecomment-994203729


   Thanks, let me give it  a try


-- 
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-unsubscribe@age.apache.org

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



[GitHub] [incubator-age] afidegnum commented on issue #158: no binary output function available for type agtype!

Posted by GitBox <gi...@apache.org>.
afidegnum commented on issue #158:
URL: https://github.com/apache/incubator-age/issues/158#issuecomment-996852312


   I'm trying to understand the ANTLR parser, Can you please explain, what is supposed to be the workflow of the AGE driver? 


-- 
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-unsubscribe@age.apache.org

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



[GitHub] [incubator-age] joe-fagan commented on issue #158: no binary output function available for type agtype!

Posted by GitBox <gi...@apache.org>.
joe-fagan commented on issue #158:
URL: https://github.com/apache/incubator-age/issues/158#issuecomment-994733026


   … but you have put the escape character inside the string. You have escaped the T not the quote. You have written 
   Quote Backslash Text 
   instead of
   Backslash Quote Text


-- 
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-unsubscribe@age.apache.org

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



[GitHub] [incubator-age] joe-fagan commented on issue #158: no binary output function available for type agtype!

Posted by GitBox <gi...@apache.org>.
joe-fagan commented on issue #158:
URL: https://github.com/apache/incubator-age/issues/158#issuecomment-994220597


   The renderer is leaving out a backslash 
   I think I got it this time…
   WHERE name= '\text_test
   Should it read
   WHERE name= \\'text_test


-- 
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-unsubscribe@age.apache.org

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



[GitHub] [incubator-age] afidegnum commented on issue #158: no binary output function available for type agtype!

Posted by GitBox <gi...@apache.org>.
afidegnum commented on issue #158:
URL: https://github.com/apache/incubator-age/issues/158#issuecomment-994746591


   Thanks for the hint. I'm now trying the queries again, I will keep you updated shortly 


-- 
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-unsubscribe@age.apache.org

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



[GitHub] [incubator-age] afidegnum closed issue #158: no binary output function available for type agtype!

Posted by GitBox <gi...@apache.org>.
afidegnum closed issue #158:
URL: https://github.com/apache/incubator-age/issues/158


   


-- 
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-unsubscribe@age.apache.org

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