I'm looking for a way, preferable an NPM Package, to parse an SQL query to JSON. I found some for SELECT statements, but I actually need for UPDATE and INSERT INTO statements.
For example, a Query in the form of
"UPDATE "users" SET name = $2 where id in ($1)", ['new name', 1]
The result should be something like:
{
action: 'UPDATE',
entity: 'users',
values: { name: 'new name' },
conditions: { 'id': 1}
}
Thank you for your help!