Method get_db_type()
Get the database type
Usage
DataSource$get_db_type()
Returns
A string describing the database type (e.g., "DuckDB", "SQLite")
Method get_schema()
Get schema information about the table
Usage
DataSource$get_schema(categorical_threshold = 20)
Arguments
categorical_threshold
Maximum number of unique values for a text
column to be considered categorical
Returns
A string containing schema information formatted for LLM prompts
Method execute_query()
Execute a SQL query and return results
Usage
DataSource$execute_query(query)
Arguments
query
SQL query string to execute
Returns
A data frame containing query results
Method test_query()
Test a SQL query by fetching only one row
Usage
DataSource$test_query(query, require_all_columns = FALSE)
Arguments
query
SQL query string to test
require_all_columns
If TRUE, validates that the result includes
all original table columns (default: FALSE)
Returns
A data frame containing one row of results (or empty if no
matches)
Method get_data()
Get the unfiltered data as a data frame
Usage
DataSource$get_data()
Returns
A data frame containing all data from the table
Method cleanup()
Clean up resources (close connections, etc.)
Usage
DataSource$cleanup()
Method clone()
The objects of this class are cloneable with this method.
Usage
DataSource$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.