Skip to content

cute-angelia/mysql-protobuf

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%