Giter VIP home page Giter VIP logo

golang_iris_xorm's Introduction

iris + xorm

  • iris 在 Golang Web Framework 号称 宇宙最快,堪比甄子丹。以简单,快速上手闻名。
  • xorm 是一个简单而强大的Go语言 ORM 库. 通过它可以使数据库操作非常简便。

相关、学习文档


依赖安装

go get -u github.com/kataras/iris
go get -u github.com/go-xorm/xorm
go get -u github.com/go-xorm/cmd/xorm 
go get -u github.com/go-sql-driver/mysql

5.其他

go get -u github.com/didip/tollbooth
go get -u github.com/iris-contrib/middleware/cors
go get -u github.com/dgrijalva/jwt-go

注:


翻转数据结构生成代码(go-xorm/cmd)

  • 项目根目录 templates 是从 GOPATH/src/cmd/xorm/ 目录下拷贝过来的

  • 修改 templates/goxorm/config

  lang=go
  genJson=1
  prefix=你的数据库的表前缀
  • 执行命令
  // 格式 xorm reverse mysql 用户名:密码@tcp(HOST:端口)/数据库名?charset=字符串编码 templates/goxorm
  xorm reverse mysql username:password@tcp\(127.0.0.1:3306\)/test_db?charset=utf8 template/goxorm

注:有些数据表生成失败,修改表注释的特殊字符(如 () ,半角修改成全角即可)

  • 将生成 models 文件夹移到 application 目录下(个人习惯问题)

golang_iris_xorm's People

Contributors

alexei007 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.