{"repo":"mei-rune/GoBatis","free":true,"listed":false,"github":"https://github.com/mei-rune/GoBatis","clone":"git clone https://github.com/mei-rune/GoBatis.git","description":"An easy ORM tool for Golang, support MyBatis-Like XML template SQL","language":"Go","stars":117,"topics":["golang","mybatis","orm","orm-framework"],"license":null,"category":"databases-storage","readme_excerpt":"GoBatis 中文文档 Introduction An easy ORM tool for Golang, support MyBatis-Like XML template SQL 待完成的任务 1. 对象继承的实现 2. 延迟加载或加密字段(或特殊处理)的实现 有泛型了，可以尝试下 go type Results[T any] struct {} func (rs Results) Next() bool {} func (rs Results) Read(value T) error {} go //go:generate gobatis user.go package example import ( \"time\" ) type AuthUser struct { ID int64 json:\"id\" Username string json:\"username\" Phone string json:\"phone\" Address string json:\"address\" Status uint8 json:\"status\" BirthDay time.Time json:\"birth day\" CreatedAt time.Time json:\"created at\" UpdatedAt time.Time json:\"updated at\" } type UserDao interface { // @postgres insert into auth users(username, phone, address, status, birth day, created at, updated at) // values (#{username},#{phone},#{address},#{status},#{birth day},CURRENT TIMESTAMP, CURRENT TIMESTAMP) returning id // // @default insert into auth users(username, phone, address, status, birth day, created at, updated at) // values (#{username},#{phone},#{address},#{status},#{birth day},CURRENT TIMESTAMP, CURRENT TIMESTAMP) Insert(u AuthUser) (int64, error) } go // Please don't edit this file! package example import ( \"errors\" gobatis \"github.com/runner-mei/GoBatis\" ) func init() { gobatis.Init(func(ctx gobatis.InitContext) error { { //// UserDao.Insert if , exists := ctx.Statements[\"UserDao.Insert\"]; !exists { sqlStr := \"insert into auth users(username, phone, address, status, birth day, created at, updated at)\\r\\n values (#{username},#{phone},#{address},#{status},#{","default_branch":null,"files":null,"tree":[],"storefront":"/r/mei-rune","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/mei-rune/GoBatis/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}