add language auto-detect and SQL Debug option