Open ranmocy opened 1 year ago
I solved it as follows, similar to https://github.com/oguimbal/pg-mem/issues/149#issuecomment-1125448707.
db.public.interceptQueries(sql => {
const newSql = sql.replace(/for\s+update\sof\s+"([^"]*)"+/gi, 'FOR UPDATE');
if (sql !== newSql) {
return db.public.many(newSql);
}
// proceed to actual SQL execution for other requests.
return null;
});
To fundamentally resolve the issue, I have published an issue in another repository. https://github.com/oguimbal/pgsql-ast-parser/issues/164
Query:
I got error:
I understand pg-mem doesn't intent to support concurrency. Could you help update the syntax parser so that
FOR UPDATE OF "ABC"
could be parsed but ignored during execution? At least not crash the test:)