-
-
Notifications
You must be signed in to change notification settings - Fork 246
/
dialect.go
48 lines (41 loc) · 999 Bytes
/
dialect.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
36
37
38
39
40
41
42
43
44
45
46
47
48
package pop
import (
"io"
"github.com/gobuffalo/fizz"
"github.com/gobuffalo/pop/v6/columns"
)
type crudable interface {
SelectOne(*Connection, *Model, Query) error
SelectMany(*Connection, *Model, Query) error
Create(*Connection, *Model, columns.Columns) error
Update(*Connection, *Model, columns.Columns) error
UpdateQuery(*Connection, *Model, columns.Columns, Query) (int64, error)
Destroy(*Connection, *Model) error
Delete(*Connection, *Model, Query) error
}
type fizzable interface {
FizzTranslator() fizz.Translator
}
type quotable interface {
Quote(key string) string
}
type dialect interface {
crudable
fizzable
quotable
Name() string
DefaultDriver() string
URL() string
MigrationURL() string
Details() *ConnectionDetails
TranslateSQL(string) string
CreateDB() error
DropDB() error
DumpSchema(io.Writer) error
LoadSchema(io.Reader) error
Lock(func() error) error
TruncateAll(*Connection) error
}
type afterOpenable interface {
AfterOpen(*Connection) error
}