51 lines
745 B
Go
51 lines
745 B
Go
package sdbc
|
|
|
|
import (
|
|
"reflect"
|
|
|
|
"google.golang.org/protobuf/proto"
|
|
)
|
|
|
|
// model props for protobuf Message
|
|
type model struct {
|
|
Type proto.Message // model prototype
|
|
modelKind reflect.Type // model low level type
|
|
modelName string // model struct name
|
|
tableName string // model mapping table name
|
|
}
|
|
|
|
type scope struct {
|
|
*model
|
|
*sdbc
|
|
}
|
|
|
|
func (s *scope) Insert() *insert {
|
|
return &insert{
|
|
scope: s,
|
|
sdbc: s.sdbc,
|
|
}
|
|
|
|
}
|
|
|
|
func (s *scope) Find() {
|
|
//TODO implement me
|
|
panic("implement me")
|
|
}
|
|
|
|
func (s *scope) Update() {
|
|
//TODO implement me
|
|
panic("implement me")
|
|
}
|
|
|
|
func (s *scope) Delete() {
|
|
//TODO implement me
|
|
panic("implement me")
|
|
}
|
|
|
|
type Operator interface {
|
|
Insert() *insert
|
|
Find()
|
|
Update()
|
|
Delete()
|
|
}
|