Related to my earlier #2096 ticket of optimising whereIn queries. Thanks to the support of overriding methods, we could speed up queries drastically.
Now we would like to eliminate thousands of parameters in batch insert. I envision this could be done in form of
INSERT INTO <TABLE> (<COLS>) VALUES (<VALUES>) where VALUES would support raw expression (I would pass JSON string that would be decoded with postgres function).
Now I understand insert is implemented with KnexOperation that extends ObjectionToKnexConvertingOperation, and knex insert itself does not seem to support specifying cols or values part, either. I believe that might be a bit difficult to support in Objection?
How could I override insert with a custom operation with signature compatible with KnexOperation, but the practical implementation would be something in line with knex.raw()? E.g. what is the minimal implementation of a custom Operation that could execute a custom query?