mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-17 04:24:35 +03:00
7638d1832a
GitOrigin-RevId: 8d479cbd056ee839b11ae24557085573b3e5b5ba
26 lines
477 B
Go
26 lines
477 B
Go
package seed
|
|
|
|
import (
|
|
"io"
|
|
|
|
"github.com/hasura/graphql-engine/cli/internal/hasura"
|
|
)
|
|
|
|
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}
|
|
}
|
|
|
|
func IsSeedsSupported(kind hasura.SourceKind) bool {
|
|
switch kind {
|
|
case hasura.SourceKindMSSQL, hasura.SourceKindPG:
|
|
return true
|
|
}
|
|
return false
|
|
}
|