prisma

package
v0.0.0-...-bc55c55 Latest Latest
Warning

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

Go to latest
Published: May 9, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultEndpoint = "http://prisma:4466"
View Source
var ErrNoResult = errors.New("query returned no result")
View Source
var Secret = ""

Functions

func Bool

func Bool(v bool) *bool

func Int32

func Int32(v int32) *int32

func Str

func Str(v string) *string

Types

type Aggregate

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

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 {
	Client *prisma.Client
}

func New

func New(options *Options, opts ...graphql.ClientOption) *Client

func (*Client) CreateUser

func (client *Client) CreateUser(params UserCreateInput) *UserExec

func (*Client) DeleteManyUsers

func (client *Client) DeleteManyUsers(params *UserWhereInput) *BatchPayloadExec

func (*Client) DeleteUser

func (client *Client) DeleteUser(params UserWhereUniqueInput) *UserExec

func (*Client) GraphQL

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

func (*Client) UpdateManyUsers

func (client *Client) UpdateManyUsers(params UserUpdateManyParams) *BatchPayloadExec

func (*Client) UpdateUser

func (client *Client) UpdateUser(params UserUpdateParams) *UserExec

func (*Client) UpsertUser

func (client *Client) UpsertUser(params UserUpsertParams) *UserExec

func (*Client) User

func (client *Client) User(params UserWhereUniqueInput) *UserExec

func (*Client) Users

func (client *Client) Users(params *UsersParams) *UserExecArray

func (*Client) UsersConnection

func (client *Client) UsersConnection(params *UsersConnectionParams) UserConnectionExec

type MutationType

type MutationType string
const (
	MutationTypeCreated MutationType = "CREATED"
	MutationTypeUpdated MutationType = "UPDATED"
	MutationTypeDeleted MutationType = "DELETED"
)

type Options

type Options struct {
	Endpoint string
	Secret   string
}

type PageInfo

type PageInfo struct {
	HasNextPage     bool    `json:"hasNextPage"`
	HasPreviousPage bool    `json:"hasPreviousPage"`
	StartCursor     *string `json:"startCursor,omitempty"`
	EndCursor       *string `json:"endCursor,omitempty"`
}

type PageInfoExec

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

func (PageInfoExec) Exec

func (instance PageInfoExec) Exec(ctx context.Context) (*PageInfo, error)

func (PageInfoExec) Exists

func (instance PageInfoExec) Exists(ctx context.Context) (bool, error)

type PageInfoExecArray

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

func (PageInfoExecArray) Exec

func (instance PageInfoExecArray) Exec(ctx context.Context) ([]PageInfo, error)

type User

type User struct {
	ID       string `json:"id"`
	Username string `json:"username"`
	Password string `json:"password"`
}

func (User) GetID

func (me User) GetID() string

GetID retuns the user's ID.

func (User) IsUserAndStatus

func (User) IsUserAndStatus()

IsUserAndStatus denotes User and Status can be unionized each other.

type UserConnection

type UserConnection struct {
}

type UserConnectionExec

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

func (*UserConnectionExec) Aggregate

func (instance *UserConnectionExec) Aggregate(ctx context.Context) (Aggregate, error)

func (*UserConnectionExec) Edges

func (instance *UserConnectionExec) Edges() *UserEdgeExec

func (UserConnectionExec) Exec

func (instance UserConnectionExec) Exec(ctx context.Context) (*UserConnection, error)

func (UserConnectionExec) Exists

func (instance UserConnectionExec) Exists(ctx context.Context) (bool, error)

func (*UserConnectionExec) PageInfo

func (instance *UserConnectionExec) PageInfo() *PageInfoExec

type UserConnectionExecArray

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

func (UserConnectionExecArray) Exec

type UserCreateInput

type UserCreateInput struct {
	ID       *string `json:"id,omitempty"`
	Username string  `json:"username"`
	Password string  `json:"password"`
}

type UserEdge

type UserEdge struct {
	Cursor string `json:"cursor"`
}

type UserEdgeExec

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

func (UserEdgeExec) Exec

func (instance UserEdgeExec) Exec(ctx context.Context) (*UserEdge, error)

func (UserEdgeExec) Exists

func (instance UserEdgeExec) Exists(ctx context.Context) (bool, error)

func (*UserEdgeExec) Node

func (instance *UserEdgeExec) Node() *UserExec

type UserEdgeExecArray

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

func (UserEdgeExecArray) Exec

func (instance UserEdgeExecArray) Exec(ctx context.Context) ([]UserEdge, error)

type UserExec

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

func (UserExec) Exec

func (instance UserExec) Exec(ctx context.Context) (*User, error)

func (UserExec) Exists

func (instance UserExec) Exists(ctx context.Context) (bool, error)

type UserExecArray

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

func (UserExecArray) Exec

func (instance UserExecArray) Exec(ctx context.Context) ([]User, error)

type UserOrderByInput

type UserOrderByInput string
const (
	UserOrderByInputIDAsc        UserOrderByInput = "id_ASC"
	UserOrderByInputIDDesc       UserOrderByInput = "id_DESC"
	UserOrderByInputUsernameAsc  UserOrderByInput = "username_ASC"
	UserOrderByInputUsernameDesc UserOrderByInput = "username_DESC"
	UserOrderByInputPasswordAsc  UserOrderByInput = "password_ASC"
	UserOrderByInputPasswordDesc UserOrderByInput = "password_DESC"
)

type UserPreviousValues

type UserPreviousValues struct {
	ID       string `json:"id"`
	Username string `json:"username"`
	Password string `json:"password"`
}

type UserPreviousValuesExec

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

func (UserPreviousValuesExec) Exec

func (UserPreviousValuesExec) Exists

func (instance UserPreviousValuesExec) Exists(ctx context.Context) (bool, error)

type UserPreviousValuesExecArray

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

func (UserPreviousValuesExecArray) Exec

type UserSubscriptionPayload

type UserSubscriptionPayload struct {
	Mutation      MutationType `json:"mutation"`
	UpdatedFields []string     `json:"updatedFields,omitempty"`
}

type UserSubscriptionPayloadExec

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

func (UserSubscriptionPayloadExec) Exec

func (UserSubscriptionPayloadExec) Exists

func (instance UserSubscriptionPayloadExec) Exists(ctx context.Context) (bool, error)

func (*UserSubscriptionPayloadExec) Node

func (instance *UserSubscriptionPayloadExec) Node() *UserExec

func (*UserSubscriptionPayloadExec) PreviousValues

func (instance *UserSubscriptionPayloadExec) PreviousValues() *UserPreviousValuesExec

type UserSubscriptionPayloadExecArray

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

func (UserSubscriptionPayloadExecArray) Exec

type UserSubscriptionWhereInput

type UserSubscriptionWhereInput struct {
	MutationIn                 []MutationType               `json:"mutation_in,omitempty"`
	UpdatedFieldsContains      *string                      `json:"updatedFields_contains,omitempty"`
	UpdatedFieldsContainsEvery []string                     `json:"updatedFields_contains_every,omitempty"`
	UpdatedFieldsContainsSome  []string                     `json:"updatedFields_contains_some,omitempty"`
	Node                       *UserWhereInput              `json:"node,omitempty"`
	And                        []UserSubscriptionWhereInput `json:"AND,omitempty"`
	Or                         []UserSubscriptionWhereInput `json:"OR,omitempty"`
	Not                        []UserSubscriptionWhereInput `json:"NOT,omitempty"`
}

type UserUpdateInput

type UserUpdateInput struct {
	Username *string `json:"username,omitempty"`
	Password *string `json:"password,omitempty"`
}

type UserUpdateManyMutationInput

type UserUpdateManyMutationInput struct {
	Username *string `json:"username,omitempty"`
	Password *string `json:"password,omitempty"`
}

type UserUpdateManyParams

type UserUpdateManyParams struct {
	Data  UserUpdateManyMutationInput `json:"data"`
	Where *UserWhereInput             `json:"where,omitempty"`
}

type UserUpdateParams

type UserUpdateParams struct {
	Data  UserUpdateInput      `json:"data"`
	Where UserWhereUniqueInput `json:"where"`
}

type UserUpsertParams

type UserUpsertParams struct {
	Where  UserWhereUniqueInput `json:"where"`
	Create UserCreateInput      `json:"create"`
	Update UserUpdateInput      `json:"update"`
}

type UserWhereInput

type UserWhereInput struct {
	ID                    *string          `json:"id,omitempty"`
	IDNot                 *string          `json:"id_not,omitempty"`
	IDIn                  []string         `json:"id_in,omitempty"`
	IDNotIn               []string         `json:"id_not_in,omitempty"`
	IDLt                  *string          `json:"id_lt,omitempty"`
	IDLte                 *string          `json:"id_lte,omitempty"`
	IDGt                  *string          `json:"id_gt,omitempty"`
	IDGte                 *string          `json:"id_gte,omitempty"`
	IDContains            *string          `json:"id_contains,omitempty"`
	IDNotContains         *string          `json:"id_not_contains,omitempty"`
	IDStartsWith          *string          `json:"id_starts_with,omitempty"`
	IDNotStartsWith       *string          `json:"id_not_starts_with,omitempty"`
	IDEndsWith            *string          `json:"id_ends_with,omitempty"`
	IDNotEndsWith         *string          `json:"id_not_ends_with,omitempty"`
	Username              *string          `json:"username,omitempty"`
	UsernameNot           *string          `json:"username_not,omitempty"`
	UsernameIn            []string         `json:"username_in,omitempty"`
	UsernameNotIn         []string         `json:"username_not_in,omitempty"`
	UsernameLt            *string          `json:"username_lt,omitempty"`
	UsernameLte           *string          `json:"username_lte,omitempty"`
	UsernameGt            *string          `json:"username_gt,omitempty"`
	UsernameGte           *string          `json:"username_gte,omitempty"`
	UsernameContains      *string          `json:"username_contains,omitempty"`
	UsernameNotContains   *string          `json:"username_not_contains,omitempty"`
	UsernameStartsWith    *string          `json:"username_starts_with,omitempty"`
	UsernameNotStartsWith *string          `json:"username_not_starts_with,omitempty"`
	UsernameEndsWith      *string          `json:"username_ends_with,omitempty"`
	UsernameNotEndsWith   *string          `json:"username_not_ends_with,omitempty"`
	Password              *string          `json:"password,omitempty"`
	PasswordNot           *string          `json:"password_not,omitempty"`
	PasswordIn            []string         `json:"password_in,omitempty"`
	PasswordNotIn         []string         `json:"password_not_in,omitempty"`
	PasswordLt            *string          `json:"password_lt,omitempty"`
	PasswordLte           *string          `json:"password_lte,omitempty"`
	PasswordGt            *string          `json:"password_gt,omitempty"`
	PasswordGte           *string          `json:"password_gte,omitempty"`
	PasswordContains      *string          `json:"password_contains,omitempty"`
	PasswordNotContains   *string          `json:"password_not_contains,omitempty"`
	PasswordStartsWith    *string          `json:"password_starts_with,omitempty"`
	PasswordNotStartsWith *string          `json:"password_not_starts_with,omitempty"`
	PasswordEndsWith      *string          `json:"password_ends_with,omitempty"`
	PasswordNotEndsWith   *string          `json:"password_not_ends_with,omitempty"`
	And                   []UserWhereInput `json:"AND,omitempty"`
	Or                    []UserWhereInput `json:"OR,omitempty"`
	Not                   []UserWhereInput `json:"NOT,omitempty"`
}

type UserWhereUniqueInput

type UserWhereUniqueInput struct {
	ID       *string `json:"id,omitempty"`
	Username *string `json:"username,omitempty"`
}

type UsersConnectionParams

type UsersConnectionParams struct {
	Where   *UserWhereInput   `json:"where,omitempty"`
	OrderBy *UserOrderByInput `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"`
}

type UsersParams

type UsersParams struct {
	Where   *UserWhereInput   `json:"where,omitempty"`
	OrderBy *UserOrderByInput `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