Skip to contents

Enforces an unbypassable read-only SQL policy for natural-language cohort queries against a dicom_index_build() index. Rejects SQL comments, multi-statement semicolons, DDL/DML/admin statements, and DuckDB host-file reader functions.

Usage

validate_readonly_sql(sql)

Arguments

sql

Character SQL string to validate.

Value

Invisibly returns TRUE if valid; otherwise aborts via cli::cli_abort().

Examples

validate_readonly_sql("SELECT StudyInstanceUID, Modality FROM series WHERE Modality = 'CT'")