DMDB is a native Node.js driver for the Dameng 8 (DM8) relational database, providing direct database connectivity and interaction. The current stable version is 1.0.48286 (as of March 2026), with a frequent release cadence, often monthly or bi-monthly, addressing bugs, performance, and new features. Key differentiators include its tight integration with the DM8 ecosystem, official support for Node.js versions 12 and above, and extensions for popular ORMs like TypeORM and Knex via `typeorm-dm` and `knex-dm` packages. The driver supports features like connection pooling, statement caching, and optional Snappy compression for internal communication. It also aims for compatibility with OracleDB-like API patterns, which is a significant aspect for developers migrating or working with similar database drivers.
npm install dmdbVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to establish a connection pool, obtain a connection, execute a simple `SELECT` query, perform an `INSERT` with bind parameters, and properly close connections and the pool. It also includes a basic table setup/teardown.
Update application code to process `outBinds` as column-grouped arrays. Review the `index.d.ts` for updated interface definitions.
Avoid using `getRowCount()`. If a row count is strictly necessary before iteration, consider using an aggregate query (e.g., `COUNT(*)`) instead or collecting all rows into an array first.
Explicitly specify the `'default'` alias when creating or retrieving connection pools, or ensure you use a consistent, named alias.
For backward compatibility, set the global configuration `dmdb.outBindFormat = dmdb.OUT_FORMAT_ARRAY` immediately after importing the driver. Otherwise, update your code to handle dynamic `outBinds` formats based on your bind parameter style.
Explicitly handle `NaN`, `Infinity`, and `-Infinity` values in your application logic. Convert them to `NULL` or other appropriate database-compatible values before binding if `NULL` is the desired behavior, or ensure they are not passed.
Review SQL statements and bind parameter definitions. If `DOUBLE` precision is explicitly required for integer-like numbers, specify the bind type explicitly. Otherwise, ensure your database schema and application can handle `BIGINT`.
If DMDB server-side compression is enabled, ensure either `snappy` (for performance) or `snappyjs` (for compatibility) is explicitly installed as a dependency in your project: `npm install snappy` or `npm install snappyjs`.
Remove any usage of `ExecuteOptions.outFormat` for controlling `outBinds`. Ensure your code expects `outBinds` to be an array, especially if you had adapted to the v1.0.31017 behavior.
Verify date and time handling in your application, especially if working with multiple time zones. Ensure your database and application explicitly handle time zone conversions as intended.
Upgrade to dmdb v1.0.48286 or later. Ensure your string lengths are within defined database column limits.
Upgrade to dmdb v1.0.45146 or later. Consider upgrading your Dameng database server if the issue persists with older versions.
Upgrade to dmdb v1.0.45146 or later. Avoid interleaved SQL execution or concurrent operations on `ResultSet` and `Lob` objects. Process one result set completely before executing other queries or operating on another `ResultSet`.
Ensure the number of bind parameters supplied in the `execute()` or `executeMany()` call exactly matches the number of placeholders (e.g., `:1`, `:2`, or `:name`) in your SQL statement.
Upgrade to dmdb v1.0.46190 or later. Ensure your database character set is correctly configured to handle multi-byte characters like emojis.