hasuradb

package
v2.30.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 21, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultDatabaseName = "default"
)

Variables

View Source
var (
	ErrNilConfig      = fmt.Errorf("no config")
	ErrNoDatabaseName = fmt.Errorf("no database name")
	ErrNoSchema       = fmt.Errorf("no schema")
	ErrDatabaseDirty  = fmt.Errorf("database is dirty")
)

Functions

func NewHasuraError

func NewHasuraError(data []byte, isCmd bool) error

NewHasuraError - returns error based on data and isCmd

func WithInstance

func WithInstance(config *Config, logger *log.Logger, hasuraOpts *database.HasuraOpts) (database.Driver, error)

Types

type Config

type Config struct {
	MigrationsTable string
	SettingsTable   string

	Headers map[string]string
	// contains filtered or unexported fields
}

type HasuraDB

type HasuraDB struct {
	// contains filtered or unexported fields
}

func (*HasuraDB) Close

func (h *HasuraDB) Close() error

func (*HasuraDB) Drop

func (h *HasuraDB) Drop() error

func (*HasuraDB) EnableCheckMetadataConsistency

func (h *HasuraDB) EnableCheckMetadataConsistency(enabled bool)

func (*HasuraDB) ExportSchemaDump

func (h *HasuraDB) ExportSchemaDump(includeSchemas []string, excludeSchemas []string, sourceName string, sourceKind hasura.SourceKind) ([]byte, error)

func (*HasuraDB) First

func (h *HasuraDB) First() (migrationVersion *database.MigrationVersion, ok bool)

func (*HasuraDB) GetSetting

func (h *HasuraDB) GetSetting(name string) (value string, err error)

func (*HasuraDB) InsertVersion

func (h *HasuraDB) InsertVersion(version int64) error

func (*HasuraDB) Last

func (h *HasuraDB) Last() (*database.MigrationVersion, bool)

func (*HasuraDB) Lock

func (h *HasuraDB) Lock() error

func (*HasuraDB) Next

func (h *HasuraDB) Next(version uint64) (migrationVersion *database.MigrationVersion, ok bool)

func (*HasuraDB) Open

func (h *HasuraDB) Open(url string, isCMD bool, logger *log.Logger, hasuraOpts *database.HasuraOpts) (database.Driver, error)

func (*HasuraDB) Prev

func (h *HasuraDB) Prev(version uint64) (prevVersion *database.MigrationVersion, ok bool)

func (*HasuraDB) PushToList

func (h *HasuraDB) PushToList(migration io.Reader, fileType string, l *database.CustomList) error

func (*HasuraDB) Query

func (h *HasuraDB) Query(data interface{}) error

func (*HasuraDB) Read

func (h *HasuraDB) Read(version uint64) (ok bool)

func (*HasuraDB) RemoveVersion

func (h *HasuraDB) RemoveVersion(version int64) error

func (*HasuraDB) ResetQuery

func (h *HasuraDB) ResetQuery()

func (*HasuraDB) Run

func (h *HasuraDB) Run(migration io.Reader, fileType, fileName string) error

func (*HasuraDB) Scan

func (h *HasuraDB) Scan() error

func (*HasuraDB) SetVersion

func (h *HasuraDB) SetVersion(version int64, dirty bool) error

func (*HasuraDB) Squash

func (h *HasuraDB) Squash(l *database.CustomList, ret chan<- interface{})

func (*HasuraDB) UnLock

func (h *HasuraDB) UnLock() error

func (*HasuraDB) UpdateSetting

func (h *HasuraDB) UpdateSetting(name string, value string) error

func (*HasuraDB) Version

func (h *HasuraDB) Version() (version int64, dirty bool, err error)

type HasuraError

type HasuraError struct {
	Path         string      `json:"path"`
	ErrorMessage string      `json:"error"`
	Internal     interface{} `json:"internal,omitempty"`
	Message      string      `json:"message,omitempty"`
	Code         string      `json:"code"`
	// contains filtered or unexported fields
}

func (HasuraError) Error

func (h HasuraError) Error() string

type HasuraInterfaceBulk

type HasuraInterfaceBulk struct {
	Type string        `json:"type" yaml:"type"`
	Args []interface{} `json:"args" yaml:"args"`
}

func (*HasuraInterfaceBulk) ResetArgs

func (h *HasuraInterfaceBulk) ResetArgs()

type HasuraInterfaceQuery

type HasuraInterfaceQuery struct {
	Type    string      `json:"type" yaml:"type"`
	Version int         `json:"version,omitempty" yaml:"version,omitempty"`
	Source  string      `json:"source,omitempty" yaml:"source,omitempty"`
	Args    interface{} `json:"args" yaml:"args"`
}

type InconsistentMetadataError

type InconsistentMetadataError struct {
	Definition interface{} `json:"definition,omitempty" mapstructure:"definition,omitempty"`
	Reason     string      `json:"reason,omitempty" mapstructure:"reason,omitempty"`
	Type       string      `json:"type,omitempty" mapstructure:"type,omitempty"`
}

func (*InconsistentMetadataError) String

func (mderror *InconsistentMetadataError) String() string

type PostgresError

type PostgresError struct {
	StatusCode  string `json:"status_code" mapstructure:"status_code,omitempty"`
	ExecStatus  string `json:"exec_status" mapstructure:"exec_status,omitempty"`
	Message     string `json:"message" mapstructure:"message,omitempty"`
	Description string `json:"description" mapstructure:"description,omitempty"`
	Hint        string `json:"hint" mapstructure:"hint,omitempty"`
}

type SQLInternalError

type SQLInternalError struct {
	Arguments                 []string       `json:"arguments" mapstructure:"arguments,omitempty"`
	Error                     *PostgresError `json:"error" mapstructure:"error,omitempty"`
	Prepared                  bool           `json:"prepared" mapstructure:"prepared,omitempty"`
	Statement                 string         `json:"statement" mapstructure:"statement,omitempty"`
	InconsistentMetadataError `mapstructure:",squash"`
}

type SchemaDump

type SchemaDump struct {
	Opts        []string `json:"opts"`
	CleanOutput bool     `json:"clean_output"`
	Database    string   `json:"source,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL