adaptation of SQL generation to allow for cordscript sql needs