Hey everyone, I have an interesting use case. I'm trying to figure out if there's a way to reconstruct/run a query from a Query object obtained via
query.toSQL()
query.toSQL()
. Something like:
tsconst query = db.select().from(usersTable).limit(1);const sql: Query = query.toSQL();// Is there a way to do something like this?const queryFromSql = db.fromSQL(sql); // or any other approach?
tsconst query = db.select().from(usersTable).limit(1);const sql: Query = query.toSQL();// Is there a way to do something like this?const queryFromSql = db.fromSQL(sql); // or any other approach?
I know this might seem unusual, but I have a specific use case where I need to serialize and later reconstruct queries. Would love to hear if anyone has ideas on how to achieve this or alternative approaches I could explore.