-
Notifications
You must be signed in to change notification settings - Fork 2.7k
/
sourceops.go
58 lines (43 loc) · 1.75 KB
/
sourceops.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
49
50
51
52
53
54
55
56
57
58
package hasura
const (
CommandOK RunSQLResultType = "CommandOk"
TuplesOK RunSQLResultType = "TuplesOk"
)
type RunSQLResultType string
type PGSourceOps interface {
PGRunSQL(input PGRunSQLInput) (response *PGRunSQLOutput, err error)
}
type PGRunSQLInput struct {
SQL string `json:"sql" yaml:"sql"`
Source string `json:"source,omitempty" yaml:"source,omitempty"`
Cascade bool `json:"cascade,omitempty" yaml:"cascade,omitempty"`
ReadOnly bool `json:"read_only,omitempty" yaml:"read_only,omitempty"`
CheckMetadataConsistency *bool `json:"check_metadata_consistency,omitempty" yaml:"check_metadata_consistency,omitempty"`
}
type PGRunSQLOutput struct {
ResultType RunSQLResultType `json:"result_type" yaml:"result_type"`
Result [][]string `json:"result" yaml:"result"`
}
type MSSQLSourceOps interface {
MSSQLRunSQL(input MSSQLRunSQLInput) (response *MSSQLRunSQLOutput, err error)
}
type MSSQLRunSQLInput PGRunSQLInput
type MSSQLRunSQLOutput struct {
ResultType RunSQLResultType `json:"result_type" yaml:"result_type"`
Result [][]interface{} `json:"result" yaml:"result"`
}
type CitusSourceOps interface {
CitusRunSQL(input CitusRunSQLInput) (response *CitusRunSQLOutput, err error)
}
type CitusRunSQLInput PGRunSQLInput
type CitusRunSQLOutput PGRunSQLOutput
type BigQuerySourceOps interface {
BigQueryRunSQL(input BigQueryRunSQLInput) (response *BigQueryRunSQLOutput, err error)
}
type BigQueryRunSQLInput PGRunSQLInput
type BigQueryRunSQLOutput PGRunSQLOutput
type CockroachSourceOps interface {
CockroachRunSQL(input CockroachRunSQLInput) (response *CockroachRunSQLOutput, err error)
}
type CockroachRunSQLInput PGRunSQLInput
type CockroachRunSQLOutput PGRunSQLOutput