Data Model
The driver models Tableau CRM datasets and lenses as database views, or read-only tables, using the Tableau CRM REST API. Datasets additionally support bidirectional access.
The following sections provide information on the functionality available through the views and stored procedures.
Views
You can use the driver to work with all the datasets and lenses in your account. View schemas are discovered dynamically at run time.
Dataset tables start with "Dataset_", so if you want to get the data of a dataset called "Test", the table name would be "Dataset_Test". Lens tables start with "Lens_", so if you want to get the data of a lens called "Test", then the table name would be "Lens_Test".
See System Tables to obtain schema information and other driver metadata at run time. The Views section shows an example database modeled on datasets and lenses available in the Tableau CRM development environment.
Dynamic Schemas
When you connect, the driver gets the list of tables and the metadata for the tables by calling the appropriate Web services. Any changes you make to your datasets or lenses, such as adding new columns or changing the data type of a column, will immediately be reflected when you connect using the driver.
Query Processing
The driver offloads as much of the SELECT statement processing as possible to Tableau CRM and then processes the rest of the query within the driver.
Executing SQL to Datasets and Lenses
Datasets support INSERT statements, while lenses support only SELECT; you can also call the UploadCSVToDataSet stored procedure to insert to an existing dataset or to create a new dataset.
See the following sections for examples of executing SQL to datasets and lenses:
Customizing Schemas
You can customize table schemas to do the following:
- Change the columns and data types reported.
- Change the operations that can be executed against a dataset or lense.
Stored Procedures
Stored Procedures are function-like interfaces to the data source. They can be used to access other API functionality not surfaced through the views.