# Database support | Database / mechanism | Status | Mechanism and notes | | --- | --- | --- | | PostgreSQL | Supported | Native `pg` adapter; `information_schema`/`pg_catalog` introspection, pooled connections, server-side query cursor behavior, and `EXPLAIN (FORMAT JSON)`. | | MySQL | Supported | Native `mysql2/promise` adapter; MySQL metadata queries, pooled connections, and `EXPLAIN FORMAT=JSON`. | | MariaDB | Supported | Uses the MySQL wire-compatible `mysql2/promise` adapter. Server/version-specific SQL or metadata differences can limit introspection. | | SQL Server | Supported | Native `mssql`/Tedious adapter; metadata queries and `SET SHOWPLAN_XML ON` in an isolated transaction for plans. | | Oracle | Supported | Native `oracledb` thin-mode adapter; Oracle metadata and `EXPLAIN PLAN` with available row, byte, cost, time estimates, and predicates. No Oracle Instant Client is required for thin mode. | | SQLite | Supported | Built-in `node:sqlite` (no extra driver); opens an existing local file, introspects `main` and attached databases, `EXPLAIN QUERY PLAN`, read-only connection for safe reads. See [SQLite](#sqlite). | | Generic JDBC | Experimental | JVM sidecar loads a user-provided driver JAR and `java.sql.Driver` class, then connects through the supplied JDBC URL. | | ODBC | Experimental | Generic ODBC adapter with bounded query and stream support. Requires a separately installed 64-bit driver compatible with the target database. | | MongoDB | Native + read-only SQL | Extended JSON `find`/`aggregate`, explicit writes, metadata, autocomplete, and `/mongo` SELECT conversion. SQL mode executes supported SELECTs natively, with DuckDB for complex queries. See [MongoDB usage](MONGODB.md). | ## SQLite Choose **SQLite** and pick the database file. The path must be absolute and the file must already exist: Omni SQL never creates an empty database because of a typo. `:memory:` is accepted for scratch work. There are no credentials. Tick **Open read-only** to block every write through that connection. - Schemas are the attached databases: `main` plus any `ATTACH`ed file; `temp` is skipped. Built-in functions are listed once, under `main`. - Metadata comes from `sqlite_schema` and the `table_xinfo`, `foreign_key_list`, `index_list` and `index_info` pragmas. `REFERENCES parent` without a column resolves to the parent's primary key. An `INTEGER PRIMARY KEY` (rowid alias) is shown as a primary-key index even though SQLite stores no separate index. - Plans use `EXPLAIN QUERY PLAN`, rendered as a tree. Validation compiles the statement without running it. Table definitions include indexes and triggers. - Integers beyond JavaScript's safe range arrive as decimal strings; BLOBs as `0x…` hex. Expression columns report the storage class of the first non-null value (`integer`, `real`, `text`, `blob`). - MCP read-only SQL runs on a second connection opened read-only, which a `PRAGMA` cannot turn writable. - The driver is synchronous: a long query blocks the backend until it finishes and cannot be cancelled. Streaming for local analysis checks for cancellation between batches. Loadable extensions are disabled. - `ALTER TABLE` in SQLite cannot change a column's type, nullability, default or the primary key; the table editor emits a comment asking you to rebuild the table for those changes. ## Generic JDBC Configure the JDBC connection with: - `endpoint`: JDBC URL; - `options.jarPath`: filesystem path to the driver JAR; - `options.driverClassName`: class implementing `java.sql.Driver`; - username and password as normal connection credentials. The JVM sidecar loads the JAR dynamically and keeps connections in memory. It uses standard `DatabaseMetaData` for schemas, tables, views, columns, and best-effort primary-key flags. Drivers without schemas use a `default` bucket. Queries are capped at 10,000 rows and use driver-dependent fetch/max-row settings. Values outside JSON primitives are stringified; byte arrays are Base64 encoded. `BigDecimal`, `BigInteger`, and integers beyond JavaScript's safe range are transported as decimal strings. H2/JDBC streaming has integration coverage; other vendor drivers need separate validation. Limitations are intentional because JDBC drivers differ: - `EXPLAIN` is unsupported; JDBC has no portable plan syntax. - `getDefinition` is unsupported; there is no portable CREATE-text query. - Functions, indexes, foreign keys, and defaults are not exposed reliably by arbitrary drivers. - Primary-key discovery is best effort and may be unavailable. - Driver-specific SQL, authentication, TLS, transactions, type conversion, and metadata quality remain the responsibility of the selected driver. - A missing JAR, invalid driver class, rejected URL, credentials error, or network error is reported by the sidecar; it is not silently converted into native-driver behavior. Native adapters should be preferred when available because they provide dialect-specific introspection and explain support. ## ODBC Configure the connection with a DSN or ODBC connection string, plus username and password when required. Install a 64-bit ODBC driver for the target database separately; the driver manager alone does not provide a database driver. The adapter discovers tables, views, columns, and best-effort primary keys through the driver's metadata APIs. It supports bounded query results and streaming for local analysis. SQL syntax, authentication, TLS, metadata quality, and type conversion depend on the selected driver. Execution plans, indexes, object definitions, functions, and result-grid row edits/inserts are not currently supported. For analytical streaming, date/time or numeric values whose precision cannot be preserved must be cast to text in the source SQL; otherwise the import fails explicitly. See the [local analysis guide](LOCAL-ANALYSIS.md) for import behavior.