Data Model
Overview
Depending upon the connection settings being used, the add-in can present several different mappings between Couchbase entities and relational tables and views. For more details on each of these capabilities, refer to the NoSQL portion of this documentation.
- When connecting to the N1QL query service, the add-in models Couchbase buckets as relational tables. In addition, if TypeDetectionScheme is set to DocType or Infer, the add-in will present different document flavors in each bucket as their own tables.
- When connecting to the Analytics service, the add-in models Couchbase datasets as relational views.
- When connecting with either service, the add-in can expose arrays of data as child tables or views.
Please see the Automatic Schema Discovery section for more details on how flavor and child tables are exposed. In addition, the NewChildJoinsMode connection property is recommended for workflows that make heavy use of child tables. The documentation for that connection property details the improvements it makes to the add-in data model.
Dataverses, Scopes and Collections
Couchbase has different ways of grouping buckets and datasets depending on the CouchbaseService and version of Couchbase you are connecting to:
- Couchbase organizes Analytics datsets into groups called dataverses. By default the add-in exposes datasets from all dataverses using compound names like Default.users as described in DataverseSeparator. It is important to remember that these compound names must be quoted when used in queries, for example SELECT * FROM [Default.users]
- You may also set the Dataverse property to limit the the add-in to exposing a single dataverse. This disables compound names so view names will not include the dataset.
- When connecting to Couchbase 7 and above, the add-in will use the scope, collection and bucket/dataset name to build table and view names. For example, a table with a name like crm.accounts.customers exposes the customers collection under the accounts scope of the crm bucket. These must be quoted the same as other compound names when used in queries, for example SELECT * FROM [crm.accounts.customers]
Live Metadata
All of the schemas provided by the add-in are dynamically retrieved from Couchbase, so any changes in the buckets or fields within Couchbase will be reflected in the add-in the next time you connect.
You may also issue a reset query to refresh schemas without having to close the connection:
RESET SCHEMA CACHE