hasuradb

package
v1.0.0-alpha13 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2018 License: AGPL-3.0 Imports: 14 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	DefaultMigrationsTable = "schema_migrations"
	DefaultRole            = "admin"
	DefaultUserID          = "0"
	DefaultSchema          = "hdb_catalog"
	ACCESS_KEY_HEADER      = "X-Hasura-Access-Key"
)
View Source
const (
	TuplesOK  = "TuplesOk"
	CommandOK = "CommandOk"
)
View Source
const (
	DefaultSettingsTable = "migration_settings"
)

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 SingleJoiningSlash

func SingleJoiningSlash(a, b string) string

func WithInstance

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

Types

type Config

type Config struct {
	MigrationsTable string
	SettingsTable   string
	URL             *nurl.URL
	Role            string
	UserID          string
	// contains filtered or unexported fields
}

type HasuraArgs

type HasuraArgs struct {
	SQL       string        `json:"sql,omitempty" yaml:"sql"`
	Table     interface{}   `json:"table,omitempty"`
	Columns   interface{}   `json:"columns,omitempty"`
	Where     interface{}   `json:"where,omitempty"`
	OrderBy   interface{}   `json:"order_by,omitempty"`
	Objects   []interface{} `json:"objects,omitempty"`
	Limit     int           `json:"limit,omitempty"`
	Returning []string      `json:"returning,omitempty"`
	Set       interface{}   `json:"$set,omitempty"`
}

type HasuraBulk

type HasuraBulk struct {
	Type string        `json:"type" yaml:"type"`
	Args []HasuraQuery `json:"args" yaml:"args"`
}

type HasuraColumn

type HasuraColumn struct {
	Name    string      `json:"name"`
	Columns interface{} `json:"columns,omitempty"`
}

type HasuraDB

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

func (*HasuraDB) ApplyMetadata

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

func (*HasuraDB) Close

func (h *HasuraDB) Close() error

func (*HasuraDB) Drop

func (h *HasuraDB) Drop() error

func (*HasuraDB) ExportMetadata

func (h *HasuraDB) ExportMetadata() (interface{}, error)

func (*HasuraDB) First

func (h *HasuraDB) First() (version uint64, 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() (version uint64, ok bool)

func (*HasuraDB) Lock

func (h *HasuraDB) Lock() error

func (*HasuraDB) Next

func (h *HasuraDB) Next(version uint64) (nextVersion uint64, ok bool)

func (*HasuraDB) Open

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

func (*HasuraDB) Prev

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

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) Reset

func (h *HasuraDB) Reset() error

func (*HasuraDB) ResetMetadata

func (h *HasuraDB) ResetMetadata() error

func (*HasuraDB) ResetQuery

func (h *HasuraDB) ResetQuery()

func (*HasuraDB) Run

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

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 {
	// MigrationFile is used internally for hasuractl
	MigrationFile string            `json:"migrationFile,omitempty"`
	Path          string            `json:"path"`
	ErrorMessage  string            `json:"error"`
	Internal      *SQLInternalError `json:"internal,omitempty"`
	Message       string            `json:"message,omitempty"`
	Code          string            `json:"code"`
}

func (*HasuraError) APIError

func (h *HasuraError) APIError() error

func (*HasuraError) CMDError

func (h *HasuraError) CMDError() error

func (*HasuraError) Error

func (h *HasuraError) Error(isCMD bool) error

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"`
	Args interface{} `json:"args" yaml:"args"`
}

type HasuraOrderBy

type HasuraOrderBy struct {
	Column string `json:"column,omitempty"`
	Type   string `json:"type,omitempty"`
	Nulls  string `json:"nulls,omitempty"`
}

type HasuraQuery

type HasuraQuery struct {
	Type string     `json:"type" yaml:"type"`
	Args HasuraArgs `json:"args" yaml:"args"`
}

type HasuraSQLRes

type HasuraSQLRes struct {
	ResultType string     `json:"result_type"`
	Result     [][]string `json:"result"`
}

type PostgresError

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

type SQLInternalError

type SQLInternalError struct {
	Arguments []string      `json:"arguments"`
	Error     PostgresError `json:"error"`
	Prepared  bool          `json:"prepared"`
	Statement string        `json:"statement"`
}

Jump to

Keyboard shortcuts

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