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


   According to the documentation on Apache AGE types 
(https://age.apache.org/docs/master/intro/types.html):
   
   > AGE uses a custom data type called agtype, which is the only data type 
returned by AGE
   
   I'm using the nodejs driver as per the instructions on the README page 
(https://github.com/apache/incubator-age/tree/master/drivers/nodejs/README.md):
   
   The driver works fine as long as the query returns an agtype that contains 
an object or an array, but for all other types the driver returns _undefined_.
   
   For example, for the query:
   
       `SELECT * FROM cypher('dev', $$ RETURN 555 as value $$) as (value 
agtype)`
   
   the nodejs-pg-age driver returns this (note the return value is undefined).
   
   ```
   Result {
     command: 'SELECT',
     rowCount: 1,
     oid: null,
     rows: [ { value: undefined } ],
     fields: [
       Field {
         name: 'value',
         tableID: 0,
         columnID: 0,
         dataTypeID: 16448,
         dataTypeSize: -1,
         dataTypeModifier: -1,
         format: 'text'
       }
     ],
     ...
   ``` 
   
   It seems the driver's type parser only recognizes objects and arrays. 
   
   If I define the column type as integer it returns the expected value:
   
       `SELECT * FROM cypher('dev', $$ RETURN 555 as value $$) as (value 
integer)`
       
   ```
   Result {
     command: 'SELECT',
     rowCount: 1,
     oid: null,
     rows: [ { value: 555 } ],
     fields: [
       Field {
         name: 'value',
         tableID: 0,
         columnID: 0,
         dataTypeID: 16448,
         dataTypeSize: -1,
         dataTypeModifier: -1,
         format: 'text'
       }
     ],
     ...
   ``` 
   
   My question is, shouldn't the nodejs driver (node-pg-age) be parsing all 
valid agtype values -- including numbers, strings and booleans -- not just 
objects and arrays?
   
   
   
   
   
   
   
   
   
   


-- 
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


Reply via email to