Metabase drivers allow you to connect to different databases. Each driver is packaged as a JAR plugin that implements the driver interface. This guide will help you build a driver from scratch.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/metabase/metabase/llms.txt
Use this file to discover all available pages before exploring further.
Before you start
Before building a new driver:Check if a driver already exists
Review the officially supported databases and community drivers to see if one already exists.
Set up your development environment
Follow the development environment setup guide to get Metabase running locally.
Learn about the driver architecture
Understand the driver interface and how drivers work in Metabase.
Having an in-depth understanding of Clojure is less important for JDBC-based drivers, but you should understand multimethods.
Driver basics
A Metabase driver:- Provides database information - Connection properties, capabilities, and features
- Introspects database schema - Discovers tables, columns, and relationships
- Compiles MBQL queries - Converts visual queries to native SQL/queries
- Executes queries - Runs native queries and returns results
Driver structure
Drivers are organized as modules in/modules/drivers/ (for built-in drivers) or as standalone projects:
Key files
deps.edn - Dependencies
deps.edn - Dependencies
Defines your driver’s dependencies, including JDBC drivers or database client libraries:
metabase-plugin.yaml - Plugin manifest
metabase-plugin.yaml - Plugin manifest
Declares driver metadata, connection properties, and initialization steps:
mydriver.clj - Driver implementation
mydriver.clj - Driver implementation
Implements driver methods using Clojure multimethods:
Building a JDBC driver
Most SQL databases can use JDBC, which simplifies driver development.Step 1: Create the plugin manifest
Createresources/metabase-plugin.yaml:
Step 2: Implement the driver
Createsrc/metabase/driver/sqlite.clj:
Step 3: Define dependencies
Createdeps.edn:
Step 4: Build the driver
Build your driver JAR:modules/drivers/sqlite/target/uberjar/sqlite.metabase-driver.jar.
Step 5: Install and test
Copy the JAR to your Metabase plugins directory:Parent drivers
Parent drivers provide common functionality to reduce code duplication::sql-jdbc parent
Most SQL databases with JDBC support should use :sql-jdbc as parent:
- Connection management
- Query execution
- Transaction handling
- Basic sync functionality
:sql parent
For SQL databases without JDBC (like BigQuery):
Multiple parents
Drivers can have multiple parents:Common driver methods
Here are the most commonly implemented driver methods:Driver capabilities
Declare what your database supports:Connection properties
Define connection properties in your manifest:Testing your driver
Create driver tests intest/metabase/driver/mydriver_test.clj:
test/metabase/test/data/mydriver.clj:
Building non-JDBC drivers
For databases without JDBC support (MongoDB, BigQuery, etc.):- Use
:sqlas parent (if SQL-like) or no parent - Implement query execution:
- Implement sync methods for schema introspection
Building the driver JAR
For modules in the Metabase repo
For standalone projects
Use the Clojure CLI:Example drivers
Learn from existing drivers:- SQLite driver - Simple JDBC driver
- PostgreSQL driver - Full-featured JDBC driver
- MongoDB driver - Non-JDBC driver
- Sample driver - Minimal example
- Sudoku driver - Fun example
Publishing your driver
To share your driver with the community:- Create a GitHub repository with your driver code
- Release JAR files in GitHub Releases
- Document installation in your README
- Add to community drivers by submitting a PR to add your driver to the community drivers list
Community drivers are not supported on Metabase Cloud.
Driver development announcements
Stay informed about driver-related changes:- Subscribe to the Metabase Community Authors mailing list
- Watch the Driver Interface Changelog
Next steps
- Learn about the driver interface in detail
- Review community drivers for examples
- Join the Discourse community to ask questions