import ( . "github.com/doytowin/goooqo")typeUserEntitystruct {Int64Id Name *string`json:"name,omitempty"` Score *int`json:"score,omitempty"` Memo *string`json:"memo,omitempty"`}func (u UserEntity) GetTableName() string {return"t_user"}
packagecoretypeEntityinterface {GetId() any// SetId set id to self.// self: the pointer points to the current entity.// id: type could be int, int64, or string so far.SetId(self any, id any) error}packagerdbimport"github.com/doytowin/goooqo/core"typeRdbEntityinterface {core.EntityGetTableName() string}
SELECT id, name, score, memo FROM t_user;INSERT INTO t_user (name, score, memo) VALUES (?, ?, ?)UPDATE t_user SETname= ?, score = ?, memo = ? WHERE id = ?;DELETEFROM t_user WHERE id = ?;