It would make my work a lot easier if I found out where exactly the SQL queries are constructed so that it’s possible to substitute the codewords via hardcode while it’s being built.

It’s built here.

The .apply method applies parameters to raw query sql text to get the executable sql. Just dig into .apply method and you’ll get it.