I am having a lot of trouble in converting the below SQL query to SQLAlchemy query. Please help:

insert into conform_layer (unique_no,key_name,value_name) 
SELECT id, key, value FROM (select row_to_json(t.*) AS line, id 
FROM csvimport AS t) AS r JOIN LATERAL json_each_text(r.line) ON (key <> 'id')

Try sqlitis ("a tool to convert plain SQL queries to SQLAlchemy expressions"). It's a WIP project, but should be a good starting point.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.