Intendation and testing of get_records_sql function