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

Function classify_lifecycle

xtask/src/extension_catalog.rs:1411–1446  ·  view source on GitHub ↗
(id: &str, control: Option<&ControlMetadata>)

Source from the content-addressed store, hash-verified

1409}
1410
1411fn classify_lifecycle(id: &str, control: Option<&ControlMetadata>) -> ExtensionLifecycle {
1412 let mut lifecycle = ExtensionLifecycle {
1413 create_extension: id != "auto_explain",
1414 create_schema: Some(
1415 control
1416 .and_then(|control| control.schema.clone())
1417 .unwrap_or_else(|| "pg_catalog".to_owned()),
1418 ),
1419 load_sql: Vec::new(),
1420 post_create_sql: Vec::new(),
1421 startup_config: Vec::new(),
1422 preload_required: false,
1423 restart_required: false,
1424 shared_memory_required: false,
1425 };
1426 match id {
1427 "auto_explain" => {
1428 lifecycle.create_extension = false;
1429 lifecycle.create_schema = None;
1430 lifecycle.load_sql = vec![
1431 "LOAD 'auto_explain';".to_owned(),
1432 "SET auto_explain.log_min_duration = '0';".to_owned(),
1433 "SET auto_explain.log_analyze = 'true';".to_owned(),
1434 "SET auto_explain.log_level = 'NOTICE';".to_owned(),
1435 ];
1436 }
1437 "age" => {
1438 lifecycle.load_sql.push("LOAD 'age';".to_owned());
1439 lifecycle
1440 .post_create_sql
1441 .push("SET search_path = ag_catalog, \"$user\", public;".to_owned());
1442 }
1443 _ => {}
1444 }
1445 lifecycle
1446}
1447
1448fn classify_source_kind(
1449 id: &str,

Callers 1

discover_catalogFunction · 0.85

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected