prisma

package module
v0.0.0-...-0f3024b Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package prisma provides runtime functions for generated Prisma clients. Users should not have to interact with it directly.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchPayload

type BatchPayload struct {
	Count int64 `json:"count"`
}

type BatchPayloadExec

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

func (*BatchPayloadExec) Exec

func (exec *BatchPayloadExec) Exec(ctx context.Context) (BatchPayload, error)

type Client

type Client struct {
	Endpoint string
	Secret   string
	// TODO(dh): find a better name for this field
	GQLClient *graphql.Client
}

func New

func New(endpoint string, secret string, opts ...graphql.ClientOption) *Client

func (*Client) Create

func (client *Client) Create(params interface{}, typeNames [2]string, instrName string, typeFields []string) *Exec

func (*Client) Delete

func (client *Client) Delete(params interface{}, typeNames [2]string, instrName string, typeFields []string) *Exec

func (*Client) DeleteMany

func (client *Client) DeleteMany(params interface{}, typeName string, instrName string) *BatchPayloadExec

func (*Client) GetMany

func (client *Client) GetMany(base *Exec, params *WhereParams, typeNames [3]string, instrName string, typeFields []string) *Exec

func (*Client) GetOne

func (client *Client) GetOne(base *Exec, params interface{}, typeNames [2]string, instrName string, typeFields []string) *Exec

func (*Client) GraphQL

func (client *Client) GraphQL(ctx context.Context, query string, variables map[string]interface{}) (map[string]interface{}, error)

GraphQL Send a GraphQL operation request

func (*Client) ProcessInstructions

func (client *Client) ProcessInstructions(stack []instruction) string

func (*Client) Update

func (client *Client) Update(params UpdateParams, typeNames [3]string, instrName string, typeFields []string) *Exec

func (*Client) UpdateMany

func (client *Client) UpdateMany(params UpdateParams, typeNames [2]string, instrName string) *BatchPayloadExec

func (*Client) Upsert

func (client *Client) Upsert(params *UpsertParams, typeNames [4]string, instrName string, typeFields []string) *Exec

type Exec

type Exec struct {
	Client *Client
	Stack  []instruction
}

func (*Exec) Exec

func (exec *Exec) Exec(ctx context.Context, v interface{}) (bool, error)

func (*Exec) ExecArray

func (exec *Exec) ExecArray(ctx context.Context, v interface{}) error

func (*Exec) Exists

func (exec *Exec) Exists(ctx context.Context) (bool, error)

type UpdateParams

type UpdateParams struct {
	Data  interface{}
	Where interface{}
}

type UpsertParams

type UpsertParams struct {
	Where  interface{}
	Create interface{}
	Update interface{}
}

type WhereParams

type WhereParams struct {
	Where   interface{} `json:"where,omitempty"`
	OrderBy *string     `json:"orderBy,omitempty"`
	Skip    *int32      `json:"skip,omitempty"`
	After   *string     `json:"after,omitempty"`
	Before  *string     `json:"before,omitempty"`
	First   *int32      `json:"first,omitempty"`
	Last    *int32      `json:"last,omitempty"`
}

Jump to

Keyboard shortcuts

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