2021-04-01 13:38:55 +03:00
|
|
|
package seed
|
|
|
|
|
|
|
|
import (
|
|
|
|
"io"
|
|
|
|
|
2021-06-16 14:44:15 +03:00
|
|
|
"github.com/hasura/graphql-engine/cli/v2/internal/hasura"
|
2021-04-01 13:38:55 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
type sendBulk func([]hasura.RequestBody) (io.Reader, error)
|
|
|
|
type Driver struct {
|
|
|
|
SendBulk sendBulk
|
|
|
|
PGDumpClient hasura.PGDump
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewDriver(s sendBulk, pgDumpClient hasura.PGDump) *Driver {
|
|
|
|
return &Driver{s, pgDumpClient}
|
|
|
|
}
|
2021-04-19 10:05:21 +03:00
|
|
|
|
|
|
|
func IsSeedsSupported(kind hasura.SourceKind) bool {
|
|
|
|
switch kind {
|
2021-06-21 17:34:10 +03:00
|
|
|
case hasura.SourceKindMSSQL, hasura.SourceKindPG, hasura.SourceKindCitus:
|
2021-04-19 10:05:21 +03:00
|
|
|
return true
|
|
|
|
}
|
|
|
|
return false
|
|
|
|
}
|