Documentation ¶
Index ¶
- Constants
- Variables
- func NewHasuraError(data []byte, isCmd bool) error
- func WithInstance(config *Config, logger *log.Logger, hasuraOpts *database.HasuraOpts) (database.Driver, error)
- type Config
- type CustomQuery
- func (q CustomQuery) MergeActionPermissions(squashList *database.CustomList) error
- func (q CustomQuery) MergeActions(squashList *database.CustomList) error
- func (q CustomQuery) MergeAllowLists(squashList *database.CustomList) error
- func (q CustomQuery) MergeComputedFields(squashList *database.CustomList) error
- func (q CustomQuery) MergeCronTriggers(squashList *database.CustomList) error
- func (q CustomQuery) MergeCustomTypes(squashList *database.CustomList) error
- func (q CustomQuery) MergeEventTriggers(squashList *database.CustomList) error
- func (q CustomQuery) MergeFunctions(squashList *database.CustomList) error
- func (q CustomQuery) MergePermissions(squashList *database.CustomList) error
- func (q CustomQuery) MergeQueryCollections(squashList *database.CustomList) error
- func (q CustomQuery) MergeQueryInCollections(squashList *database.CustomList) error
- func (q CustomQuery) MergeRelationships(squashList *database.CustomList) error
- func (q CustomQuery) MergeRemoteRelationships(squashList *database.CustomList) error
- func (q CustomQuery) MergeRemoteSchemas(squashList *database.CustomList) error
- func (q CustomQuery) MergeTableCustomFields(squashList *database.CustomList) error
- func (q CustomQuery) MergeTables(squashList *database.CustomList) error
- type HasuraArgs
- type HasuraBulk
- type HasuraColumn
- type HasuraDB
- func (h *HasuraDB) Close() error
- func (h *HasuraDB) Drop() error
- func (h *HasuraDB) EnableCheckMetadataConsistency(enabled bool)
- func (h *HasuraDB) ExportSchemaDump(schemaNames []string, sourceName string, sourceKind hasura.SourceKind) ([]byte, error)
- func (h *HasuraDB) First() (migrationVersion *database.MigrationVersion, ok bool)
- func (h *HasuraDB) GetSetting(name string) (value string, err error)
- func (h *HasuraDB) InsertVersion(version int64) error
- func (h *HasuraDB) Last() (*database.MigrationVersion, bool)
- func (h *HasuraDB) Lock() error
- func (h *HasuraDB) Next(version uint64) (migrationVersion *database.MigrationVersion, ok bool)
- func (h *HasuraDB) Open(url string, isCMD bool, tlsConfig *tls.Config, logger *log.Logger, ...) (database.Driver, error)
- func (h *HasuraDB) Prev(version uint64) (prevVersion *database.MigrationVersion, ok bool)
- func (h *HasuraDB) PushToList(migration io.Reader, fileType string, l *database.CustomList) error
- func (h *HasuraDB) Query(data interface{}) error
- func (h *HasuraDB) Read(version uint64) (ok bool)
- func (h *HasuraDB) RemoveVersion(version int64) error
- func (h *HasuraDB) ResetQuery()
- func (h *HasuraDB) Run(migration io.Reader, fileType, fileName string) error
- func (h *HasuraDB) Scan() error
- func (h *HasuraDB) SetVersion(version int64, dirty bool) error
- func (h *HasuraDB) Squash(l *database.CustomList, ret chan<- interface{})
- func (h *HasuraDB) UnLock() error
- func (h *HasuraDB) UpdateSetting(name string, value string) error
- func (h *HasuraDB) Version() (version int64, dirty bool, err error)
- type HasuraError
- type HasuraInterfaceBulk
- type HasuraInterfaceQuery
- type HasuraOrderBy
- type HasuraQuery
- type HasuraSQLRes
- type InconsistentMetadataError
- type PermissionDefinition
- type PostgresError
- type RunSQLInput
- type SQLInternalError
- type SchemaDump
Constants ¶
View Source
const ( TuplesOK = "TuplesOk" CommandOK = "CommandOk" )
View Source
const (
DefaultDatabaseName = "default"
)
View Source
const (
RunSQL = "run_sql"
)
Variables ¶
Functions ¶
func NewHasuraError ¶
NewHasuraError - returns error based on data and isCmd
func WithInstance ¶
Types ¶
type CustomQuery ¶
type CustomQuery linq.Query
func (CustomQuery) MergeActionPermissions ¶
func (q CustomQuery) MergeActionPermissions(squashList *database.CustomList) error
func (CustomQuery) MergeActions ¶
func (q CustomQuery) MergeActions(squashList *database.CustomList) error
func (CustomQuery) MergeAllowLists ¶
func (q CustomQuery) MergeAllowLists(squashList *database.CustomList) error
func (CustomQuery) MergeComputedFields ¶
func (q CustomQuery) MergeComputedFields(squashList *database.CustomList) error
func (CustomQuery) MergeCronTriggers ¶
func (q CustomQuery) MergeCronTriggers(squashList *database.CustomList) error
func (CustomQuery) MergeCustomTypes ¶
func (q CustomQuery) MergeCustomTypes(squashList *database.CustomList) error
func (CustomQuery) MergeEventTriggers ¶
func (q CustomQuery) MergeEventTriggers(squashList *database.CustomList) error
func (CustomQuery) MergeFunctions ¶
func (q CustomQuery) MergeFunctions(squashList *database.CustomList) error
func (CustomQuery) MergePermissions ¶
func (q CustomQuery) MergePermissions(squashList *database.CustomList) error
func (CustomQuery) MergeQueryCollections ¶
func (q CustomQuery) MergeQueryCollections(squashList *database.CustomList) error
func (CustomQuery) MergeQueryInCollections ¶
func (q CustomQuery) MergeQueryInCollections(squashList *database.CustomList) error
func (CustomQuery) MergeRelationships ¶
func (q CustomQuery) MergeRelationships(squashList *database.CustomList) error
func (CustomQuery) MergeRemoteRelationships ¶
func (q CustomQuery) MergeRemoteRelationships(squashList *database.CustomList) error
func (CustomQuery) MergeRemoteSchemas ¶
func (q CustomQuery) MergeRemoteSchemas(squashList *database.CustomList) error
func (CustomQuery) MergeTableCustomFields ¶
func (q CustomQuery) MergeTableCustomFields(squashList *database.CustomList) error
func (CustomQuery) MergeTables ¶
func (q CustomQuery) MergeTables(squashList *database.CustomList) error
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) EnableCheckMetadataConsistency ¶
func (*HasuraDB) ExportSchemaDump ¶
func (*HasuraDB) First ¶
func (h *HasuraDB) First() (migrationVersion *database.MigrationVersion, ok bool)
func (*HasuraDB) InsertVersion ¶
func (*HasuraDB) Next ¶
func (h *HasuraDB) Next(version uint64) (migrationVersion *database.MigrationVersion, ok bool)
func (*HasuraDB) Prev ¶
func (h *HasuraDB) Prev(version uint64) (prevVersion *database.MigrationVersion, ok bool)
func (*HasuraDB) PushToList ¶
PushList will read migration from source for an sql migration it'll append it to the LinkedList for a meta migration it'll append after some processing
func (*HasuraDB) RemoveVersion ¶
func (*HasuraDB) ResetQuery ¶
func (h *HasuraDB) ResetQuery()
func (*HasuraDB) Squash ¶
func (h *HasuraDB) Squash(l *database.CustomList, ret chan<- interface{})
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 requestTypes `json:"type" yaml:"type"` Version metadataVersion `json:"version,omitempty" yaml:"version,omitempty"` Source string `json:"source,omitempty" yaml:"source,omitempty"` Args interface{} `json:"args" yaml:"args"` }
type HasuraOrderBy ¶
type HasuraQuery ¶
type HasuraQuery struct { Type string `json:"type" yaml:"type"` Args HasuraArgs `json:"args" yaml:"args"` }
type HasuraSQLRes ¶
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 PermissionDefinition ¶
type PermissionDefinition struct { Role interface{} `json:"role,omitempty" yaml:"role,omitempty"` Comment string `json:"comment,omitempty" yaml:"comment,omitempty"` }
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 RunSQLInput ¶
type RunSQLInput 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 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 ¶
Click to show internal directories.
Click to hide internal directories.