Skip to content
 
 

Latest commit

 

History

41 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mysql-protobuf

每次将数据库映射为 protobuf,是一项繁重有重复的工作

这是一个快速将 sql schema 转化为 protobuf 的 cli 工具

安装

npm install mysql-protobuf -g

CLI usage Example

$ mysql-protobuf [input-file]

$ mysql-protobuf schema.sql > schema.proto


  ----- print -----
  syntax = "proto3";

  message core {
    int32 uid = 1;
    int32 cid = 2;
    int32 no = 3;
    string nickname = 4;
  }

JS usage

var convert = require('mysql-protobuf')
var file = fs.readFileSync('schema.sql').toString()
console.log(convert(file))

npm publish

About

Convert a MySQL CREATE TABLE statement into a protobuf schema.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages