bravius commented on issue #236:
URL: https://github.com/apache/age/issues/236#issuecomment-1164686196

   Posting the results of some experiments, for when others run into the same 
issue. 
   
   First, I tried a quick experiment to change the scaling of entry ids to 40 
bits instead of 48. No luck, server just crashes on any graph operation (after 
complete re-initialization of AGE extension via DROP/CREATE extension), so I 
think changing the scaling of the graphid type is more involved than just 
altering graphid.h definitions and recompiling. I don't think the solution is 
ideal anyway, since the issue is with the JavaScript client, not AGE.
   
   Second, I tried having the node-pg-age driver convert integers to BigInt 
instead of Number. This works great, except any de/serialization code, e.g. 
json, has to be re-written to handle BigInt. 
   
   To change the node driver to use BigInt instead of Number involves changing 
just one line in CustomAgTypeListener.ts:
   
   ```
   exitIntegerValue (ctx: IntegerValueContext): void {
   -    const value = parseInt(ctx.text)
   +    const value = BigInt(ctx.text)
       if (!this.pushIfArray(value)) {
         this.lastValue = value
       }
     }
     
    ```
   
   
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to