Documentation ¶
Index ¶
- Constants
- type Client
- type Product
- type ProductClient
- func (pc *ProductClient) Create(ctx context.Context, options *ProductOptions) (*Product, error)
- func (pc *ProductClient) Delete(ctx context.Context, params *ProductOptions) error
- func (pc *ProductClient) FindMany(ctx context.Context, params ...*ProductOptions) ([]*Product, error)
- func (pc *ProductClient) FindUnique(ctx context.Context, params *ProductOptions) (*Product, error)
- func (pc *ProductClient) Update(ctx context.Context, options *ProductOptions) (*Product, error)
- type ProductOptions
- type ProductWhereInput
- type User
- type UserClient
- func (uc *UserClient) Create(ctx context.Context, options *UserOptions) (*User, error)
- func (uc *UserClient) Delete(ctx context.Context, params *UserOptions) error
- func (uc *UserClient) FindMany(ctx context.Context, params ...*UserOptions) ([]*User, error)
- func (uc *UserClient) FindUnique(ctx context.Context, params *UserOptions) (*User, error)
- func (uc *UserClient) Update(ctx context.Context, options *UserOptions) (*User, error)
- type UserOptions
- type UserWhereInput
- type WhereInput
Constants ¶
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.
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.