booqoffsky commented on issue #315:
URL: https://github.com/apache/age/issues/315#issuecomment-1331894427

   Thanks for the detailed explanation! 
   
   There was an idea that it would be possible to slightly reduce the amount of 
programming to execute a query with parameters calculated in the code (not to 
do PREPARE first and then EXECUTE). 
   
   However, after trying psycopg3 (Postgresql adapter for Python), I found for 
myself that such code is enough to correctly execute the request:
   
   ```
   cursor.execute(
               """
                   SELECT * FROM cypher('test_graph', $$
                   MATCH (u:User {user_id: $user_id})
                   RETURN u.user_id
                   $$, %(cypher_params)s)  AS (a agtype);
               """,
               params={
                   "cypher_params": json.dumps(
                       {
                           "user_id": "test_user",
                       }
                   )
               }
           )
   ```
   
   So I think my question can be considered closed


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