Entity Object
Last updated
package core
type Entity interface {
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
}
package rdb
import "github.com/doytowin/goooqo/core"
type RdbEntity interface {
core.Entity
GetTableName() string
}SELECT id, name, score, memo FROM t_user;
INSERT INTO t_user (name, score, memo) VALUES (?, ?, ?)
UPDATE t_user SET name = ?, score = ?, memo = ? WHERE id = ?;
DELETE FROM t_user WHERE id = ?;