-
Notifications
You must be signed in to change notification settings - Fork 2
/
interface.go
35 lines (30 loc) · 1.14 KB
/
interface.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package dorm
import (
"context"
"github.com/quanxiang-cloud/structor/internal/dorm/clause"
"github.com/quanxiang-cloud/structor/internal/dorm/structor"
)
// Dorm dorm
type Dorm interface {
Table(tablename string) Dorm
Where(expr clause.Expression) Dorm
Select(expr ...clause.Expression) Dorm
Limit(limit int64) Dorm
Offset(offset int64) Dorm
Order(order ...string) Dorm
FindOne(ctx context.Context) (map[string]interface{}, error)
Find(ctx context.Context) ([]map[string]interface{}, error)
Count(ctx context.Context) (int64, error)
Insert(ctx context.Context, entities ...interface{}) (int64, error)
Update(ctx context.Context, entity interface{}) (int64, error)
Delete(ctx context.Context) (int64, error)
}
type Dept interface {
Create(ctx context.Context, c structor.Constructor) error
Add(ctx context.Context, c structor.Constructor) error
Modify(ctx context.Context, c structor.Constructor) error
Primary(ctx context.Context, c structor.Constructor) error
Index(ctx context.Context, c structor.Constructor) error
Unique(ctx context.Context, c structor.Constructor) error
DropIndex(ctx context.Context, c structor.Constructor) error
}