{"schemaVersion":1,"resourceType":"connector","slug":"survival","name":"Survival","catalog":"survival","description":"Estimate survival curves, hazard ratios and log-rank tests from time-to-event data","language":"Python","categories":["analytics"],"repository":"https://github.com/Query-farm/vgi-survival","license":"MIT","generatedAt":"2026-12-01T18:22:16+00:00","runtime":{"engineVersion":"2.0.1","protocolVersion":"3.4"},"release":{"tag":"v0.5.0","publishedAt":"2026-11-25T18:30:47Z","url":"https://github.com/Query-farm/vgi-survival/releases/tag/v0.5.0"},"links":{"html":"https://query.farm/products/orchard/connectors/survival/","llms":"https://query.farm/products/orchard/connectors/survival/llms.txt","markdown":"https://query.farm/products/orchard/connectors/survival/index.md","json":"https://query.farm/products/orchard/api/v1/connectors/survival.json","objects":"https://query.farm/products/orchard/api/v1/connectors/survival/objects.json","search":"https://query.farm/products/orchard/api/v1/search.json?kind=object&connector=survival&q={query}"},"authentication":{"mode":"none_declared","guidance":"No service credentials are declared by this connector. Individual datasets, input files or deployments may have their own prerequisites.","interpretation":"Secret parameter required flags describe the upstream declaration; they do not override the service-level mode above. Keep secrets in environment variables or the deployment secret store. SQL values in angle brackets are placeholders, not automatic environment lookups. Native DuckDB and Haybarn 2.0.1 do not provide a SQL getenv() function, even when worker-supplied snippets mention it. Read environment variables in your application and pass credential values through client parameter bindings (for example, Python con.execute(\"CREATE SECRET stripe (TYPE stripe, api_key ?)\", [os.environ[\"STRIPE_API_KEY\"]]) after attaching the connector. Omit unused optional parameters and keep real values out of saved SQL and logs.","secrets":[]},"deployment":{"local":{"methods":[{"id":"uvx","label":"uvx","icon":"simple-icons:python","steps":[{"title":"Attach with uvx","description":"Needs uv. uvx builds the worker from its release tag on first attach and reuses the cached environment after that.","lang":"sql","code":"ATTACH 'survival' AS survival (\n  TYPE vgi,\n  LOCATION 'uvx --from git+https://github.com/Query-farm/vgi-survival@v0.5.0 vgi-survival-worker'\n);"}]},{"id":"docker","label":"Docker","icon":"simple-icons:docker","steps":[{"title":"Attach the signed image","description":"Needs Docker, Podman or another OCI runtime. The extension runs the container and talks to it over stdio.","lang":"sql","code":"ATTACH 'survival' AS survival (\n  TYPE vgi,\n  LOCATION 'oci://ghcr.io/query-farm/vgi-survival:0.5.0'\n);"}]}],"pinnedMethods":[{"id":"uvx","label":"uvx","icon":"simple-icons:python","steps":[{"title":"Attach with uvx","description":"Needs uv. uvx builds the worker from its release tag on first attach and reuses the cached environment after that.","lang":"sql","code":"ATTACH 'survival' AS survival (\n  TYPE vgi,\n  LOCATION 'uvx --from git+https://github.com/Query-farm/vgi-survival@v0.5.0 vgi-survival-worker'\n);"}]},{"id":"docker","label":"Docker","icon":"simple-icons:docker","steps":[{"title":"Attach the signed image","description":"Needs Docker, Podman or another OCI runtime. The extension runs the container and talks to it over stdio.","lang":"sql","code":"ATTACH 'survival' AS survival (\n  TYPE vgi,\n  LOCATION 'oci://ghcr.io/query-farm/vgi-survival:0.5.0'\n);"}]}]},"selfHost":{"instructions":"https://github.com/Query-farm/vgi-survival","connectionGuide":"https://query.farm/vgi/connect-to-a-worker/","guidance":"Deploy using the connector repository instructions and use its supported HTTP or SSH transport. Replace example URLs with your actual deployment; configure its authentication."},"queryFarm":{"available":true,"console":"https://auth.queryfarm.cloud/console/new?worker=survival","organizationMonthlyMinimumUsd":10,"pricing":"https://query.farm/products/orchard/hosted/"},"publicDemo":null},"setup":{"extensions":{"duckdb":"SET allow_extension_repositories = 'allowed';\n\nCREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm\n    WITH PREFIX 'https://duckdb-extensions.query.farm';\n\nINSTALL vgi FROM query_farm;\nLOAD vgi FROM query_farm;","haybarn":"INSTALL vgi FROM community;\nLOAD vgi;"},"attachSql":"ATTACH 'survival' AS survival (\n  TYPE vgi,\n  LOCATION 'uvx --from git+https://github.com/Query-farm/vgi-survival@v0.5.0 vgi-survival-worker'\n);","attachOptions":[],"note":"Install and load VGI, attach the connector using the catalog alias shown here, then create required secrets. Replace placeholders and omit unused optional secret parameters. Satisfy file, network and credential prerequisites before executing a query."},"example":{"title":"Estimate a survival curve over time","sql":"SELECT time, survival, at_risk FROM survival.main.kaplan_meier((SELECT * FROM (VALUES (5,1),(8,0),(12,1),(3,1),(9,0)) AS c(t, e)), duration := 't', event := 'e') ORDER BY time","requiresCredentials":null,"note":null,"objects":[{"name":"survival.main.kaplan_meier","kind":"table_in_out_function","links":{"html":"https://query.farm/products/orchard/connectors/survival/#obj-main-kaplan_meier","markdown":"https://query.farm/products/orchard/connectors/survival/objects/table_in_out_function.bWFpbg.a2FwbGFuX21laWVy.md","json":"https://query.farm/products/orchard/api/v1/connectors/survival/objects/table_in_out_function.bWFpbg.a2FwbGFuX21laWVy.json"}}],"evidence":{"status":"captured_result","capturedAt":"2026-12-01T06:21:29+00:00","engineVersion":"2.0.1","protocolVersion":"3.4.0","releaseTag":"v0.5.0","sample":{"columns":["time","survival","at_risk"],"types":["DOUBLE","DOUBLE","BIGINT"],"rows":[[0,1,5],[3,0.8,5],[5,0.6,4],[8,0.6,3],[9,0.6,2]],"more":true}},"artifact":null},"objects":{"total":5,"index":"https://query.farm/products/orchard/api/v1/connectors/survival/objects.json","search":"https://query.farm/products/orchard/api/v1/search.json?kind=object&connector=survival&q={query}"},"agentTasks":["A cohort has a follow-up time column `t` and an event indicator `e` (1 = the event occurred, 0 = right-censored), with rows (5,1), (8,0), (12,1), (3,1), (9,0). Return the Kaplan-Meier survival curve as two columns — the observed time and the survival probability S(t) — ordered by time ascending.","Fit a Cox proportional-hazards model to a cohort with follow-up time `t`, event indicator `e` (1 = event, 0 = censored), and a single covariate `prio`, with rows (5,1,1.0), (8,0,0.0), (12,1,2.0), (3,1,3.0), (9,0,0.0), (6,1,1.0). Return the covariate name and its hazard ratio.","Two treatment arms are labelled in column `arm`; each subject has a follow-up time `t` and an event indicator `e` (1 = event, 0 = censored), with rows (5,1,'a'), (8,0,'a'), (12,1,'b'), (3,1,'b'), (9,0,'a'), (6,1,'b'). Use the log-rank test to compare survival between the arms and return the test statistic, the p-value, and the degrees of freedom.","A cohort has a follow-up time column `t` and an event indicator `e` (1 = the event occurred, 0 = right-censored), with rows (5,1), (8,0), (12,1), (3,1), (9,0). Return the median survival time.","Subscribers have a tenure in months `tenure`, a churn indicator `churned` (1 = churned, 0 = still subscribed, i.e. censored), and a `plan` ('monthly' or 'annual'), with rows (1,1,'monthly'), (2,1,'monthly'), (3,0,'monthly'), (3,1,'monthly'), (5,1,'monthly'), (6,1,'monthly'), (8,0,'monthly'), (9,1,'monthly'), (3,1,'annual'), (6,0,'annual'), (10,1,'annual'), (12,1,'annual'), (12,0,'annual'), (15,1,'annual'), (18,1,'annual'), (24,0,'annual'). Return one row per plan with three columns: the plan name, that plan's median survival (tenure) time, and the log-rank test p-value comparing the two plans (the same p-value on both rows). Order the rows by plan name ascending.","Hardware units have run-time `hours`, a failure indicator `failed` (1 = failed, 0 = still running, i.e. censored), and a `model` ('old' or 'new'), with rows (120,1,'old'), (200,1,'old'), (250,0,'old'), (310,1,'old'), (400,1,'old'), (450,1,'old'), (500,0,'old'), (180,1,'new'), (350,0,'new'), (420,1,'new'), (600,1,'new'), (650,0,'new'), (700,1,'new'), (800,0,'new'). Return a single row with two columns: the log-rank test p-value comparing the two models, and the Cox proportional-hazards hazard ratio for the new model, fitted with a single 0/1 covariate that is 1 for 'new' and 0 for 'old'.","This catalog exposes several survival / time-to-event methods and also provides a browsable relation that lists them. Using that registry of methods, return the name of every method whose category is regression."],"provenance":{"generatedAt":"2026-12-01T18:22:16+00:00","repository":"https://github.com/Query-farm/vgi-survival","harvest":{"status":"ok","method":"subprocess","error":null,"vgi_version":"9773130dde"},"catalogVerification":{"verified":true,"status":"passed","total":3,"passed":3,"failed":0,"needs_credentials":0,"location":"uvx --from git+https://github.com/Query-farm/vgi-survival@v0.5.0 vgi-survival-worker","transport":"subprocess","environment":{"vgi_extension_version":"9773130dde","haybarn_version":"2.0.1rc3","engine_version":"v2.0.1","python":"3.12.4","platform":"darwin_arm64","protocol_version":"3.4.0"},"checked_at":"2026-12-01T06:20:36+00:00"},"interpretation":"Catalog verification records the harvest environment. It is not proof that every query or current live API call succeeds. Only an example with captured_result has a saved result for that exact SQL."},"interpretation":["Missing, null, or undeclared metadata means unknown; do not invent defaults, credential scope, platform support or endpoint URLs.","Search is keyword retrieval, not proof of a capability. Read the exact object declaration before generating SQL.","A table and a table function can have the same name. Preserve parentheses and use the matching overload and schema.","Service credentials, external data availability and deployment authentication are separate requirements."]}