MCPcopy Create free account
hub / github.com/f0rr0/oliphaunt / discover_sql_name

Function discover_sql_name

xtask/src/extension_catalog.rs:1167–1186  ·  view source on GitHub ↗
(
    id: &str,
    repl_export: Option<&ReplExport>,
    _docs_entry: Option<&DocsCatalogEntry>,
)

Source from the content-addressed store, hash-verified

1165}
1166
1167fn discover_sql_name(
1168 id: &str,
1169 repl_export: Option<&ReplExport>,
1170 _docs_entry: Option<&DocsCatalogEntry>,
1171) -> Result<String> {
1172 if id == "uuid_ossp" {
1173 return Ok("uuid-ossp".to_owned());
1174 }
1175 if id == "vector" {
1176 return Ok("vector".to_owned());
1177 }
1178 let control_file = discover_control_file(id, id, repl_export);
1179 if let Some(path) = control_file
1180 && path.is_file()
1181 && let Some(stem) = path.file_stem().and_then(|stem| stem.to_str())
1182 {
1183 return Ok(stem.to_owned());
1184 }
1185 Ok(id.to_owned())
1186}
1187
1188fn discover_control_file(
1189 id: &str,

Callers 1

discover_catalogFunction · 0.85

Calls 1

discover_control_fileFunction · 0.85

Tested by

no test coverage detected