# go_sql **Repository Path**: chunbao12/go_sql ## Basic Information - **Project Name**: go_sql - **Description**: 生成SQL语句 - **Primary Language**: Go - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2019-12-11 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # go_sql #### 介绍 生成SQL语句 #### 软件架构 软件架构说明 #### 安装教程 1. xxxx 2. xxxx 3. xxxx #### 使用说明 1. 查询语句构建 - 1.查询一条 -dg := db.GetBuilderMysql() -sql := dg.Name("table").Where("id=1").Find() - 2.查询多条 - dg := db.GetBuilderMysql() - sql := dg.Name("table").Where("name='value'").Select() - 3.连接查询 - dg := db.GetBuilderMysql() - sql := dg.Name("table alia"). Where("alia.name='value'"). Join("table2 t2","t2.id=alia.t2id","left"). Field("alia.*","t2.name as t2_name"). Select() 2. 所有的方法 - Name(table string) 设置表名称 - Where(str string) 设置条件 - WhereOr(cond string) 设置条件 - WhereIn(vars ...interface{}) 设置条件 - WhereNotIn(vars ...interface{}) 设置条件 - Field(fields ...string) 设置字段 - Order(field string, by string) 设置排序 - Join(table string, on string, cond string) 连接 - Page(page int64, limit int64) 分页查询 - Insert(maps map[string]interface{}) 插入 - Update(maps map[string]interface{}) 更新 - Delete() 删除 - Count() 获取总数 - Select() 获取多条查询 - Find() 查询一条 3. xxxx #### 参与贡献 1. Fork 本仓库 2. 新建 Feat_xxx 分支 3. 提交代码 4. 新建 Pull Request