[#2430] Add CustomQueryPart for use with plain SQL and other places