<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          schemabufMySQL 結(jié)構(gòu)轉(zhuǎn) protobuf 模型

          聯(lián)合創(chuàng)作 · 2023-09-28 12:47

          schemabuf 可以根據(jù) MySQL 的表結(jié)構(gòu)來生成 ProtocolBuffers 對(duì)應(yīng)的模型。

          使用方法:

          $ 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 語言調(diào)用:

          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)
              }
          }
          瀏覽 18
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          評(píng)論
          圖片
          表情
          推薦
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  www.久久精品视频 | 97AV电影| 成人看片 | 台湾在线视频一区二 | 18禁日韩 |