Defining a Schema
Important:
In this documentation, "schema" refers to the special schema that the connector generates. This schema serves as a layer that translates the Couchbase data into an JDBC-compatible format, and it is distinct from the metadata schema that exists as part of the database architecture. For more information, see Schema Definition.
The Simba Couchbase JDBC Driver can sample data from a database and then generate the schema that is needed for JDBC applications.
When you connect to a Couchbase database that does not contain a schema, the connector automatically generates one. However, schemas that are generated in this way do not persist after the connection is closed, and the connector might generate different schemas during subsequent connections to the same database. These temporary schemas are mainly used to provide preliminary support for initial test connections and queries.
Note:
For information about configuring the settings that the connector uses when generating temporary schemas, see SampleSize and TypeNameList.
To ensure consistent support for your Couchbase data, use the connection properties provided by the connector create a schema in a local JSON file and then import the schema from the file into the database. You can configure the connector to load the schema directly from the JSON file, but typically it is recommended that you import the schema into the database; doing so enables all users who connect to the database to use the same schema.
For detailed information about defining schemas, see the following topics: