MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / sanitizeSQLAlias

Function sanitizeSQLAlias

src/optimizer/foreign_join_push_down_optimizer.cpp:340–350  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

338};
339
340static std::string sanitizeSQLAlias(std::string alias) {
341 for (auto& ch : alias) {
342 if (!std::isalnum(static_cast<unsigned char>(ch)) && ch != '_') {
343 ch = '_';
344 }
345 }
346 if (alias.empty() || std::isdigit(static_cast<unsigned char>(alias[0]))) {
347 alias = "col_" + alias;
348 }
349 return alias;
350}
351
352// Build the SQL join query string and collect column names for result mapping.
353// Keep result column names SQL-safe while using display names that preserve the user's labels.

Callers 1

buildJoinQueryFunction · 0.85

Calls 1

emptyMethod · 0.45

Tested by

no test coverage detected