Registry / database / mdb-to-sql

mdb-to-sql

JSON →
library1.0.1jsnpmunverified

A lightweight Node.js CLI tool (v1.0.1) for converting Microsoft Access .mdb files (Access 97–2003) into portable SQL dumps. It has no system dependencies (no ODBC, no Java, no mdb-tools), works cross-platform (macOS, Linux, Windows), and outputs SQL with CREATE TABLE IF NOT EXISTS and batch INSERT statements. The tool is ideal for migrating legacy Access databases to modern SQL-based systems and is easily integrated into CI/CD pipelines via explicit exit codes (0, 1, 2, 3).

npm install mdb-to-sql
INSTALL
IMPORT
SIG · MDB-TO-SQL
M
mdb-to-sql
databasejavascriptv1.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

run
npx mdb-to-sql ./path/to/file.mdb
mdb-to-sql ./path/to/file.mdb
CLI is intended to be run via npx or global install; not a programmatic API. No JavaScript/TypeScript import available.
mdb-to-sql (CLI)
mdb-to-sql ./path/to/file.mdb
mdb-to-sql --input ./path/to/file.mdb
The CLI expects a single positional argument; no --input flag.
Usage (programmatic)
Do not use require or import; the package exports no programmatic symbols.
const convert = require('mdb-to-sql')
The package is CLI-only; any attempt to import it programmatically will fail or be undefined.

Run the CLI via npx to convert an .mdb file to a .sql file in the same directory.

npx mdb-to-sql ./path/to/database.mdb
Debug
Known issues
gotchaOnly .mdb files (Access 97–2003) are supported; .accdb (Access 2007+) will be rejected.
fix
Convert .accdb to .mdb using Microsoft Access or another tool first.
affects: >=1.0.0
gotchaThe output SQL uses backticks for identifiers, which is MySQL/MariaDB specific. Not compatible with PostgreSQL or SQL Server without modification.
fix
Manually replace backticks with double quotes for PostgreSQL or square brackets for SQL Server.
affects: >=1.0.0
gotchaType mapping is limited: Access types like Currency, Date/Time, OLE Object, and Yes/No may be converted to TEXT or INTEGER, potentially losing precision or semantics.
fix
Review and adjust the generated SQL for non-standard types after conversion.
affects: >=1.0.0
breakingNode.js version <16 is not supported; the package uses features available only in Node 16+.
fix
Upgrade Node.js to version 16 or higher.
affects: >=1.0.0
Errors
Common errors & fixes
Error: File not found: ./does-not-exist.mdb
File path is invalid or the .mdb file does not exist.
fix
Verify the file path and ensure the file exists. Use an absolute path if necessary.
Error: Only .mdb files are supported in this version.
Provided file has an extension other than .mdb (e.g., .accdb, .sql, .csv).
fix
Supply a file with .mdb extension. Convert .accdb to .mdb first.
Usage: mdb-to-sql <path-to-file.mdb>
No command-line argument provided.
fix
Pass the path to the .mdb file as the first argument: mdb-to-sql ./path/to/file.mdb
Upgrade
Version history
1.0.1latest on npm
Audit
Dependencies
noderequiredRuntime required; version >=16
Agent activity
4 hits · last 30 days
node
4
Resources
mdb-to-sql — npm install mdb-to-sql · libregistry