database

package
v0.95.0 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2022 License: Apache-2.0 Imports: 33 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigJson

func ConfigJson(config Configuration) json.RawMessage

func InstallPrismaDependencies

func InstallPrismaDependencies(log abstractlogger.Logger) error

func IntrospectPrismaDatabase

func IntrospectPrismaDatabase(introspectionSchema string, log abstractlogger.Logger) (prismaSchema, graphqlSDL, dmmf string, err error)

Types

type BinaryEngine

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

func (*BinaryEngine) Close

func (e *BinaryEngine) Close()

func (*BinaryEngine) Execute

func (e *BinaryEngine) Execute(ctx context.Context, request []byte, w io.Writer) error

type Configuration

type Configuration struct {
	DatabaseURL         string
	PrismaSchema        string
	GraphqlSchema       string
	CloseTimeoutSeconds int64
	JsonTypeFields      []SingleTypeField
	JsonInputVariables  []string
}

type Engine

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

func NewEngine

func NewEngine(client *http.Client, log abstractlogger.Logger) *Engine

func (*Engine) IntrospectDMMF

func (e *Engine) IntrospectDMMF(ctx context.Context) (dmmf string, err error)

func (*Engine) IntrospectGraphQLSchema

func (e *Engine) IntrospectGraphQLSchema(ctx context.Context) (schema string, err error)

func (*Engine) IntrospectPrismaDatabaseSchema

func (e *Engine) IntrospectPrismaDatabaseSchema(introspectionSchema string) (string, error)

func (*Engine) Request

func (e *Engine) Request(ctx context.Context, request []byte, rw io.Writer) (err error)

func (*Engine) StartQueryEngine

func (e *Engine) StartQueryEngine(schema string) error

func (*Engine) StopQueryEngine

func (e *Engine) StopQueryEngine()

type Factory

type Factory struct {
	Client *http.Client

	Debug bool
	Log   abstractlogger.Logger
	// contains filtered or unexported fields
}

func (*Factory) Planner

func (f *Factory) Planner(ctx context.Context) plan.DataSourcePlanner

type GQLRequest

type GQLRequest struct {
	Query     string          `json:"query"`
	Variables json.RawMessage `json:"variables"`
}

type HybridEngine

type HybridEngine interface {
	Close()
	Execute(ctx context.Context, request []byte, w io.Writer) error
}

func NewHybridEngine

func NewHybridEngine(prismaSchema string, log abstractlogger.Logger) (HybridEngine, error)

type IntrospectionRequest

type IntrospectionRequest struct {
	ID      int         `json:"id"`
	JSONRPC string      `json:"jsonrpc"`
	Method  string      `json:"method"`
	Params  interface{} `json:"params"`
}

type IntrospectionResponse

type IntrospectionResponse struct {
	ID      int    `json:"id"`
	JSONRPC string `json:"jsonrpc"`
	Result  struct {
		DataModel string `json:"datamodel"`
	} `json:"result"`
	Error *struct {
		Code    int64  `json:"code"`
		Message string `json:"message"`
		Data    struct {
			Message string `json:"message"`
		} `json:"data"`
	} `json:"error"`
}

type LazyEngine

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

func (*LazyEngine) Execute

func (e *LazyEngine) Execute(ctx context.Context, request []byte, out io.Writer) error

func (*LazyEngine) Start

func (e *LazyEngine) Start(closer <-chan struct{})

type LazyEngineFactory

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

func (*LazyEngineFactory) Engine

func (f *LazyEngineFactory) Engine(prismaSchema string, closeTimeoutSeconds int64) *LazyEngine

type Planner

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

func (*Planner) ConfigureFetch

func (p *Planner) ConfigureFetch() plan.FetchConfiguration

func (*Planner) ConfigureSubscription

func (p *Planner) ConfigureSubscription() plan.SubscriptionConfiguration

func (*Planner) DataSourcePlanningBehavior

func (p *Planner) DataSourcePlanningBehavior() plan.DataSourcePlanningBehavior

func (*Planner) DownstreamResponseFieldAlias

func (p *Planner) DownstreamResponseFieldAlias(downstreamFieldRef int) (alias string, exists bool)

func (*Planner) EnterArgument

func (p *Planner) EnterArgument(ref int)

func (*Planner) EnterDocument

func (p *Planner) EnterDocument(operation, definition *ast.Document)

func (*Planner) EnterField

func (p *Planner) EnterField(ref int)

func (*Planner) EnterInlineFragment

func (p *Planner) EnterInlineFragment(ref int)

func (*Planner) EnterOperationDefinition

func (p *Planner) EnterOperationDefinition(ref int)

func (*Planner) EnterSelectionSet

func (p *Planner) EnterSelectionSet(ref int)

func (*Planner) LeaveDocument

func (p *Planner) LeaveDocument(operation, definition *ast.Document)

func (*Planner) LeaveField

func (p *Planner) LeaveField(ref int)

func (*Planner) LeaveInlineFragment

func (p *Planner) LeaveInlineFragment(ref int)

func (*Planner) LeaveOperationDefinition

func (p *Planner) LeaveOperationDefinition(_ int)

func (*Planner) LeaveSelectionSet

func (p *Planner) LeaveSelectionSet(ref int)

func (*Planner) Register

func (p *Planner) Register(visitor *plan.Visitor, configuration plan.DataSourceConfiguration, isNested bool) error

type SingleTypeField

type SingleTypeField struct {
	TypeName  string
	FieldName string
}

type Source

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

func (*Source) Load

func (s *Source) Load(ctx context.Context, input []byte, w io.Writer) (err error)

Jump to

Keyboard shortcuts

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