forked from gobuffalo/pop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dialect.go
46 lines (39 loc) · 854 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
package pop
import (
"io"
"github.com/gobuffalo/fizz"
"github.com/gobuffalo/pop/v5/columns"
)
type crudable interface {
SelectOne(store, *Model, Query) error
SelectMany(store, *Model, Query) error
Create(store, *Model, columns.Columns) error
Update(store, *Model, columns.Columns) error
Destroy(store, *Model) 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
}