Ready to get started?

Download a free trial of the Cosmos DB ODBC Driver to get started:

 Download Now

Learn more:

Cosmos DB Icon Cosmos DB ODBC Driver

The Cosmos DB ODBC Driver is a powerful tool that allows you to connect with live Cosmos DB document databases, directly from any applications that support ODBC connectivity.

Access Cosmos DB like you would a database - read, write, and update through a standard ODBC Driver interface.

Connect to Cosmos DB Data in DBeaver



Use the CData ODBC Driver to connect to Cosmos DB data in DBeaver.

The CData ODBC Driver for Cosmos DB enables access to live data from Cosmos DB under the ODBC standard, allowing you work with Cosmos DB data in a wide variety of BI, reporting, and ETL tools and directly, using familiar SQL queries. This article shows how to manage Cosmos DB data with visual tools in DBeaver like the query browser.

The CData ODBC drivers offer unmatched performance for interacting with live Cosmos DB data in DBeaver due to optimized data processing built into the driver. When you issue complex SQL queries from DBeaver to Cosmos DB, the driver pushes supported SQL operations, like filters and aggregations, directly to Cosmos DB and utilizes the embedded SQL engine to process unsupported operations (often SQL functions and JOIN operations) client-side. With built-in dynamic metadata querying, you can manage and analyze Cosmos DB data.

Connect to Cosmos DB

If you have not already done so, provide values for the required connection properties in the data source name (DSN). You can configure the DSN using the Microsoft ODBC Data Source Administrator. This is also the last step of the driver installation. See the "Getting Started" chapter in the Help documentation for a guide to using the Microsoft ODBC Data Source Administrator to create and configure a DSN.

To obtain the connection string needed to connect to a Cosmos DB account using the SQL API, log in to the Azure Portal, select Azure Cosmos DB, and select your account. In the Settings section, click Connection String and set the following values:

  • AccountEndpoint: The Cosmos DB account URL from the Keys blade of the Cosmos DB account
  • AccountKey: In the Azure portal, navigate to the Cosmos DB service and select your Azure Cosmos DB account. From the resource menu, go to the Keys page. Find the PRIMARY KEY value and set AccountKey to this value.

Finally, set the "Map To WVarchar connection property to False in the DSN Configuration window for the driver. This configuration will allow string types to be mapped to SQL_VARCHAR and prevent SQL_WVARCHAR types from being displayed as NULL.

Connecting to the Cosmos DB ODBC Data Source in DBeaver

  1. Open the DBeaver application and in the Database menu, select the New Database Connection option.
  2. In the 'Connect to a database' window, select ODBC and click Next.
  3. In the Database/Schema field, enter the DSN name (CData Cosmos DB Source by default). It will be automatically added to the JDBC URL as well.
  4. Click the Test Connection button. You should receive a 'Connected' message after DBeaver has detected the DSN, along with details about the driver if the connection is successful.

Query Cosmos DB Data

You can now query information from the tables exposed by the data source connection. You can expand the database structure in order to view all the tables. You can retrieve the table's data by right-clicking on a table name and selecting View data. The data will then be available in the Data tab.

Free Trial & More Information

At this point, you have connected to live Cosmos DB data from DBeaver. For more information, visit the CData ODBC Driver page. Download a free, 30-day trial and start working live Cosmos DB data DBeaver today.