Executes a raw SQL SELECT query and returns results as a data.table. Use this for custom queries not covered by the typed accessor functions.
The unlist parameter is useful for config lookups where you expect
exactly one row and want direct field access (result$field_name).
Arguments
- qry
SQL SELECT query string. Must be a valid SELECT statement.
- cn
Database connection. If NULL, opens and closes automatically. Pass an existing connection to batch multiple queries efficiently.
- unlist
If TRUE, returns result as a list instead of data.table. Useful for single-row lookups.
- by_rows
If TRUE and unlist=TRUE, applies list conversion by rows.
See also
Other db-interface:
dbArtAppend(),
dbArtUpdate()