Virtual Tables

Virtual tables provide support for arrays. Each virtual table contains the data from one array, and each row in the table represents an element from the array. If an element contains an array, then the connector creates additional virtual tables as needed to expand the nested data.

In each virtual table, the connector creates a primary key column named PK that identifies the document that the array comes from and references the PK column from the related base table. The connector also creates an index column (with the suffix _idx in its name) to indicate the position of the element within the array.

In the ODBC layer, the name of the virtual table is formed using the document type that contains the array, an underscore character (_), and the name of the array. In the Couchbase layer, the name of the virtual table is formed using the name of the bucket that the data comes from, a period (.), and then the name of the array followed a set of closed square brackets ([ ]) for each hierarchy level in which the array is nested.