not

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PgForeignKeyViolation = "23503"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {

	// User is the client for interacting with the User builders.
	User *UserClient
	// Product is the client for interacting with the Product builders.
	Product *ProductClient
	// contains filtered or unexported fields
}

Client exposes the database entities as methods.

func NewClient

func NewClient(driver, connectionString string) (*Client, error)

NewClient creates a new SDK Client.

type Product

type Product struct {
	ID        int       `db:"id"`
	CreatedAt time.Time `db:"created_at"`
	UpdatedAt time.Time `db:"updated_at"`
	Name      string    `db:"name"`
}

Product is the model entity for the Product schema.

type ProductClient

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

ProductClient is the client for the Product schema.

func (*ProductClient) Create

func (pc *ProductClient) Create(ctx context.Context, options *ProductOptions) (*Product, error)

Create inserts a new Product record in the products table.

func (*ProductClient) Delete

func (pc *ProductClient) Delete(ctx context.Context, params *ProductOptions) error

Delete deletes a Product record from the products table.

func (*ProductClient) FindMany

func (pc *ProductClient) FindMany(ctx context.Context, params ...*ProductOptions) ([]*Product, error)

FindMany returns a list of Product records from the products.

func (*ProductClient) FindUnique

func (pc *ProductClient) FindUnique(ctx context.Context, params *ProductOptions) (*Product, error)

FindUnique returns a single Product record from the products table.

func (*ProductClient) Update

func (pc *ProductClient) Update(ctx context.Context, options *ProductOptions) (*Product, error)

Update updates a Product record in the products table.

type ProductOptions

type ProductOptions struct {
	Where WhereInput
	Data  *Product
}

type ProductWhereInput

type ProductWhereInput struct {
	ID           *int
	IDNot        *int
	IDIn         *[]int
	IDLt         *int
	IDLte        *int
	IDGt         *int
	IDGte        *int
	CreatedAt    *time.Time
	CreatedAtNot *time.Time
	CreatedAtIn  *[]time.Time
	CreatedAtLt  *time.Time
	CreatedAtLte *time.Time
	CreatedAtGt  *time.Time
	CreatedAtGte *time.Time
	UpdatedAt    *time.Time
	UpdatedAtNot *time.Time
	UpdatedAtIn  *[]time.Time
	UpdatedAtLt  *time.Time
	UpdatedAtLte *time.Time
	UpdatedAtGt  *time.Time
	UpdatedAtGte *time.Time
	Name         *string
	NameNot      *string
	NameIn       *[]string
	NameLt       *string
	NameLte      *string
	NameGt       *string
	NameGte      *string
}

ProductWhereInput is the unique input for the Product model.

func (*ProductWhereInput) ToSqlExpr

func (w *ProductWhereInput) ToSqlExpr() squirrel.Sqlizer

ToSqlExpr converts ProductWhereInput to squirrel.Sqlizer.

type User

type User struct {
	ID        int       `db:"id"`
	CreatedAt time.Time `db:"created_at"`
	UpdatedAt time.Time `db:"updated_at"`
	Username  string    `db:"username"`
	Email     string    `db:"email"`
	FullName  string    `db:"full_name"`
}

User is the model entity for the User schema.

type UserClient

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

UserClient is the client for the User schema.

func (*UserClient) Create

func (uc *UserClient) Create(ctx context.Context, options *UserOptions) (*User, error)

Create inserts a new User record in the users table.

func (*UserClient) Delete

func (uc *UserClient) Delete(ctx context.Context, params *UserOptions) error

Delete deletes a User record from the users table.

func (*UserClient) FindMany

func (uc *UserClient) FindMany(ctx context.Context, params ...*UserOptions) ([]*User, error)

FindMany returns a list of User records from the users.

func (*UserClient) FindUnique

func (uc *UserClient) FindUnique(ctx context.Context, params *UserOptions) (*User, error)

FindUnique returns a single User record from the users table.

func (*UserClient) Update

func (uc *UserClient) Update(ctx context.Context, options *UserOptions) (*User, error)

Update updates a User record in the users table.

type UserOptions

type UserOptions struct {
	Where WhereInput
	Data  *User
}

type UserWhereInput

type UserWhereInput struct {
	ID           *int
	IDNot        *int
	IDIn         *[]int
	IDLt         *int
	IDLte        *int
	IDGt         *int
	IDGte        *int
	CreatedAt    *time.Time
	CreatedAtNot *time.Time
	CreatedAtIn  *[]time.Time
	CreatedAtLt  *time.Time
	CreatedAtLte *time.Time
	CreatedAtGt  *time.Time
	CreatedAtGte *time.Time
	UpdatedAt    *time.Time
	UpdatedAtNot *time.Time
	UpdatedAtIn  *[]time.Time
	UpdatedAtLt  *time.Time
	UpdatedAtLte *time.Time
	UpdatedAtGt  *time.Time
	UpdatedAtGte *time.Time
	Username     *string
	UsernameNot  *string
	UsernameIn   *[]string
	UsernameLt   *string
	UsernameLte  *string
	UsernameGt   *string
	UsernameGte  *string
	Email        *string
	EmailNot     *string
	EmailIn      *[]string
	EmailLt      *string
	EmailLte     *string
	EmailGt      *string
	EmailGte     *string
	FullName     *string
	FullNameNot  *string
	FullNameIn   *[]string
	FullNameLt   *string
	FullNameLte  *string
	FullNameGt   *string
	FullNameGte  *string
}

UserWhereInput is the unique input for the User model.

func (*UserWhereInput) ToSqlExpr

func (w *UserWhereInput) ToSqlExpr() squirrel.Sqlizer

ToSqlExpr converts UserWhereInput to squirrel.Sqlizer.

type WhereInput

type WhereInput interface {
	ToSqlExpr() squirrel.Sqlizer
}

Jump to

Keyboard shortcuts

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