[feature/nestedsets] Make get_sql_where public so it's easier testable