Following @ArthurHoaro comment:
I didn't really take a deep look at the implementation, but it looks like that there is a lot of code for SQL query building.
As a further improvement, maybe it would make sense to use a proper SQL query builder as a dependency rather than implementing one in this lib.
Following @ArthurHoaro comment: