Registry / storage / mysql-protobuf

mysql-protobuf

JSON →
library1.0.16jsnpmunverified

CLI and Node.js tool to convert MySQL CREATE TABLE statements to Protocol Buffers .proto files. Current stable version 1.0.16, maintained but low release cadence (last update 2018). No differentiators as a straightforward single-purpose converter; alternatives exist as part of larger schema conversion suites.

npm install mysql-protobuf
INSTALL
IMPORT
SIG · MYSQL-PROTOBUF
M
mysql-protobuf
storagejavascriptv1.0.16
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.

default
const convert = require('mysql-protobuf')
import convert from 'mysql-protobuf'
Package is CommonJS only, no ESM export. Use require or dynamic import.

Converts a SQL CREATE TABLE string to a .proto message definition.

const fs = require('fs'); const convert = require('mysql-protobuf'); const sql = `CREATE TABLE users ( id INT, name VARCHAR(255) );`; const proto = convert(sql); console.log(proto); // Output: // syntax = "proto3"; // message users { // int32 id = 1; // string name = 2; // }
Debug
Known issues
gotchaOnly supports basic column types: INT, VARCHAR, TEXT, BIGINT, etc. Custom types or unsigned attributes may not convert correctly.
fix
Manually edit generated proto to handle unsupported types.
affects: >=1.0.0
deprecatedPackage not updated since 2018. No support for newer Protocol Buffers features (e.g., map, oneof, proto3 optional).
fix
Consider alternative tools like sql-to-proto or manual conversion.
affects: <=1.0.16
Errors
Common errors & fixes
Error: Cannot find module 'mysql-protobuf'
Global install not in PATH or missing local node_modules.
fix
Install locally: `npm install mysql-protobuf` and use relative path.
TypeError: convert is not a function
Wrong import style with ESM import instead of CommonJS require.
fix
Use `const convert = require('mysql-protobuf')`
Upgrade
Version history
1.0.16latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
15 hits · last 30 days
node
14
Amazon
1
Resources
mysql-protobuf — npm install mysql-protobuf · libregistry