MySQL 结构转 protobuf 模型 schemabuf

码农软件 · 软件分类 · 常用工具包 · 2019-08-14 17:41:30

软件介绍

schemabuf 可以根据 MySQL 的表结构来生成 ProtocolBuffers 对应的模型。

使用方法:

$ schemabuf -h

Usage of schemabuf:
  -db string
        the database type (default "mysql")
  -host string
        the database host (default "localhost")
  -password string
        the database password (default "root")
  -port int
        the database port (default 3306)
  -schema string
        the database schema (default "db_name")
  -user string
        the database user (default "root")

Go 语言调用:

import "github.com/mcos/schemabuf"

func main() {
    connStr := config.get("dbConnStr")

    db, err := sql.Open(*dbType, connStr)
    if err != nil {
        log.Fatal(err)
    }

    defer db.Close()

    s, err := schemabuf.GenerateSchema(db)

    if nil != err {
        log.Fatal(err)
    }

    if nil != s {
        fmt.Println(s)
    }
}

本文地址:https://codercto.com/soft/d/12363.html

人月神话

人月神话

弗雷德里克.布鲁克斯 / UMLChina翻译组、汪颖 / 清华大学出版社 / 2007-9 / 48.00元

在软件领域,很少能有像《人月神话》一样具有深远影响力和畅销不衰的著作。Brooks博士为人们管理复杂项目提供了最具洞察力的见解,既有很多发人深省的观点,又有大量软件工程的实践。本书内容来自Brooks博士在IBM公司SYSTEM/360家族和OS/360中的项目管理经验,该项目堪称软件开发项目管理的典范。该书英文原版一经面世,即引起业内人士的强烈反响,后又译为德、法、日、俄、中、韩等多种文字,全球......一起来看看 《人月神话》 这本书的介绍吧!

在线进制转换器
在线进制转换器

各进制数互转换器

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

html转js在线工具
html转js在线工具

html转js在线工具