mirror of
https://github.com/hay-kot/homebox.git
synced 2025-08-03 00:00:27 +00:00
code-generation
This commit is contained in:
parent
b2927af899
commit
e15d104d7f
38 changed files with 576 additions and 266 deletions
|
@ -229,32 +229,15 @@ func HasDocumentWith(preds ...predicate.Document) predicate.Attachment {
|
||||||
|
|
||||||
// And groups predicates with the AND operator between them.
|
// And groups predicates with the AND operator between them.
|
||||||
func And(predicates ...predicate.Attachment) predicate.Attachment {
|
func And(predicates ...predicate.Attachment) predicate.Attachment {
|
||||||
return predicate.Attachment(func(s *sql.Selector) {
|
return predicate.Attachment(sql.AndPredicates(predicates...))
|
||||||
s1 := s.Clone().SetP(nil)
|
|
||||||
for _, p := range predicates {
|
|
||||||
p(s1)
|
|
||||||
}
|
|
||||||
s.Where(s1.P())
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Or groups predicates with the OR operator between them.
|
// Or groups predicates with the OR operator between them.
|
||||||
func Or(predicates ...predicate.Attachment) predicate.Attachment {
|
func Or(predicates ...predicate.Attachment) predicate.Attachment {
|
||||||
return predicate.Attachment(func(s *sql.Selector) {
|
return predicate.Attachment(sql.OrPredicates(predicates...))
|
||||||
s1 := s.Clone().SetP(nil)
|
|
||||||
for i, p := range predicates {
|
|
||||||
if i > 0 {
|
|
||||||
s1.Or()
|
|
||||||
}
|
|
||||||
p(s1)
|
|
||||||
}
|
|
||||||
s.Where(s1.P())
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Not applies the not operator on the given predicate.
|
// Not applies the not operator on the given predicate.
|
||||||
func Not(p predicate.Attachment) predicate.Attachment {
|
func Not(p predicate.Attachment) predicate.Attachment {
|
||||||
return predicate.Attachment(func(s *sql.Selector) {
|
return predicate.Attachment(sql.NotPredicates(p))
|
||||||
p(s.Not())
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -288,11 +288,15 @@ func (ac *AttachmentCreate) createSpec() (*Attachment, *sqlgraph.CreateSpec) {
|
||||||
// AttachmentCreateBulk is the builder for creating many Attachment entities in bulk.
|
// AttachmentCreateBulk is the builder for creating many Attachment entities in bulk.
|
||||||
type AttachmentCreateBulk struct {
|
type AttachmentCreateBulk struct {
|
||||||
config
|
config
|
||||||
|
err error
|
||||||
builders []*AttachmentCreate
|
builders []*AttachmentCreate
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save creates the Attachment entities in the database.
|
// Save creates the Attachment entities in the database.
|
||||||
func (acb *AttachmentCreateBulk) Save(ctx context.Context) ([]*Attachment, error) {
|
func (acb *AttachmentCreateBulk) Save(ctx context.Context) ([]*Attachment, error) {
|
||||||
|
if acb.err != nil {
|
||||||
|
return nil, acb.err
|
||||||
|
}
|
||||||
specs := make([]*sqlgraph.CreateSpec, len(acb.builders))
|
specs := make([]*sqlgraph.CreateSpec, len(acb.builders))
|
||||||
nodes := make([]*Attachment, len(acb.builders))
|
nodes := make([]*Attachment, len(acb.builders))
|
||||||
mutators := make([]Mutator, len(acb.builders))
|
mutators := make([]Mutator, len(acb.builders))
|
||||||
|
|
|
@ -98,32 +98,15 @@ func HasTokenWith(preds ...predicate.AuthTokens) predicate.AuthRoles {
|
||||||
|
|
||||||
// And groups predicates with the AND operator between them.
|
// And groups predicates with the AND operator between them.
|
||||||
func And(predicates ...predicate.AuthRoles) predicate.AuthRoles {
|
func And(predicates ...predicate.AuthRoles) predicate.AuthRoles {
|
||||||
return predicate.AuthRoles(func(s *sql.Selector) {
|
return predicate.AuthRoles(sql.AndPredicates(predicates...))
|
||||||
s1 := s.Clone().SetP(nil)
|
|
||||||
for _, p := range predicates {
|
|
||||||
p(s1)
|
|
||||||
}
|
|
||||||
s.Where(s1.P())
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Or groups predicates with the OR operator between them.
|
// Or groups predicates with the OR operator between them.
|
||||||
func Or(predicates ...predicate.AuthRoles) predicate.AuthRoles {
|
func Or(predicates ...predicate.AuthRoles) predicate.AuthRoles {
|
||||||
return predicate.AuthRoles(func(s *sql.Selector) {
|
return predicate.AuthRoles(sql.OrPredicates(predicates...))
|
||||||
s1 := s.Clone().SetP(nil)
|
|
||||||
for i, p := range predicates {
|
|
||||||
if i > 0 {
|
|
||||||
s1.Or()
|
|
||||||
}
|
|
||||||
p(s1)
|
|
||||||
}
|
|
||||||
s.Where(s1.P())
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Not applies the not operator on the given predicate.
|
// Not applies the not operator on the given predicate.
|
||||||
func Not(p predicate.AuthRoles) predicate.AuthRoles {
|
func Not(p predicate.AuthRoles) predicate.AuthRoles {
|
||||||
return predicate.AuthRoles(func(s *sql.Selector) {
|
return predicate.AuthRoles(sql.NotPredicates(p))
|
||||||
p(s.Not())
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -158,11 +158,15 @@ func (arc *AuthRolesCreate) createSpec() (*AuthRoles, *sqlgraph.CreateSpec) {
|
||||||
// AuthRolesCreateBulk is the builder for creating many AuthRoles entities in bulk.
|
// AuthRolesCreateBulk is the builder for creating many AuthRoles entities in bulk.
|
||||||
type AuthRolesCreateBulk struct {
|
type AuthRolesCreateBulk struct {
|
||||||
config
|
config
|
||||||
|
err error
|
||||||
builders []*AuthRolesCreate
|
builders []*AuthRolesCreate
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save creates the AuthRoles entities in the database.
|
// Save creates the AuthRoles entities in the database.
|
||||||
func (arcb *AuthRolesCreateBulk) Save(ctx context.Context) ([]*AuthRoles, error) {
|
func (arcb *AuthRolesCreateBulk) Save(ctx context.Context) ([]*AuthRoles, error) {
|
||||||
|
if arcb.err != nil {
|
||||||
|
return nil, arcb.err
|
||||||
|
}
|
||||||
specs := make([]*sqlgraph.CreateSpec, len(arcb.builders))
|
specs := make([]*sqlgraph.CreateSpec, len(arcb.builders))
|
||||||
nodes := make([]*AuthRoles, len(arcb.builders))
|
nodes := make([]*AuthRoles, len(arcb.builders))
|
||||||
mutators := make([]Mutator, len(arcb.builders))
|
mutators := make([]Mutator, len(arcb.builders))
|
||||||
|
|
|
@ -284,32 +284,15 @@ func HasRolesWith(preds ...predicate.AuthRoles) predicate.AuthTokens {
|
||||||
|
|
||||||
// And groups predicates with the AND operator between them.
|
// And groups predicates with the AND operator between them.
|
||||||
func And(predicates ...predicate.AuthTokens) predicate.AuthTokens {
|
func And(predicates ...predicate.AuthTokens) predicate.AuthTokens {
|
||||||
return predicate.AuthTokens(func(s *sql.Selector) {
|
return predicate.AuthTokens(sql.AndPredicates(predicates...))
|
||||||
s1 := s.Clone().SetP(nil)
|
|
||||||
for _, p := range predicates {
|
|
||||||
p(s1)
|
|
||||||
}
|
|
||||||
s.Where(s1.P())
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Or groups predicates with the OR operator between them.
|
// Or groups predicates with the OR operator between them.
|
||||||
func Or(predicates ...predicate.AuthTokens) predicate.AuthTokens {
|
func Or(predicates ...predicate.AuthTokens) predicate.AuthTokens {
|
||||||
return predicate.AuthTokens(func(s *sql.Selector) {
|
return predicate.AuthTokens(sql.OrPredicates(predicates...))
|
||||||
s1 := s.Clone().SetP(nil)
|
|
||||||
for i, p := range predicates {
|
|
||||||
if i > 0 {
|
|
||||||
s1.Or()
|
|
||||||
}
|
|
||||||
p(s1)
|
|
||||||
}
|
|
||||||
s.Where(s1.P())
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Not applies the not operator on the given predicate.
|
// Not applies the not operator on the given predicate.
|
||||||
func Not(p predicate.AuthTokens) predicate.AuthTokens {
|
func Not(p predicate.AuthTokens) predicate.AuthTokens {
|
||||||
return predicate.AuthTokens(func(s *sql.Selector) {
|
return predicate.AuthTokens(sql.NotPredicates(p))
|
||||||
p(s.Not())
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -280,11 +280,15 @@ func (atc *AuthTokensCreate) createSpec() (*AuthTokens, *sqlgraph.CreateSpec) {
|
||||||
// AuthTokensCreateBulk is the builder for creating many AuthTokens entities in bulk.
|
// AuthTokensCreateBulk is the builder for creating many AuthTokens entities in bulk.
|
||||||
type AuthTokensCreateBulk struct {
|
type AuthTokensCreateBulk struct {
|
||||||
config
|
config
|
||||||
|
err error
|
||||||
builders []*AuthTokensCreate
|
builders []*AuthTokensCreate
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save creates the AuthTokens entities in the database.
|
// Save creates the AuthTokens entities in the database.
|
||||||
func (atcb *AuthTokensCreateBulk) Save(ctx context.Context) ([]*AuthTokens, error) {
|
func (atcb *AuthTokensCreateBulk) Save(ctx context.Context) ([]*AuthTokens, error) {
|
||||||
|
if atcb.err != nil {
|
||||||
|
return nil, atcb.err
|
||||||
|
}
|
||||||
specs := make([]*sqlgraph.CreateSpec, len(atcb.builders))
|
specs := make([]*sqlgraph.CreateSpec, len(atcb.builders))
|
||||||
nodes := make([]*AuthTokens, len(atcb.builders))
|
nodes := make([]*AuthTokens, len(atcb.builders))
|
||||||
mutators := make([]Mutator, len(atcb.builders))
|
mutators := make([]Mutator, len(atcb.builders))
|
||||||
|
|
|
@ -7,6 +7,7 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
|
"reflect"
|
||||||
|
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"github.com/hay-kot/homebox/backend/internal/data/ent/migrate"
|
"github.com/hay-kot/homebox/backend/internal/data/ent/migrate"
|
||||||
|
@ -65,9 +66,7 @@ type Client struct {
|
||||||
|
|
||||||
// NewClient creates a new client configured with the given options.
|
// NewClient creates a new client configured with the given options.
|
||||||
func NewClient(opts ...Option) *Client {
|
func NewClient(opts ...Option) *Client {
|
||||||
cfg := config{log: log.Println, hooks: &hooks{}, inters: &inters{}}
|
client := &Client{config: newConfig(opts...)}
|
||||||
cfg.options(opts...)
|
|
||||||
client := &Client{config: cfg}
|
|
||||||
client.init()
|
client.init()
|
||||||
return client
|
return client
|
||||||
}
|
}
|
||||||
|
@ -107,6 +106,13 @@ type (
|
||||||
Option func(*config)
|
Option func(*config)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// newConfig creates a new config for the client.
|
||||||
|
func newConfig(opts ...Option) config {
|
||||||
|
cfg := config{log: log.Println, hooks: &hooks{}, inters: &inters{}}
|
||||||
|
cfg.options(opts...)
|
||||||
|
return cfg
|
||||||
|
}
|
||||||
|
|
||||||
// options applies the options on the config object.
|
// options applies the options on the config object.
|
||||||
func (c *config) options(opts ...Option) {
|
func (c *config) options(opts ...Option) {
|
||||||
for _, opt := range opts {
|
for _, opt := range opts {
|
||||||
|
@ -154,11 +160,14 @@ func Open(driverName, dataSourceName string, options ...Option) (*Client, error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ErrTxStarted is returned when trying to start a new transaction from a transactional client.
|
||||||
|
var ErrTxStarted = errors.New("ent: cannot start a transaction within a transaction")
|
||||||
|
|
||||||
// Tx returns a new transactional client. The provided context
|
// Tx returns a new transactional client. The provided context
|
||||||
// is used until the transaction is committed or rolled back.
|
// is used until the transaction is committed or rolled back.
|
||||||
func (c *Client) Tx(ctx context.Context) (*Tx, error) {
|
func (c *Client) Tx(ctx context.Context) (*Tx, error) {
|
||||||
if _, ok := c.driver.(*txDriver); ok {
|
if _, ok := c.driver.(*txDriver); ok {
|
||||||
return nil, errors.New("ent: cannot start a transaction within a transaction")
|
return nil, ErrTxStarted
|
||||||
}
|
}
|
||||||
tx, err := newTx(ctx, c.driver)
|
tx, err := newTx(ctx, c.driver)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -330,6 +339,21 @@ func (c *AttachmentClient) CreateBulk(builders ...*AttachmentCreate) *Attachment
|
||||||
return &AttachmentCreateBulk{config: c.config, builders: builders}
|
return &AttachmentCreateBulk{config: c.config, builders: builders}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates
|
||||||
|
// a builder and applies setFunc on it.
|
||||||
|
func (c *AttachmentClient) MapCreateBulk(slice any, setFunc func(*AttachmentCreate, int)) *AttachmentCreateBulk {
|
||||||
|
rv := reflect.ValueOf(slice)
|
||||||
|
if rv.Kind() != reflect.Slice {
|
||||||
|
return &AttachmentCreateBulk{err: fmt.Errorf("calling to AttachmentClient.MapCreateBulk with wrong type %T, need slice", slice)}
|
||||||
|
}
|
||||||
|
builders := make([]*AttachmentCreate, rv.Len())
|
||||||
|
for i := 0; i < rv.Len(); i++ {
|
||||||
|
builders[i] = c.Create()
|
||||||
|
setFunc(builders[i], i)
|
||||||
|
}
|
||||||
|
return &AttachmentCreateBulk{config: c.config, builders: builders}
|
||||||
|
}
|
||||||
|
|
||||||
// Update returns an update builder for Attachment.
|
// Update returns an update builder for Attachment.
|
||||||
func (c *AttachmentClient) Update() *AttachmentUpdate {
|
func (c *AttachmentClient) Update() *AttachmentUpdate {
|
||||||
mutation := newAttachmentMutation(c.config, OpUpdate)
|
mutation := newAttachmentMutation(c.config, OpUpdate)
|
||||||
|
@ -480,6 +504,21 @@ func (c *AuthRolesClient) CreateBulk(builders ...*AuthRolesCreate) *AuthRolesCre
|
||||||
return &AuthRolesCreateBulk{config: c.config, builders: builders}
|
return &AuthRolesCreateBulk{config: c.config, builders: builders}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates
|
||||||
|
// a builder and applies setFunc on it.
|
||||||
|
func (c *AuthRolesClient) MapCreateBulk(slice any, setFunc func(*AuthRolesCreate, int)) *AuthRolesCreateBulk {
|
||||||
|
rv := reflect.ValueOf(slice)
|
||||||
|
if rv.Kind() != reflect.Slice {
|
||||||
|
return &AuthRolesCreateBulk{err: fmt.Errorf("calling to AuthRolesClient.MapCreateBulk with wrong type %T, need slice", slice)}
|
||||||
|
}
|
||||||
|
builders := make([]*AuthRolesCreate, rv.Len())
|
||||||
|
for i := 0; i < rv.Len(); i++ {
|
||||||
|
builders[i] = c.Create()
|
||||||
|
setFunc(builders[i], i)
|
||||||
|
}
|
||||||
|
return &AuthRolesCreateBulk{config: c.config, builders: builders}
|
||||||
|
}
|
||||||
|
|
||||||
// Update returns an update builder for AuthRoles.
|
// Update returns an update builder for AuthRoles.
|
||||||
func (c *AuthRolesClient) Update() *AuthRolesUpdate {
|
func (c *AuthRolesClient) Update() *AuthRolesUpdate {
|
||||||
mutation := newAuthRolesMutation(c.config, OpUpdate)
|
mutation := newAuthRolesMutation(c.config, OpUpdate)
|
||||||
|
@ -614,6 +653,21 @@ func (c *AuthTokensClient) CreateBulk(builders ...*AuthTokensCreate) *AuthTokens
|
||||||
return &AuthTokensCreateBulk{config: c.config, builders: builders}
|
return &AuthTokensCreateBulk{config: c.config, builders: builders}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates
|
||||||
|
// a builder and applies setFunc on it.
|
||||||
|
func (c *AuthTokensClient) MapCreateBulk(slice any, setFunc func(*AuthTokensCreate, int)) *AuthTokensCreateBulk {
|
||||||
|
rv := reflect.ValueOf(slice)
|
||||||
|
if rv.Kind() != reflect.Slice {
|
||||||
|
return &AuthTokensCreateBulk{err: fmt.Errorf("calling to AuthTokensClient.MapCreateBulk with wrong type %T, need slice", slice)}
|
||||||
|
}
|
||||||
|
builders := make([]*AuthTokensCreate, rv.Len())
|
||||||
|
for i := 0; i < rv.Len(); i++ {
|
||||||
|
builders[i] = c.Create()
|
||||||
|
setFunc(builders[i], i)
|
||||||
|
}
|
||||||
|
return &AuthTokensCreateBulk{config: c.config, builders: builders}
|
||||||
|
}
|
||||||
|
|
||||||
// Update returns an update builder for AuthTokens.
|
// Update returns an update builder for AuthTokens.
|
||||||
func (c *AuthTokensClient) Update() *AuthTokensUpdate {
|
func (c *AuthTokensClient) Update() *AuthTokensUpdate {
|
||||||
mutation := newAuthTokensMutation(c.config, OpUpdate)
|
mutation := newAuthTokensMutation(c.config, OpUpdate)
|
||||||
|
@ -764,6 +818,21 @@ func (c *DocumentClient) CreateBulk(builders ...*DocumentCreate) *DocumentCreate
|
||||||
return &DocumentCreateBulk{config: c.config, builders: builders}
|
return &DocumentCreateBulk{config: c.config, builders: builders}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates
|
||||||
|
// a builder and applies setFunc on it.
|
||||||
|
func (c *DocumentClient) MapCreateBulk(slice any, setFunc func(*DocumentCreate, int)) *DocumentCreateBulk {
|
||||||
|
rv := reflect.ValueOf(slice)
|
||||||
|
if rv.Kind() != reflect.Slice {
|
||||||
|
return &DocumentCreateBulk{err: fmt.Errorf("calling to DocumentClient.MapCreateBulk with wrong type %T, need slice", slice)}
|
||||||
|
}
|
||||||
|
builders := make([]*DocumentCreate, rv.Len())
|
||||||
|
for i := 0; i < rv.Len(); i++ {
|
||||||
|
builders[i] = c.Create()
|
||||||
|
setFunc(builders[i], i)
|
||||||
|
}
|
||||||
|
return &DocumentCreateBulk{config: c.config, builders: builders}
|
||||||
|
}
|
||||||
|
|
||||||
// Update returns an update builder for Document.
|
// Update returns an update builder for Document.
|
||||||
func (c *DocumentClient) Update() *DocumentUpdate {
|
func (c *DocumentClient) Update() *DocumentUpdate {
|
||||||
mutation := newDocumentMutation(c.config, OpUpdate)
|
mutation := newDocumentMutation(c.config, OpUpdate)
|
||||||
|
@ -914,6 +983,21 @@ func (c *GroupClient) CreateBulk(builders ...*GroupCreate) *GroupCreateBulk {
|
||||||
return &GroupCreateBulk{config: c.config, builders: builders}
|
return &GroupCreateBulk{config: c.config, builders: builders}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates
|
||||||
|
// a builder and applies setFunc on it.
|
||||||
|
func (c *GroupClient) MapCreateBulk(slice any, setFunc func(*GroupCreate, int)) *GroupCreateBulk {
|
||||||
|
rv := reflect.ValueOf(slice)
|
||||||
|
if rv.Kind() != reflect.Slice {
|
||||||
|
return &GroupCreateBulk{err: fmt.Errorf("calling to GroupClient.MapCreateBulk with wrong type %T, need slice", slice)}
|
||||||
|
}
|
||||||
|
builders := make([]*GroupCreate, rv.Len())
|
||||||
|
for i := 0; i < rv.Len(); i++ {
|
||||||
|
builders[i] = c.Create()
|
||||||
|
setFunc(builders[i], i)
|
||||||
|
}
|
||||||
|
return &GroupCreateBulk{config: c.config, builders: builders}
|
||||||
|
}
|
||||||
|
|
||||||
// Update returns an update builder for Group.
|
// Update returns an update builder for Group.
|
||||||
func (c *GroupClient) Update() *GroupUpdate {
|
func (c *GroupClient) Update() *GroupUpdate {
|
||||||
mutation := newGroupMutation(c.config, OpUpdate)
|
mutation := newGroupMutation(c.config, OpUpdate)
|
||||||
|
@ -1144,6 +1228,21 @@ func (c *GroupInvitationTokenClient) CreateBulk(builders ...*GroupInvitationToke
|
||||||
return &GroupInvitationTokenCreateBulk{config: c.config, builders: builders}
|
return &GroupInvitationTokenCreateBulk{config: c.config, builders: builders}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates
|
||||||
|
// a builder and applies setFunc on it.
|
||||||
|
func (c *GroupInvitationTokenClient) MapCreateBulk(slice any, setFunc func(*GroupInvitationTokenCreate, int)) *GroupInvitationTokenCreateBulk {
|
||||||
|
rv := reflect.ValueOf(slice)
|
||||||
|
if rv.Kind() != reflect.Slice {
|
||||||
|
return &GroupInvitationTokenCreateBulk{err: fmt.Errorf("calling to GroupInvitationTokenClient.MapCreateBulk with wrong type %T, need slice", slice)}
|
||||||
|
}
|
||||||
|
builders := make([]*GroupInvitationTokenCreate, rv.Len())
|
||||||
|
for i := 0; i < rv.Len(); i++ {
|
||||||
|
builders[i] = c.Create()
|
||||||
|
setFunc(builders[i], i)
|
||||||
|
}
|
||||||
|
return &GroupInvitationTokenCreateBulk{config: c.config, builders: builders}
|
||||||
|
}
|
||||||
|
|
||||||
// Update returns an update builder for GroupInvitationToken.
|
// Update returns an update builder for GroupInvitationToken.
|
||||||
func (c *GroupInvitationTokenClient) Update() *GroupInvitationTokenUpdate {
|
func (c *GroupInvitationTokenClient) Update() *GroupInvitationTokenUpdate {
|
||||||
mutation := newGroupInvitationTokenMutation(c.config, OpUpdate)
|
mutation := newGroupInvitationTokenMutation(c.config, OpUpdate)
|
||||||
|
@ -1278,6 +1377,21 @@ func (c *ItemClient) CreateBulk(builders ...*ItemCreate) *ItemCreateBulk {
|
||||||
return &ItemCreateBulk{config: c.config, builders: builders}
|
return &ItemCreateBulk{config: c.config, builders: builders}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates
|
||||||
|
// a builder and applies setFunc on it.
|
||||||
|
func (c *ItemClient) MapCreateBulk(slice any, setFunc func(*ItemCreate, int)) *ItemCreateBulk {
|
||||||
|
rv := reflect.ValueOf(slice)
|
||||||
|
if rv.Kind() != reflect.Slice {
|
||||||
|
return &ItemCreateBulk{err: fmt.Errorf("calling to ItemClient.MapCreateBulk with wrong type %T, need slice", slice)}
|
||||||
|
}
|
||||||
|
builders := make([]*ItemCreate, rv.Len())
|
||||||
|
for i := 0; i < rv.Len(); i++ {
|
||||||
|
builders[i] = c.Create()
|
||||||
|
setFunc(builders[i], i)
|
||||||
|
}
|
||||||
|
return &ItemCreateBulk{config: c.config, builders: builders}
|
||||||
|
}
|
||||||
|
|
||||||
// Update returns an update builder for Item.
|
// Update returns an update builder for Item.
|
||||||
func (c *ItemClient) Update() *ItemUpdate {
|
func (c *ItemClient) Update() *ItemUpdate {
|
||||||
mutation := newItemMutation(c.config, OpUpdate)
|
mutation := newItemMutation(c.config, OpUpdate)
|
||||||
|
@ -1524,6 +1638,21 @@ func (c *ItemFieldClient) CreateBulk(builders ...*ItemFieldCreate) *ItemFieldCre
|
||||||
return &ItemFieldCreateBulk{config: c.config, builders: builders}
|
return &ItemFieldCreateBulk{config: c.config, builders: builders}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates
|
||||||
|
// a builder and applies setFunc on it.
|
||||||
|
func (c *ItemFieldClient) MapCreateBulk(slice any, setFunc func(*ItemFieldCreate, int)) *ItemFieldCreateBulk {
|
||||||
|
rv := reflect.ValueOf(slice)
|
||||||
|
if rv.Kind() != reflect.Slice {
|
||||||
|
return &ItemFieldCreateBulk{err: fmt.Errorf("calling to ItemFieldClient.MapCreateBulk with wrong type %T, need slice", slice)}
|
||||||
|
}
|
||||||
|
builders := make([]*ItemFieldCreate, rv.Len())
|
||||||
|
for i := 0; i < rv.Len(); i++ {
|
||||||
|
builders[i] = c.Create()
|
||||||
|
setFunc(builders[i], i)
|
||||||
|
}
|
||||||
|
return &ItemFieldCreateBulk{config: c.config, builders: builders}
|
||||||
|
}
|
||||||
|
|
||||||
// Update returns an update builder for ItemField.
|
// Update returns an update builder for ItemField.
|
||||||
func (c *ItemFieldClient) Update() *ItemFieldUpdate {
|
func (c *ItemFieldClient) Update() *ItemFieldUpdate {
|
||||||
mutation := newItemFieldMutation(c.config, OpUpdate)
|
mutation := newItemFieldMutation(c.config, OpUpdate)
|
||||||
|
@ -1658,6 +1787,21 @@ func (c *LabelClient) CreateBulk(builders ...*LabelCreate) *LabelCreateBulk {
|
||||||
return &LabelCreateBulk{config: c.config, builders: builders}
|
return &LabelCreateBulk{config: c.config, builders: builders}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates
|
||||||
|
// a builder and applies setFunc on it.
|
||||||
|
func (c *LabelClient) MapCreateBulk(slice any, setFunc func(*LabelCreate, int)) *LabelCreateBulk {
|
||||||
|
rv := reflect.ValueOf(slice)
|
||||||
|
if rv.Kind() != reflect.Slice {
|
||||||
|
return &LabelCreateBulk{err: fmt.Errorf("calling to LabelClient.MapCreateBulk with wrong type %T, need slice", slice)}
|
||||||
|
}
|
||||||
|
builders := make([]*LabelCreate, rv.Len())
|
||||||
|
for i := 0; i < rv.Len(); i++ {
|
||||||
|
builders[i] = c.Create()
|
||||||
|
setFunc(builders[i], i)
|
||||||
|
}
|
||||||
|
return &LabelCreateBulk{config: c.config, builders: builders}
|
||||||
|
}
|
||||||
|
|
||||||
// Update returns an update builder for Label.
|
// Update returns an update builder for Label.
|
||||||
func (c *LabelClient) Update() *LabelUpdate {
|
func (c *LabelClient) Update() *LabelUpdate {
|
||||||
mutation := newLabelMutation(c.config, OpUpdate)
|
mutation := newLabelMutation(c.config, OpUpdate)
|
||||||
|
@ -1808,6 +1952,21 @@ func (c *LocationClient) CreateBulk(builders ...*LocationCreate) *LocationCreate
|
||||||
return &LocationCreateBulk{config: c.config, builders: builders}
|
return &LocationCreateBulk{config: c.config, builders: builders}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates
|
||||||
|
// a builder and applies setFunc on it.
|
||||||
|
func (c *LocationClient) MapCreateBulk(slice any, setFunc func(*LocationCreate, int)) *LocationCreateBulk {
|
||||||
|
rv := reflect.ValueOf(slice)
|
||||||
|
if rv.Kind() != reflect.Slice {
|
||||||
|
return &LocationCreateBulk{err: fmt.Errorf("calling to LocationClient.MapCreateBulk with wrong type %T, need slice", slice)}
|
||||||
|
}
|
||||||
|
builders := make([]*LocationCreate, rv.Len())
|
||||||
|
for i := 0; i < rv.Len(); i++ {
|
||||||
|
builders[i] = c.Create()
|
||||||
|
setFunc(builders[i], i)
|
||||||
|
}
|
||||||
|
return &LocationCreateBulk{config: c.config, builders: builders}
|
||||||
|
}
|
||||||
|
|
||||||
// Update returns an update builder for Location.
|
// Update returns an update builder for Location.
|
||||||
func (c *LocationClient) Update() *LocationUpdate {
|
func (c *LocationClient) Update() *LocationUpdate {
|
||||||
mutation := newLocationMutation(c.config, OpUpdate)
|
mutation := newLocationMutation(c.config, OpUpdate)
|
||||||
|
@ -1990,6 +2149,21 @@ func (c *MaintenanceEntryClient) CreateBulk(builders ...*MaintenanceEntryCreate)
|
||||||
return &MaintenanceEntryCreateBulk{config: c.config, builders: builders}
|
return &MaintenanceEntryCreateBulk{config: c.config, builders: builders}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates
|
||||||
|
// a builder and applies setFunc on it.
|
||||||
|
func (c *MaintenanceEntryClient) MapCreateBulk(slice any, setFunc func(*MaintenanceEntryCreate, int)) *MaintenanceEntryCreateBulk {
|
||||||
|
rv := reflect.ValueOf(slice)
|
||||||
|
if rv.Kind() != reflect.Slice {
|
||||||
|
return &MaintenanceEntryCreateBulk{err: fmt.Errorf("calling to MaintenanceEntryClient.MapCreateBulk with wrong type %T, need slice", slice)}
|
||||||
|
}
|
||||||
|
builders := make([]*MaintenanceEntryCreate, rv.Len())
|
||||||
|
for i := 0; i < rv.Len(); i++ {
|
||||||
|
builders[i] = c.Create()
|
||||||
|
setFunc(builders[i], i)
|
||||||
|
}
|
||||||
|
return &MaintenanceEntryCreateBulk{config: c.config, builders: builders}
|
||||||
|
}
|
||||||
|
|
||||||
// Update returns an update builder for MaintenanceEntry.
|
// Update returns an update builder for MaintenanceEntry.
|
||||||
func (c *MaintenanceEntryClient) Update() *MaintenanceEntryUpdate {
|
func (c *MaintenanceEntryClient) Update() *MaintenanceEntryUpdate {
|
||||||
mutation := newMaintenanceEntryMutation(c.config, OpUpdate)
|
mutation := newMaintenanceEntryMutation(c.config, OpUpdate)
|
||||||
|
@ -2124,6 +2298,21 @@ func (c *NotifierClient) CreateBulk(builders ...*NotifierCreate) *NotifierCreate
|
||||||
return &NotifierCreateBulk{config: c.config, builders: builders}
|
return &NotifierCreateBulk{config: c.config, builders: builders}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates
|
||||||
|
// a builder and applies setFunc on it.
|
||||||
|
func (c *NotifierClient) MapCreateBulk(slice any, setFunc func(*NotifierCreate, int)) *NotifierCreateBulk {
|
||||||
|
rv := reflect.ValueOf(slice)
|
||||||
|
if rv.Kind() != reflect.Slice {
|
||||||
|
return &NotifierCreateBulk{err: fmt.Errorf("calling to NotifierClient.MapCreateBulk with wrong type %T, need slice", slice)}
|
||||||
|
}
|
||||||
|
builders := make([]*NotifierCreate, rv.Len())
|
||||||
|
for i := 0; i < rv.Len(); i++ {
|
||||||
|
builders[i] = c.Create()
|
||||||
|
setFunc(builders[i], i)
|
||||||
|
}
|
||||||
|
return &NotifierCreateBulk{config: c.config, builders: builders}
|
||||||
|
}
|
||||||
|
|
||||||
// Update returns an update builder for Notifier.
|
// Update returns an update builder for Notifier.
|
||||||
func (c *NotifierClient) Update() *NotifierUpdate {
|
func (c *NotifierClient) Update() *NotifierUpdate {
|
||||||
mutation := newNotifierMutation(c.config, OpUpdate)
|
mutation := newNotifierMutation(c.config, OpUpdate)
|
||||||
|
@ -2274,6 +2463,21 @@ func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk {
|
||||||
return &UserCreateBulk{config: c.config, builders: builders}
|
return &UserCreateBulk{config: c.config, builders: builders}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates
|
||||||
|
// a builder and applies setFunc on it.
|
||||||
|
func (c *UserClient) MapCreateBulk(slice any, setFunc func(*UserCreate, int)) *UserCreateBulk {
|
||||||
|
rv := reflect.ValueOf(slice)
|
||||||
|
if rv.Kind() != reflect.Slice {
|
||||||
|
return &UserCreateBulk{err: fmt.Errorf("calling to UserClient.MapCreateBulk with wrong type %T, need slice", slice)}
|
||||||
|
}
|
||||||
|
builders := make([]*UserCreate, rv.Len())
|
||||||
|
for i := 0; i < rv.Len(); i++ {
|
||||||
|
builders[i] = c.Create()
|
||||||
|
setFunc(builders[i], i)
|
||||||
|
}
|
||||||
|
return &UserCreateBulk{config: c.config, builders: builders}
|
||||||
|
}
|
||||||
|
|
||||||
// Update returns an update builder for User.
|
// Update returns an update builder for User.
|
||||||
func (c *UserClient) Update() *UserUpdate {
|
func (c *UserClient) Update() *UserUpdate {
|
||||||
mutation := newUserMutation(c.config, OpUpdate)
|
mutation := newUserMutation(c.config, OpUpdate)
|
||||||
|
|
|
@ -334,32 +334,15 @@ func HasAttachmentsWith(preds ...predicate.Attachment) predicate.Document {
|
||||||
|
|
||||||
// And groups predicates with the AND operator between them.
|
// And groups predicates with the AND operator between them.
|
||||||
func And(predicates ...predicate.Document) predicate.Document {
|
func And(predicates ...predicate.Document) predicate.Document {
|
||||||
return predicate.Document(func(s *sql.Selector) {
|
return predicate.Document(sql.AndPredicates(predicates...))
|
||||||
s1 := s.Clone().SetP(nil)
|
|
||||||
for _, p := range predicates {
|
|
||||||
p(s1)
|
|
||||||
}
|
|
||||||
s.Where(s1.P())
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Or groups predicates with the OR operator between them.
|
// Or groups predicates with the OR operator between them.
|
||||||
func Or(predicates ...predicate.Document) predicate.Document {
|
func Or(predicates ...predicate.Document) predicate.Document {
|
||||||
return predicate.Document(func(s *sql.Selector) {
|
return predicate.Document(sql.OrPredicates(predicates...))
|
||||||
s1 := s.Clone().SetP(nil)
|
|
||||||
for i, p := range predicates {
|
|
||||||
if i > 0 {
|
|
||||||
s1.Or()
|
|
||||||
}
|
|
||||||
p(s1)
|
|
||||||
}
|
|
||||||
s.Where(s1.P())
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Not applies the not operator on the given predicate.
|
// Not applies the not operator on the given predicate.
|
||||||
func Not(p predicate.Document) predicate.Document {
|
func Not(p predicate.Document) predicate.Document {
|
||||||
return predicate.Document(func(s *sql.Selector) {
|
return predicate.Document(sql.NotPredicates(p))
|
||||||
p(s.Not())
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -269,11 +269,15 @@ func (dc *DocumentCreate) createSpec() (*Document, *sqlgraph.CreateSpec) {
|
||||||
// DocumentCreateBulk is the builder for creating many Document entities in bulk.
|
// DocumentCreateBulk is the builder for creating many Document entities in bulk.
|
||||||
type DocumentCreateBulk struct {
|
type DocumentCreateBulk struct {
|
||||||
config
|
config
|
||||||
|
err error
|
||||||
builders []*DocumentCreate
|
builders []*DocumentCreate
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save creates the Document entities in the database.
|
// Save creates the Document entities in the database.
|
||||||
func (dcb *DocumentCreateBulk) Save(ctx context.Context) ([]*Document, error) {
|
func (dcb *DocumentCreateBulk) Save(ctx context.Context) ([]*Document, error) {
|
||||||
|
if dcb.err != nil {
|
||||||
|
return nil, dcb.err
|
||||||
|
}
|
||||||
specs := make([]*sqlgraph.CreateSpec, len(dcb.builders))
|
specs := make([]*sqlgraph.CreateSpec, len(dcb.builders))
|
||||||
nodes := make([]*Document, len(dcb.builders))
|
nodes := make([]*Document, len(dcb.builders))
|
||||||
mutators := make([]Mutator, len(dcb.builders))
|
mutators := make([]Mutator, len(dcb.builders))
|
||||||
|
|
|
@ -43,12 +43,28 @@ func (du *DocumentUpdate) SetTitle(s string) *DocumentUpdate {
|
||||||
return du
|
return du
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetNillableTitle sets the "title" field if the given value is not nil.
|
||||||
|
func (du *DocumentUpdate) SetNillableTitle(s *string) *DocumentUpdate {
|
||||||
|
if s != nil {
|
||||||
|
du.SetTitle(*s)
|
||||||
|
}
|
||||||
|
return du
|
||||||
|
}
|
||||||
|
|
||||||
// SetPath sets the "path" field.
|
// SetPath sets the "path" field.
|
||||||
func (du *DocumentUpdate) SetPath(s string) *DocumentUpdate {
|
func (du *DocumentUpdate) SetPath(s string) *DocumentUpdate {
|
||||||
du.mutation.SetPath(s)
|
du.mutation.SetPath(s)
|
||||||
return du
|
return du
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetNillablePath sets the "path" field if the given value is not nil.
|
||||||
|
func (du *DocumentUpdate) SetNillablePath(s *string) *DocumentUpdate {
|
||||||
|
if s != nil {
|
||||||
|
du.SetPath(*s)
|
||||||
|
}
|
||||||
|
return du
|
||||||
|
}
|
||||||
|
|
||||||
// SetGroupID sets the "group" edge to the Group entity by ID.
|
// SetGroupID sets the "group" edge to the Group entity by ID.
|
||||||
func (du *DocumentUpdate) SetGroupID(id uuid.UUID) *DocumentUpdate {
|
func (du *DocumentUpdate) SetGroupID(id uuid.UUID) *DocumentUpdate {
|
||||||
du.mutation.SetGroupID(id)
|
du.mutation.SetGroupID(id)
|
||||||
|
@ -288,12 +304,28 @@ func (duo *DocumentUpdateOne) SetTitle(s string) *DocumentUpdateOne {
|
||||||
return duo
|
return duo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetNillableTitle sets the "title" field if the given value is not nil.
|
||||||
|
func (duo *DocumentUpdateOne) SetNillableTitle(s *string) *DocumentUpdateOne {
|
||||||
|
if s != nil {
|
||||||
|
duo.SetTitle(*s)
|
||||||
|
}
|
||||||
|
return duo
|
||||||
|
}
|
||||||
|
|
||||||
// SetPath sets the "path" field.
|
// SetPath sets the "path" field.
|
||||||
func (duo *DocumentUpdateOne) SetPath(s string) *DocumentUpdateOne {
|
func (duo *DocumentUpdateOne) SetPath(s string) *DocumentUpdateOne {
|
||||||
duo.mutation.SetPath(s)
|
duo.mutation.SetPath(s)
|
||||||
return duo
|
return duo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetNillablePath sets the "path" field if the given value is not nil.
|
||||||
|
func (duo *DocumentUpdateOne) SetNillablePath(s *string) *DocumentUpdateOne {
|
||||||
|
if s != nil {
|
||||||
|
duo.SetPath(*s)
|
||||||
|
}
|
||||||
|
return duo
|
||||||
|
}
|
||||||
|
|
||||||
// SetGroupID sets the "group" edge to the Group entity by ID.
|
// SetGroupID sets the "group" edge to the Group entity by ID.
|
||||||
func (duo *DocumentUpdateOne) SetGroupID(id uuid.UUID) *DocumentUpdateOne {
|
func (duo *DocumentUpdateOne) SetGroupID(id uuid.UUID) *DocumentUpdateOne {
|
||||||
duo.mutation.SetGroupID(id)
|
duo.mutation.SetGroupID(id)
|
||||||
|
|
|
@ -399,32 +399,15 @@ func HasNotifiersWith(preds ...predicate.Notifier) predicate.Group {
|
||||||
|
|
||||||
// And groups predicates with the AND operator between them.
|
// And groups predicates with the AND operator between them.
|
||||||
func And(predicates ...predicate.Group) predicate.Group {
|
func And(predicates ...predicate.Group) predicate.Group {
|
||||||
return predicate.Group(func(s *sql.Selector) {
|
return predicate.Group(sql.AndPredicates(predicates...))
|
||||||
s1 := s.Clone().SetP(nil)
|
|
||||||
for _, p := range predicates {
|
|
||||||
p(s1)
|
|
||||||
}
|
|
||||||
s.Where(s1.P())
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Or groups predicates with the OR operator between them.
|
// Or groups predicates with the OR operator between them.
|
||||||
func Or(predicates ...predicate.Group) predicate.Group {
|
func Or(predicates ...predicate.Group) predicate.Group {
|
||||||
return predicate.Group(func(s *sql.Selector) {
|
return predicate.Group(sql.OrPredicates(predicates...))
|
||||||
s1 := s.Clone().SetP(nil)
|
|
||||||
for i, p := range predicates {
|
|
||||||
if i > 0 {
|
|
||||||
s1.Or()
|
|
||||||
}
|
|
||||||
p(s1)
|
|
||||||
}
|
|
||||||
s.Where(s1.P())
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Not applies the not operator on the given predicate.
|
// Not applies the not operator on the given predicate.
|
||||||
func Not(p predicate.Group) predicate.Group {
|
func Not(p predicate.Group) predicate.Group {
|
||||||
return predicate.Group(func(s *sql.Selector) {
|
return predicate.Group(sql.NotPredicates(p))
|
||||||
p(s.Not())
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -441,11 +441,15 @@ func (gc *GroupCreate) createSpec() (*Group, *sqlgraph.CreateSpec) {
|
||||||
// GroupCreateBulk is the builder for creating many Group entities in bulk.
|
// GroupCreateBulk is the builder for creating many Group entities in bulk.
|
||||||
type GroupCreateBulk struct {
|
type GroupCreateBulk struct {
|
||||||
config
|
config
|
||||||
|
err error
|
||||||
builders []*GroupCreate
|
builders []*GroupCreate
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save creates the Group entities in the database.
|
// Save creates the Group entities in the database.
|
||||||
func (gcb *GroupCreateBulk) Save(ctx context.Context) ([]*Group, error) {
|
func (gcb *GroupCreateBulk) Save(ctx context.Context) ([]*Group, error) {
|
||||||
|
if gcb.err != nil {
|
||||||
|
return nil, gcb.err
|
||||||
|
}
|
||||||
specs := make([]*sqlgraph.CreateSpec, len(gcb.builders))
|
specs := make([]*sqlgraph.CreateSpec, len(gcb.builders))
|
||||||
nodes := make([]*Group, len(gcb.builders))
|
nodes := make([]*Group, len(gcb.builders))
|
||||||
mutators := make([]Mutator, len(gcb.builders))
|
mutators := make([]Mutator, len(gcb.builders))
|
||||||
|
|
|
@ -48,6 +48,14 @@ func (gu *GroupUpdate) SetName(s string) *GroupUpdate {
|
||||||
return gu
|
return gu
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetNillableName sets the "name" field if the given value is not nil.
|
||||||
|
func (gu *GroupUpdate) SetNillableName(s *string) *GroupUpdate {
|
||||||
|
if s != nil {
|
||||||
|
gu.SetName(*s)
|
||||||
|
}
|
||||||
|
return gu
|
||||||
|
}
|
||||||
|
|
||||||
// SetCurrency sets the "currency" field.
|
// SetCurrency sets the "currency" field.
|
||||||
func (gu *GroupUpdate) SetCurrency(gr group.Currency) *GroupUpdate {
|
func (gu *GroupUpdate) SetCurrency(gr group.Currency) *GroupUpdate {
|
||||||
gu.mutation.SetCurrency(gr)
|
gu.mutation.SetCurrency(gr)
|
||||||
|
@ -738,6 +746,14 @@ func (guo *GroupUpdateOne) SetName(s string) *GroupUpdateOne {
|
||||||
return guo
|
return guo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetNillableName sets the "name" field if the given value is not nil.
|
||||||
|
func (guo *GroupUpdateOne) SetNillableName(s *string) *GroupUpdateOne {
|
||||||
|
if s != nil {
|
||||||
|
guo.SetName(*s)
|
||||||
|
}
|
||||||
|
return guo
|
||||||
|
}
|
||||||
|
|
||||||
// SetCurrency sets the "currency" field.
|
// SetCurrency sets the "currency" field.
|
||||||
func (guo *GroupUpdateOne) SetCurrency(gr group.Currency) *GroupUpdateOne {
|
func (guo *GroupUpdateOne) SetCurrency(gr group.Currency) *GroupUpdateOne {
|
||||||
guo.mutation.SetCurrency(gr)
|
guo.mutation.SetCurrency(gr)
|
||||||
|
|
|
@ -306,32 +306,15 @@ func HasGroupWith(preds ...predicate.Group) predicate.GroupInvitationToken {
|
||||||
|
|
||||||
// And groups predicates with the AND operator between them.
|
// And groups predicates with the AND operator between them.
|
||||||
func And(predicates ...predicate.GroupInvitationToken) predicate.GroupInvitationToken {
|
func And(predicates ...predicate.GroupInvitationToken) predicate.GroupInvitationToken {
|
||||||
return predicate.GroupInvitationToken(func(s *sql.Selector) {
|
return predicate.GroupInvitationToken(sql.AndPredicates(predicates...))
|
||||||
s1 := s.Clone().SetP(nil)
|
|
||||||
for _, p := range predicates {
|
|
||||||
p(s1)
|
|
||||||
}
|
|
||||||
s.Where(s1.P())
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Or groups predicates with the OR operator between them.
|
// Or groups predicates with the OR operator between them.
|
||||||
func Or(predicates ...predicate.GroupInvitationToken) predicate.GroupInvitationToken {
|
func Or(predicates ...predicate.GroupInvitationToken) predicate.GroupInvitationToken {
|
||||||
return predicate.GroupInvitationToken(func(s *sql.Selector) {
|
return predicate.GroupInvitationToken(sql.OrPredicates(predicates...))
|
||||||
s1 := s.Clone().SetP(nil)
|
|
||||||
for i, p := range predicates {
|
|
||||||
if i > 0 {
|
|
||||||
s1.Or()
|
|
||||||
}
|
|
||||||
p(s1)
|
|
||||||
}
|
|
||||||
s.Where(s1.P())
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Not applies the not operator on the given predicate.
|
// Not applies the not operator on the given predicate.
|
||||||
func Not(p predicate.GroupInvitationToken) predicate.GroupInvitationToken {
|
func Not(p predicate.GroupInvitationToken) predicate.GroupInvitationToken {
|
||||||
return predicate.GroupInvitationToken(func(s *sql.Selector) {
|
return predicate.GroupInvitationToken(sql.NotPredicates(p))
|
||||||
p(s.Not())
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -269,11 +269,15 @@ func (gitc *GroupInvitationTokenCreate) createSpec() (*GroupInvitationToken, *sq
|
||||||
// GroupInvitationTokenCreateBulk is the builder for creating many GroupInvitationToken entities in bulk.
|
// GroupInvitationTokenCreateBulk is the builder for creating many GroupInvitationToken entities in bulk.
|
||||||
type GroupInvitationTokenCreateBulk struct {
|
type GroupInvitationTokenCreateBulk struct {
|
||||||
config
|
config
|
||||||
|
err error
|
||||||
builders []*GroupInvitationTokenCreate
|
builders []*GroupInvitationTokenCreate
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save creates the GroupInvitationToken entities in the database.
|
// Save creates the GroupInvitationToken entities in the database.
|
||||||
func (gitcb *GroupInvitationTokenCreateBulk) Save(ctx context.Context) ([]*GroupInvitationToken, error) {
|
func (gitcb *GroupInvitationTokenCreateBulk) Save(ctx context.Context) ([]*GroupInvitationToken, error) {
|
||||||
|
if gitcb.err != nil {
|
||||||
|
return nil, gitcb.err
|
||||||
|
}
|
||||||
specs := make([]*sqlgraph.CreateSpec, len(gitcb.builders))
|
specs := make([]*sqlgraph.CreateSpec, len(gitcb.builders))
|
||||||
nodes := make([]*GroupInvitationToken, len(gitcb.builders))
|
nodes := make([]*GroupInvitationToken, len(gitcb.builders))
|
||||||
mutators := make([]Mutator, len(gitcb.builders))
|
mutators := make([]Mutator, len(gitcb.builders))
|
||||||
|
|
|
@ -1592,32 +1592,15 @@ func HasAttachmentsWith(preds ...predicate.Attachment) predicate.Item {
|
||||||
|
|
||||||
// And groups predicates with the AND operator between them.
|
// And groups predicates with the AND operator between them.
|
||||||
func And(predicates ...predicate.Item) predicate.Item {
|
func And(predicates ...predicate.Item) predicate.Item {
|
||||||
return predicate.Item(func(s *sql.Selector) {
|
return predicate.Item(sql.AndPredicates(predicates...))
|
||||||
s1 := s.Clone().SetP(nil)
|
|
||||||
for _, p := range predicates {
|
|
||||||
p(s1)
|
|
||||||
}
|
|
||||||
s.Where(s1.P())
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Or groups predicates with the OR operator between them.
|
// Or groups predicates with the OR operator between them.
|
||||||
func Or(predicates ...predicate.Item) predicate.Item {
|
func Or(predicates ...predicate.Item) predicate.Item {
|
||||||
return predicate.Item(func(s *sql.Selector) {
|
return predicate.Item(sql.OrPredicates(predicates...))
|
||||||
s1 := s.Clone().SetP(nil)
|
|
||||||
for i, p := range predicates {
|
|
||||||
if i > 0 {
|
|
||||||
s1.Or()
|
|
||||||
}
|
|
||||||
p(s1)
|
|
||||||
}
|
|
||||||
s.Where(s1.P())
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Not applies the not operator on the given predicate.
|
// Not applies the not operator on the given predicate.
|
||||||
func Not(p predicate.Item) predicate.Item {
|
func Not(p predicate.Item) predicate.Item {
|
||||||
return predicate.Item(func(s *sql.Selector) {
|
return predicate.Item(sql.NotPredicates(p))
|
||||||
p(s.Not())
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -900,11 +900,15 @@ func (ic *ItemCreate) createSpec() (*Item, *sqlgraph.CreateSpec) {
|
||||||
// ItemCreateBulk is the builder for creating many Item entities in bulk.
|
// ItemCreateBulk is the builder for creating many Item entities in bulk.
|
||||||
type ItemCreateBulk struct {
|
type ItemCreateBulk struct {
|
||||||
config
|
config
|
||||||
|
err error
|
||||||
builders []*ItemCreate
|
builders []*ItemCreate
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save creates the Item entities in the database.
|
// Save creates the Item entities in the database.
|
||||||
func (icb *ItemCreateBulk) Save(ctx context.Context) ([]*Item, error) {
|
func (icb *ItemCreateBulk) Save(ctx context.Context) ([]*Item, error) {
|
||||||
|
if icb.err != nil {
|
||||||
|
return nil, icb.err
|
||||||
|
}
|
||||||
specs := make([]*sqlgraph.CreateSpec, len(icb.builders))
|
specs := make([]*sqlgraph.CreateSpec, len(icb.builders))
|
||||||
nodes := make([]*Item, len(icb.builders))
|
nodes := make([]*Item, len(icb.builders))
|
||||||
mutators := make([]Mutator, len(icb.builders))
|
mutators := make([]Mutator, len(icb.builders))
|
||||||
|
|
|
@ -47,6 +47,14 @@ func (iu *ItemUpdate) SetName(s string) *ItemUpdate {
|
||||||
return iu
|
return iu
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetNillableName sets the "name" field if the given value is not nil.
|
||||||
|
func (iu *ItemUpdate) SetNillableName(s *string) *ItemUpdate {
|
||||||
|
if s != nil {
|
||||||
|
iu.SetName(*s)
|
||||||
|
}
|
||||||
|
return iu
|
||||||
|
}
|
||||||
|
|
||||||
// SetDescription sets the "description" field.
|
// SetDescription sets the "description" field.
|
||||||
func (iu *ItemUpdate) SetDescription(s string) *ItemUpdate {
|
func (iu *ItemUpdate) SetDescription(s string) *ItemUpdate {
|
||||||
iu.mutation.SetDescription(s)
|
iu.mutation.SetDescription(s)
|
||||||
|
@ -1247,6 +1255,14 @@ func (iuo *ItemUpdateOne) SetName(s string) *ItemUpdateOne {
|
||||||
return iuo
|
return iuo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetNillableName sets the "name" field if the given value is not nil.
|
||||||
|
func (iuo *ItemUpdateOne) SetNillableName(s *string) *ItemUpdateOne {
|
||||||
|
if s != nil {
|
||||||
|
iuo.SetName(*s)
|
||||||
|
}
|
||||||
|
return iuo
|
||||||
|
}
|
||||||
|
|
||||||
// SetDescription sets the "description" field.
|
// SetDescription sets the "description" field.
|
||||||
func (iuo *ItemUpdateOne) SetDescription(s string) *ItemUpdateOne {
|
func (iuo *ItemUpdateOne) SetDescription(s string) *ItemUpdateOne {
|
||||||
iuo.mutation.SetDescription(s)
|
iuo.mutation.SetDescription(s)
|
||||||
|
|
|
@ -536,32 +536,15 @@ func HasItemWith(preds ...predicate.Item) predicate.ItemField {
|
||||||
|
|
||||||
// And groups predicates with the AND operator between them.
|
// And groups predicates with the AND operator between them.
|
||||||
func And(predicates ...predicate.ItemField) predicate.ItemField {
|
func And(predicates ...predicate.ItemField) predicate.ItemField {
|
||||||
return predicate.ItemField(func(s *sql.Selector) {
|
return predicate.ItemField(sql.AndPredicates(predicates...))
|
||||||
s1 := s.Clone().SetP(nil)
|
|
||||||
for _, p := range predicates {
|
|
||||||
p(s1)
|
|
||||||
}
|
|
||||||
s.Where(s1.P())
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Or groups predicates with the OR operator between them.
|
// Or groups predicates with the OR operator between them.
|
||||||
func Or(predicates ...predicate.ItemField) predicate.ItemField {
|
func Or(predicates ...predicate.ItemField) predicate.ItemField {
|
||||||
return predicate.ItemField(func(s *sql.Selector) {
|
return predicate.ItemField(sql.OrPredicates(predicates...))
|
||||||
s1 := s.Clone().SetP(nil)
|
|
||||||
for i, p := range predicates {
|
|
||||||
if i > 0 {
|
|
||||||
s1.Or()
|
|
||||||
}
|
|
||||||
p(s1)
|
|
||||||
}
|
|
||||||
s.Where(s1.P())
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Not applies the not operator on the given predicate.
|
// Not applies the not operator on the given predicate.
|
||||||
func Not(p predicate.ItemField) predicate.ItemField {
|
func Not(p predicate.ItemField) predicate.ItemField {
|
||||||
return predicate.ItemField(func(s *sql.Selector) {
|
return predicate.ItemField(sql.NotPredicates(p))
|
||||||
p(s.Not())
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -356,11 +356,15 @@ func (ifc *ItemFieldCreate) createSpec() (*ItemField, *sqlgraph.CreateSpec) {
|
||||||
// ItemFieldCreateBulk is the builder for creating many ItemField entities in bulk.
|
// ItemFieldCreateBulk is the builder for creating many ItemField entities in bulk.
|
||||||
type ItemFieldCreateBulk struct {
|
type ItemFieldCreateBulk struct {
|
||||||
config
|
config
|
||||||
|
err error
|
||||||
builders []*ItemFieldCreate
|
builders []*ItemFieldCreate
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save creates the ItemField entities in the database.
|
// Save creates the ItemField entities in the database.
|
||||||
func (ifcb *ItemFieldCreateBulk) Save(ctx context.Context) ([]*ItemField, error) {
|
func (ifcb *ItemFieldCreateBulk) Save(ctx context.Context) ([]*ItemField, error) {
|
||||||
|
if ifcb.err != nil {
|
||||||
|
return nil, ifcb.err
|
||||||
|
}
|
||||||
specs := make([]*sqlgraph.CreateSpec, len(ifcb.builders))
|
specs := make([]*sqlgraph.CreateSpec, len(ifcb.builders))
|
||||||
nodes := make([]*ItemField, len(ifcb.builders))
|
nodes := make([]*ItemField, len(ifcb.builders))
|
||||||
mutators := make([]Mutator, len(ifcb.builders))
|
mutators := make([]Mutator, len(ifcb.builders))
|
||||||
|
|
|
@ -42,6 +42,14 @@ func (ifu *ItemFieldUpdate) SetName(s string) *ItemFieldUpdate {
|
||||||
return ifu
|
return ifu
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetNillableName sets the "name" field if the given value is not nil.
|
||||||
|
func (ifu *ItemFieldUpdate) SetNillableName(s *string) *ItemFieldUpdate {
|
||||||
|
if s != nil {
|
||||||
|
ifu.SetName(*s)
|
||||||
|
}
|
||||||
|
return ifu
|
||||||
|
}
|
||||||
|
|
||||||
// SetDescription sets the "description" field.
|
// SetDescription sets the "description" field.
|
||||||
func (ifu *ItemFieldUpdate) SetDescription(s string) *ItemFieldUpdate {
|
func (ifu *ItemFieldUpdate) SetDescription(s string) *ItemFieldUpdate {
|
||||||
ifu.mutation.SetDescription(s)
|
ifu.mutation.SetDescription(s)
|
||||||
|
@ -68,6 +76,14 @@ func (ifu *ItemFieldUpdate) SetType(i itemfield.Type) *ItemFieldUpdate {
|
||||||
return ifu
|
return ifu
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetNillableType sets the "type" field if the given value is not nil.
|
||||||
|
func (ifu *ItemFieldUpdate) SetNillableType(i *itemfield.Type) *ItemFieldUpdate {
|
||||||
|
if i != nil {
|
||||||
|
ifu.SetType(*i)
|
||||||
|
}
|
||||||
|
return ifu
|
||||||
|
}
|
||||||
|
|
||||||
// SetTextValue sets the "text_value" field.
|
// SetTextValue sets the "text_value" field.
|
||||||
func (ifu *ItemFieldUpdate) SetTextValue(s string) *ItemFieldUpdate {
|
func (ifu *ItemFieldUpdate) SetTextValue(s string) *ItemFieldUpdate {
|
||||||
ifu.mutation.SetTextValue(s)
|
ifu.mutation.SetTextValue(s)
|
||||||
|
@ -343,6 +359,14 @@ func (ifuo *ItemFieldUpdateOne) SetName(s string) *ItemFieldUpdateOne {
|
||||||
return ifuo
|
return ifuo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetNillableName sets the "name" field if the given value is not nil.
|
||||||
|
func (ifuo *ItemFieldUpdateOne) SetNillableName(s *string) *ItemFieldUpdateOne {
|
||||||
|
if s != nil {
|
||||||
|
ifuo.SetName(*s)
|
||||||
|
}
|
||||||
|
return ifuo
|
||||||
|
}
|
||||||
|
|
||||||
// SetDescription sets the "description" field.
|
// SetDescription sets the "description" field.
|
||||||
func (ifuo *ItemFieldUpdateOne) SetDescription(s string) *ItemFieldUpdateOne {
|
func (ifuo *ItemFieldUpdateOne) SetDescription(s string) *ItemFieldUpdateOne {
|
||||||
ifuo.mutation.SetDescription(s)
|
ifuo.mutation.SetDescription(s)
|
||||||
|
@ -369,6 +393,14 @@ func (ifuo *ItemFieldUpdateOne) SetType(i itemfield.Type) *ItemFieldUpdateOne {
|
||||||
return ifuo
|
return ifuo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetNillableType sets the "type" field if the given value is not nil.
|
||||||
|
func (ifuo *ItemFieldUpdateOne) SetNillableType(i *itemfield.Type) *ItemFieldUpdateOne {
|
||||||
|
if i != nil {
|
||||||
|
ifuo.SetType(*i)
|
||||||
|
}
|
||||||
|
return ifuo
|
||||||
|
}
|
||||||
|
|
||||||
// SetTextValue sets the "text_value" field.
|
// SetTextValue sets the "text_value" field.
|
||||||
func (ifuo *ItemFieldUpdateOne) SetTextValue(s string) *ItemFieldUpdateOne {
|
func (ifuo *ItemFieldUpdateOne) SetTextValue(s string) *ItemFieldUpdateOne {
|
||||||
ifuo.mutation.SetTextValue(s)
|
ifuo.mutation.SetTextValue(s)
|
||||||
|
|
|
@ -424,32 +424,15 @@ func HasItemsWith(preds ...predicate.Item) predicate.Label {
|
||||||
|
|
||||||
// And groups predicates with the AND operator between them.
|
// And groups predicates with the AND operator between them.
|
||||||
func And(predicates ...predicate.Label) predicate.Label {
|
func And(predicates ...predicate.Label) predicate.Label {
|
||||||
return predicate.Label(func(s *sql.Selector) {
|
return predicate.Label(sql.AndPredicates(predicates...))
|
||||||
s1 := s.Clone().SetP(nil)
|
|
||||||
for _, p := range predicates {
|
|
||||||
p(s1)
|
|
||||||
}
|
|
||||||
s.Where(s1.P())
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Or groups predicates with the OR operator between them.
|
// Or groups predicates with the OR operator between them.
|
||||||
func Or(predicates ...predicate.Label) predicate.Label {
|
func Or(predicates ...predicate.Label) predicate.Label {
|
||||||
return predicate.Label(func(s *sql.Selector) {
|
return predicate.Label(sql.OrPredicates(predicates...))
|
||||||
s1 := s.Clone().SetP(nil)
|
|
||||||
for i, p := range predicates {
|
|
||||||
if i > 0 {
|
|
||||||
s1.Or()
|
|
||||||
}
|
|
||||||
p(s1)
|
|
||||||
}
|
|
||||||
s.Where(s1.P())
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Not applies the not operator on the given predicate.
|
// Not applies the not operator on the given predicate.
|
||||||
func Not(p predicate.Label) predicate.Label {
|
func Not(p predicate.Label) predicate.Label {
|
||||||
return predicate.Label(func(s *sql.Selector) {
|
return predicate.Label(sql.NotPredicates(p))
|
||||||
p(s.Not())
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -297,11 +297,15 @@ func (lc *LabelCreate) createSpec() (*Label, *sqlgraph.CreateSpec) {
|
||||||
// LabelCreateBulk is the builder for creating many Label entities in bulk.
|
// LabelCreateBulk is the builder for creating many Label entities in bulk.
|
||||||
type LabelCreateBulk struct {
|
type LabelCreateBulk struct {
|
||||||
config
|
config
|
||||||
|
err error
|
||||||
builders []*LabelCreate
|
builders []*LabelCreate
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save creates the Label entities in the database.
|
// Save creates the Label entities in the database.
|
||||||
func (lcb *LabelCreateBulk) Save(ctx context.Context) ([]*Label, error) {
|
func (lcb *LabelCreateBulk) Save(ctx context.Context) ([]*Label, error) {
|
||||||
|
if lcb.err != nil {
|
||||||
|
return nil, lcb.err
|
||||||
|
}
|
||||||
specs := make([]*sqlgraph.CreateSpec, len(lcb.builders))
|
specs := make([]*sqlgraph.CreateSpec, len(lcb.builders))
|
||||||
nodes := make([]*Label, len(lcb.builders))
|
nodes := make([]*Label, len(lcb.builders))
|
||||||
mutators := make([]Mutator, len(lcb.builders))
|
mutators := make([]Mutator, len(lcb.builders))
|
||||||
|
|
|
@ -43,6 +43,14 @@ func (lu *LabelUpdate) SetName(s string) *LabelUpdate {
|
||||||
return lu
|
return lu
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetNillableName sets the "name" field if the given value is not nil.
|
||||||
|
func (lu *LabelUpdate) SetNillableName(s *string) *LabelUpdate {
|
||||||
|
if s != nil {
|
||||||
|
lu.SetName(*s)
|
||||||
|
}
|
||||||
|
return lu
|
||||||
|
}
|
||||||
|
|
||||||
// SetDescription sets the "description" field.
|
// SetDescription sets the "description" field.
|
||||||
func (lu *LabelUpdate) SetDescription(s string) *LabelUpdate {
|
func (lu *LabelUpdate) SetDescription(s string) *LabelUpdate {
|
||||||
lu.mutation.SetDescription(s)
|
lu.mutation.SetDescription(s)
|
||||||
|
@ -336,6 +344,14 @@ func (luo *LabelUpdateOne) SetName(s string) *LabelUpdateOne {
|
||||||
return luo
|
return luo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetNillableName sets the "name" field if the given value is not nil.
|
||||||
|
func (luo *LabelUpdateOne) SetNillableName(s *string) *LabelUpdateOne {
|
||||||
|
if s != nil {
|
||||||
|
luo.SetName(*s)
|
||||||
|
}
|
||||||
|
return luo
|
||||||
|
}
|
||||||
|
|
||||||
// SetDescription sets the "description" field.
|
// SetDescription sets the "description" field.
|
||||||
func (luo *LabelUpdateOne) SetDescription(s string) *LabelUpdateOne {
|
func (luo *LabelUpdateOne) SetDescription(s string) *LabelUpdateOne {
|
||||||
luo.mutation.SetDescription(s)
|
luo.mutation.SetDescription(s)
|
||||||
|
|
|
@ -390,32 +390,15 @@ func HasItemsWith(preds ...predicate.Item) predicate.Location {
|
||||||
|
|
||||||
// And groups predicates with the AND operator between them.
|
// And groups predicates with the AND operator between them.
|
||||||
func And(predicates ...predicate.Location) predicate.Location {
|
func And(predicates ...predicate.Location) predicate.Location {
|
||||||
return predicate.Location(func(s *sql.Selector) {
|
return predicate.Location(sql.AndPredicates(predicates...))
|
||||||
s1 := s.Clone().SetP(nil)
|
|
||||||
for _, p := range predicates {
|
|
||||||
p(s1)
|
|
||||||
}
|
|
||||||
s.Where(s1.P())
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Or groups predicates with the OR operator between them.
|
// Or groups predicates with the OR operator between them.
|
||||||
func Or(predicates ...predicate.Location) predicate.Location {
|
func Or(predicates ...predicate.Location) predicate.Location {
|
||||||
return predicate.Location(func(s *sql.Selector) {
|
return predicate.Location(sql.OrPredicates(predicates...))
|
||||||
s1 := s.Clone().SetP(nil)
|
|
||||||
for i, p := range predicates {
|
|
||||||
if i > 0 {
|
|
||||||
s1.Or()
|
|
||||||
}
|
|
||||||
p(s1)
|
|
||||||
}
|
|
||||||
s.Where(s1.P())
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Not applies the not operator on the given predicate.
|
// Not applies the not operator on the given predicate.
|
||||||
func Not(p predicate.Location) predicate.Location {
|
func Not(p predicate.Location) predicate.Location {
|
||||||
return predicate.Location(func(s *sql.Selector) {
|
return predicate.Location(sql.NotPredicates(p))
|
||||||
p(s.Not())
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -341,11 +341,15 @@ func (lc *LocationCreate) createSpec() (*Location, *sqlgraph.CreateSpec) {
|
||||||
// LocationCreateBulk is the builder for creating many Location entities in bulk.
|
// LocationCreateBulk is the builder for creating many Location entities in bulk.
|
||||||
type LocationCreateBulk struct {
|
type LocationCreateBulk struct {
|
||||||
config
|
config
|
||||||
|
err error
|
||||||
builders []*LocationCreate
|
builders []*LocationCreate
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save creates the Location entities in the database.
|
// Save creates the Location entities in the database.
|
||||||
func (lcb *LocationCreateBulk) Save(ctx context.Context) ([]*Location, error) {
|
func (lcb *LocationCreateBulk) Save(ctx context.Context) ([]*Location, error) {
|
||||||
|
if lcb.err != nil {
|
||||||
|
return nil, lcb.err
|
||||||
|
}
|
||||||
specs := make([]*sqlgraph.CreateSpec, len(lcb.builders))
|
specs := make([]*sqlgraph.CreateSpec, len(lcb.builders))
|
||||||
nodes := make([]*Location, len(lcb.builders))
|
nodes := make([]*Location, len(lcb.builders))
|
||||||
mutators := make([]Mutator, len(lcb.builders))
|
mutators := make([]Mutator, len(lcb.builders))
|
||||||
|
|
|
@ -43,6 +43,14 @@ func (lu *LocationUpdate) SetName(s string) *LocationUpdate {
|
||||||
return lu
|
return lu
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetNillableName sets the "name" field if the given value is not nil.
|
||||||
|
func (lu *LocationUpdate) SetNillableName(s *string) *LocationUpdate {
|
||||||
|
if s != nil {
|
||||||
|
lu.SetName(*s)
|
||||||
|
}
|
||||||
|
return lu
|
||||||
|
}
|
||||||
|
|
||||||
// SetDescription sets the "description" field.
|
// SetDescription sets the "description" field.
|
||||||
func (lu *LocationUpdate) SetDescription(s string) *LocationUpdate {
|
func (lu *LocationUpdate) SetDescription(s string) *LocationUpdate {
|
||||||
lu.mutation.SetDescription(s)
|
lu.mutation.SetDescription(s)
|
||||||
|
@ -440,6 +448,14 @@ func (luo *LocationUpdateOne) SetName(s string) *LocationUpdateOne {
|
||||||
return luo
|
return luo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetNillableName sets the "name" field if the given value is not nil.
|
||||||
|
func (luo *LocationUpdateOne) SetNillableName(s *string) *LocationUpdateOne {
|
||||||
|
if s != nil {
|
||||||
|
luo.SetName(*s)
|
||||||
|
}
|
||||||
|
return luo
|
||||||
|
}
|
||||||
|
|
||||||
// SetDescription sets the "description" field.
|
// SetDescription sets the "description" field.
|
||||||
func (luo *LocationUpdateOne) SetDescription(s string) *LocationUpdateOne {
|
func (luo *LocationUpdateOne) SetDescription(s string) *LocationUpdateOne {
|
||||||
luo.mutation.SetDescription(s)
|
luo.mutation.SetDescription(s)
|
||||||
|
|
|
@ -501,32 +501,15 @@ func HasItemWith(preds ...predicate.Item) predicate.MaintenanceEntry {
|
||||||
|
|
||||||
// And groups predicates with the AND operator between them.
|
// And groups predicates with the AND operator between them.
|
||||||
func And(predicates ...predicate.MaintenanceEntry) predicate.MaintenanceEntry {
|
func And(predicates ...predicate.MaintenanceEntry) predicate.MaintenanceEntry {
|
||||||
return predicate.MaintenanceEntry(func(s *sql.Selector) {
|
return predicate.MaintenanceEntry(sql.AndPredicates(predicates...))
|
||||||
s1 := s.Clone().SetP(nil)
|
|
||||||
for _, p := range predicates {
|
|
||||||
p(s1)
|
|
||||||
}
|
|
||||||
s.Where(s1.P())
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Or groups predicates with the OR operator between them.
|
// Or groups predicates with the OR operator between them.
|
||||||
func Or(predicates ...predicate.MaintenanceEntry) predicate.MaintenanceEntry {
|
func Or(predicates ...predicate.MaintenanceEntry) predicate.MaintenanceEntry {
|
||||||
return predicate.MaintenanceEntry(func(s *sql.Selector) {
|
return predicate.MaintenanceEntry(sql.OrPredicates(predicates...))
|
||||||
s1 := s.Clone().SetP(nil)
|
|
||||||
for i, p := range predicates {
|
|
||||||
if i > 0 {
|
|
||||||
s1.Or()
|
|
||||||
}
|
|
||||||
p(s1)
|
|
||||||
}
|
|
||||||
s.Where(s1.P())
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Not applies the not operator on the given predicate.
|
// Not applies the not operator on the given predicate.
|
||||||
func Not(p predicate.MaintenanceEntry) predicate.MaintenanceEntry {
|
func Not(p predicate.MaintenanceEntry) predicate.MaintenanceEntry {
|
||||||
return predicate.MaintenanceEntry(func(s *sql.Selector) {
|
return predicate.MaintenanceEntry(sql.NotPredicates(p))
|
||||||
p(s.Not())
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -306,11 +306,15 @@ func (mec *MaintenanceEntryCreate) createSpec() (*MaintenanceEntry, *sqlgraph.Cr
|
||||||
// MaintenanceEntryCreateBulk is the builder for creating many MaintenanceEntry entities in bulk.
|
// MaintenanceEntryCreateBulk is the builder for creating many MaintenanceEntry entities in bulk.
|
||||||
type MaintenanceEntryCreateBulk struct {
|
type MaintenanceEntryCreateBulk struct {
|
||||||
config
|
config
|
||||||
|
err error
|
||||||
builders []*MaintenanceEntryCreate
|
builders []*MaintenanceEntryCreate
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save creates the MaintenanceEntry entities in the database.
|
// Save creates the MaintenanceEntry entities in the database.
|
||||||
func (mecb *MaintenanceEntryCreateBulk) Save(ctx context.Context) ([]*MaintenanceEntry, error) {
|
func (mecb *MaintenanceEntryCreateBulk) Save(ctx context.Context) ([]*MaintenanceEntry, error) {
|
||||||
|
if mecb.err != nil {
|
||||||
|
return nil, mecb.err
|
||||||
|
}
|
||||||
specs := make([]*sqlgraph.CreateSpec, len(mecb.builders))
|
specs := make([]*sqlgraph.CreateSpec, len(mecb.builders))
|
||||||
nodes := make([]*MaintenanceEntry, len(mecb.builders))
|
nodes := make([]*MaintenanceEntry, len(mecb.builders))
|
||||||
mutators := make([]Mutator, len(mecb.builders))
|
mutators := make([]Mutator, len(mecb.builders))
|
||||||
|
|
|
@ -42,6 +42,14 @@ func (meu *MaintenanceEntryUpdate) SetItemID(u uuid.UUID) *MaintenanceEntryUpdat
|
||||||
return meu
|
return meu
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetNillableItemID sets the "item_id" field if the given value is not nil.
|
||||||
|
func (meu *MaintenanceEntryUpdate) SetNillableItemID(u *uuid.UUID) *MaintenanceEntryUpdate {
|
||||||
|
if u != nil {
|
||||||
|
meu.SetItemID(*u)
|
||||||
|
}
|
||||||
|
return meu
|
||||||
|
}
|
||||||
|
|
||||||
// SetDate sets the "date" field.
|
// SetDate sets the "date" field.
|
||||||
func (meu *MaintenanceEntryUpdate) SetDate(t time.Time) *MaintenanceEntryUpdate {
|
func (meu *MaintenanceEntryUpdate) SetDate(t time.Time) *MaintenanceEntryUpdate {
|
||||||
meu.mutation.SetDate(t)
|
meu.mutation.SetDate(t)
|
||||||
|
@ -88,6 +96,14 @@ func (meu *MaintenanceEntryUpdate) SetName(s string) *MaintenanceEntryUpdate {
|
||||||
return meu
|
return meu
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetNillableName sets the "name" field if the given value is not nil.
|
||||||
|
func (meu *MaintenanceEntryUpdate) SetNillableName(s *string) *MaintenanceEntryUpdate {
|
||||||
|
if s != nil {
|
||||||
|
meu.SetName(*s)
|
||||||
|
}
|
||||||
|
return meu
|
||||||
|
}
|
||||||
|
|
||||||
// SetDescription sets the "description" field.
|
// SetDescription sets the "description" field.
|
||||||
func (meu *MaintenanceEntryUpdate) SetDescription(s string) *MaintenanceEntryUpdate {
|
func (meu *MaintenanceEntryUpdate) SetDescription(s string) *MaintenanceEntryUpdate {
|
||||||
meu.mutation.SetDescription(s)
|
meu.mutation.SetDescription(s)
|
||||||
|
@ -302,6 +318,14 @@ func (meuo *MaintenanceEntryUpdateOne) SetItemID(u uuid.UUID) *MaintenanceEntryU
|
||||||
return meuo
|
return meuo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetNillableItemID sets the "item_id" field if the given value is not nil.
|
||||||
|
func (meuo *MaintenanceEntryUpdateOne) SetNillableItemID(u *uuid.UUID) *MaintenanceEntryUpdateOne {
|
||||||
|
if u != nil {
|
||||||
|
meuo.SetItemID(*u)
|
||||||
|
}
|
||||||
|
return meuo
|
||||||
|
}
|
||||||
|
|
||||||
// SetDate sets the "date" field.
|
// SetDate sets the "date" field.
|
||||||
func (meuo *MaintenanceEntryUpdateOne) SetDate(t time.Time) *MaintenanceEntryUpdateOne {
|
func (meuo *MaintenanceEntryUpdateOne) SetDate(t time.Time) *MaintenanceEntryUpdateOne {
|
||||||
meuo.mutation.SetDate(t)
|
meuo.mutation.SetDate(t)
|
||||||
|
@ -348,6 +372,14 @@ func (meuo *MaintenanceEntryUpdateOne) SetName(s string) *MaintenanceEntryUpdate
|
||||||
return meuo
|
return meuo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetNillableName sets the "name" field if the given value is not nil.
|
||||||
|
func (meuo *MaintenanceEntryUpdateOne) SetNillableName(s *string) *MaintenanceEntryUpdateOne {
|
||||||
|
if s != nil {
|
||||||
|
meuo.SetName(*s)
|
||||||
|
}
|
||||||
|
return meuo
|
||||||
|
}
|
||||||
|
|
||||||
// SetDescription sets the "description" field.
|
// SetDescription sets the "description" field.
|
||||||
func (meuo *MaintenanceEntryUpdateOne) SetDescription(s string) *MaintenanceEntryUpdateOne {
|
func (meuo *MaintenanceEntryUpdateOne) SetDescription(s string) *MaintenanceEntryUpdateOne {
|
||||||
meuo.mutation.SetDescription(s)
|
meuo.mutation.SetDescription(s)
|
||||||
|
|
|
@ -9529,6 +9529,7 @@ func (m *MaintenanceEntryMutation) ResetCost() {
|
||||||
// ClearItem clears the "item" edge to the Item entity.
|
// ClearItem clears the "item" edge to the Item entity.
|
||||||
func (m *MaintenanceEntryMutation) ClearItem() {
|
func (m *MaintenanceEntryMutation) ClearItem() {
|
||||||
m.cleareditem = true
|
m.cleareditem = true
|
||||||
|
m.clearedFields[maintenanceentry.FieldItemID] = struct{}{}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ItemCleared reports if the "item" edge to the Item entity was cleared.
|
// ItemCleared reports if the "item" edge to the Item entity was cleared.
|
||||||
|
@ -10292,6 +10293,7 @@ func (m *NotifierMutation) ResetIsActive() {
|
||||||
// ClearGroup clears the "group" edge to the Group entity.
|
// ClearGroup clears the "group" edge to the Group entity.
|
||||||
func (m *NotifierMutation) ClearGroup() {
|
func (m *NotifierMutation) ClearGroup() {
|
||||||
m.clearedgroup = true
|
m.clearedgroup = true
|
||||||
|
m.clearedFields[notifier.FieldGroupID] = struct{}{}
|
||||||
}
|
}
|
||||||
|
|
||||||
// GroupCleared reports if the "group" edge to the Group entity was cleared.
|
// GroupCleared reports if the "group" edge to the Group entity was cleared.
|
||||||
|
@ -10318,6 +10320,7 @@ func (m *NotifierMutation) ResetGroup() {
|
||||||
// ClearUser clears the "user" edge to the User entity.
|
// ClearUser clears the "user" edge to the User entity.
|
||||||
func (m *NotifierMutation) ClearUser() {
|
func (m *NotifierMutation) ClearUser() {
|
||||||
m.cleareduser = true
|
m.cleareduser = true
|
||||||
|
m.clearedFields[notifier.FieldUserID] = struct{}{}
|
||||||
}
|
}
|
||||||
|
|
||||||
// UserCleared reports if the "user" edge to the User entity was cleared.
|
// UserCleared reports if the "user" edge to the User entity was cleared.
|
||||||
|
|
|
@ -399,32 +399,15 @@ func HasUserWith(preds ...predicate.User) predicate.Notifier {
|
||||||
|
|
||||||
// And groups predicates with the AND operator between them.
|
// And groups predicates with the AND operator between them.
|
||||||
func And(predicates ...predicate.Notifier) predicate.Notifier {
|
func And(predicates ...predicate.Notifier) predicate.Notifier {
|
||||||
return predicate.Notifier(func(s *sql.Selector) {
|
return predicate.Notifier(sql.AndPredicates(predicates...))
|
||||||
s1 := s.Clone().SetP(nil)
|
|
||||||
for _, p := range predicates {
|
|
||||||
p(s1)
|
|
||||||
}
|
|
||||||
s.Where(s1.P())
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Or groups predicates with the OR operator between them.
|
// Or groups predicates with the OR operator between them.
|
||||||
func Or(predicates ...predicate.Notifier) predicate.Notifier {
|
func Or(predicates ...predicate.Notifier) predicate.Notifier {
|
||||||
return predicate.Notifier(func(s *sql.Selector) {
|
return predicate.Notifier(sql.OrPredicates(predicates...))
|
||||||
s1 := s.Clone().SetP(nil)
|
|
||||||
for i, p := range predicates {
|
|
||||||
if i > 0 {
|
|
||||||
s1.Or()
|
|
||||||
}
|
|
||||||
p(s1)
|
|
||||||
}
|
|
||||||
s.Where(s1.P())
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Not applies the not operator on the given predicate.
|
// Not applies the not operator on the given predicate.
|
||||||
func Not(p predicate.Notifier) predicate.Notifier {
|
func Not(p predicate.Notifier) predicate.Notifier {
|
||||||
return predicate.Notifier(func(s *sql.Selector) {
|
return predicate.Notifier(sql.NotPredicates(p))
|
||||||
p(s.Not())
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -300,11 +300,15 @@ func (nc *NotifierCreate) createSpec() (*Notifier, *sqlgraph.CreateSpec) {
|
||||||
// NotifierCreateBulk is the builder for creating many Notifier entities in bulk.
|
// NotifierCreateBulk is the builder for creating many Notifier entities in bulk.
|
||||||
type NotifierCreateBulk struct {
|
type NotifierCreateBulk struct {
|
||||||
config
|
config
|
||||||
|
err error
|
||||||
builders []*NotifierCreate
|
builders []*NotifierCreate
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save creates the Notifier entities in the database.
|
// Save creates the Notifier entities in the database.
|
||||||
func (ncb *NotifierCreateBulk) Save(ctx context.Context) ([]*Notifier, error) {
|
func (ncb *NotifierCreateBulk) Save(ctx context.Context) ([]*Notifier, error) {
|
||||||
|
if ncb.err != nil {
|
||||||
|
return nil, ncb.err
|
||||||
|
}
|
||||||
specs := make([]*sqlgraph.CreateSpec, len(ncb.builders))
|
specs := make([]*sqlgraph.CreateSpec, len(ncb.builders))
|
||||||
nodes := make([]*Notifier, len(ncb.builders))
|
nodes := make([]*Notifier, len(ncb.builders))
|
||||||
mutators := make([]Mutator, len(ncb.builders))
|
mutators := make([]Mutator, len(ncb.builders))
|
||||||
|
|
|
@ -43,24 +43,56 @@ func (nu *NotifierUpdate) SetGroupID(u uuid.UUID) *NotifierUpdate {
|
||||||
return nu
|
return nu
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetNillableGroupID sets the "group_id" field if the given value is not nil.
|
||||||
|
func (nu *NotifierUpdate) SetNillableGroupID(u *uuid.UUID) *NotifierUpdate {
|
||||||
|
if u != nil {
|
||||||
|
nu.SetGroupID(*u)
|
||||||
|
}
|
||||||
|
return nu
|
||||||
|
}
|
||||||
|
|
||||||
// SetUserID sets the "user_id" field.
|
// SetUserID sets the "user_id" field.
|
||||||
func (nu *NotifierUpdate) SetUserID(u uuid.UUID) *NotifierUpdate {
|
func (nu *NotifierUpdate) SetUserID(u uuid.UUID) *NotifierUpdate {
|
||||||
nu.mutation.SetUserID(u)
|
nu.mutation.SetUserID(u)
|
||||||
return nu
|
return nu
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetNillableUserID sets the "user_id" field if the given value is not nil.
|
||||||
|
func (nu *NotifierUpdate) SetNillableUserID(u *uuid.UUID) *NotifierUpdate {
|
||||||
|
if u != nil {
|
||||||
|
nu.SetUserID(*u)
|
||||||
|
}
|
||||||
|
return nu
|
||||||
|
}
|
||||||
|
|
||||||
// SetName sets the "name" field.
|
// SetName sets the "name" field.
|
||||||
func (nu *NotifierUpdate) SetName(s string) *NotifierUpdate {
|
func (nu *NotifierUpdate) SetName(s string) *NotifierUpdate {
|
||||||
nu.mutation.SetName(s)
|
nu.mutation.SetName(s)
|
||||||
return nu
|
return nu
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetNillableName sets the "name" field if the given value is not nil.
|
||||||
|
func (nu *NotifierUpdate) SetNillableName(s *string) *NotifierUpdate {
|
||||||
|
if s != nil {
|
||||||
|
nu.SetName(*s)
|
||||||
|
}
|
||||||
|
return nu
|
||||||
|
}
|
||||||
|
|
||||||
// SetURL sets the "url" field.
|
// SetURL sets the "url" field.
|
||||||
func (nu *NotifierUpdate) SetURL(s string) *NotifierUpdate {
|
func (nu *NotifierUpdate) SetURL(s string) *NotifierUpdate {
|
||||||
nu.mutation.SetURL(s)
|
nu.mutation.SetURL(s)
|
||||||
return nu
|
return nu
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetNillableURL sets the "url" field if the given value is not nil.
|
||||||
|
func (nu *NotifierUpdate) SetNillableURL(s *string) *NotifierUpdate {
|
||||||
|
if s != nil {
|
||||||
|
nu.SetURL(*s)
|
||||||
|
}
|
||||||
|
return nu
|
||||||
|
}
|
||||||
|
|
||||||
// SetIsActive sets the "is_active" field.
|
// SetIsActive sets the "is_active" field.
|
||||||
func (nu *NotifierUpdate) SetIsActive(b bool) *NotifierUpdate {
|
func (nu *NotifierUpdate) SetIsActive(b bool) *NotifierUpdate {
|
||||||
nu.mutation.SetIsActive(b)
|
nu.mutation.SetIsActive(b)
|
||||||
|
@ -273,24 +305,56 @@ func (nuo *NotifierUpdateOne) SetGroupID(u uuid.UUID) *NotifierUpdateOne {
|
||||||
return nuo
|
return nuo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetNillableGroupID sets the "group_id" field if the given value is not nil.
|
||||||
|
func (nuo *NotifierUpdateOne) SetNillableGroupID(u *uuid.UUID) *NotifierUpdateOne {
|
||||||
|
if u != nil {
|
||||||
|
nuo.SetGroupID(*u)
|
||||||
|
}
|
||||||
|
return nuo
|
||||||
|
}
|
||||||
|
|
||||||
// SetUserID sets the "user_id" field.
|
// SetUserID sets the "user_id" field.
|
||||||
func (nuo *NotifierUpdateOne) SetUserID(u uuid.UUID) *NotifierUpdateOne {
|
func (nuo *NotifierUpdateOne) SetUserID(u uuid.UUID) *NotifierUpdateOne {
|
||||||
nuo.mutation.SetUserID(u)
|
nuo.mutation.SetUserID(u)
|
||||||
return nuo
|
return nuo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetNillableUserID sets the "user_id" field if the given value is not nil.
|
||||||
|
func (nuo *NotifierUpdateOne) SetNillableUserID(u *uuid.UUID) *NotifierUpdateOne {
|
||||||
|
if u != nil {
|
||||||
|
nuo.SetUserID(*u)
|
||||||
|
}
|
||||||
|
return nuo
|
||||||
|
}
|
||||||
|
|
||||||
// SetName sets the "name" field.
|
// SetName sets the "name" field.
|
||||||
func (nuo *NotifierUpdateOne) SetName(s string) *NotifierUpdateOne {
|
func (nuo *NotifierUpdateOne) SetName(s string) *NotifierUpdateOne {
|
||||||
nuo.mutation.SetName(s)
|
nuo.mutation.SetName(s)
|
||||||
return nuo
|
return nuo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetNillableName sets the "name" field if the given value is not nil.
|
||||||
|
func (nuo *NotifierUpdateOne) SetNillableName(s *string) *NotifierUpdateOne {
|
||||||
|
if s != nil {
|
||||||
|
nuo.SetName(*s)
|
||||||
|
}
|
||||||
|
return nuo
|
||||||
|
}
|
||||||
|
|
||||||
// SetURL sets the "url" field.
|
// SetURL sets the "url" field.
|
||||||
func (nuo *NotifierUpdateOne) SetURL(s string) *NotifierUpdateOne {
|
func (nuo *NotifierUpdateOne) SetURL(s string) *NotifierUpdateOne {
|
||||||
nuo.mutation.SetURL(s)
|
nuo.mutation.SetURL(s)
|
||||||
return nuo
|
return nuo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetNillableURL sets the "url" field if the given value is not nil.
|
||||||
|
func (nuo *NotifierUpdateOne) SetNillableURL(s *string) *NotifierUpdateOne {
|
||||||
|
if s != nil {
|
||||||
|
nuo.SetURL(*s)
|
||||||
|
}
|
||||||
|
return nuo
|
||||||
|
}
|
||||||
|
|
||||||
// SetIsActive sets the "is_active" field.
|
// SetIsActive sets the "is_active" field.
|
||||||
func (nuo *NotifierUpdateOne) SetIsActive(b bool) *NotifierUpdateOne {
|
func (nuo *NotifierUpdateOne) SetIsActive(b bool) *NotifierUpdateOne {
|
||||||
nuo.mutation.SetIsActive(b)
|
nuo.mutation.SetIsActive(b)
|
||||||
|
|
|
@ -5,6 +5,6 @@ package runtime
|
||||||
// The schema-stitching logic is generated in github.com/hay-kot/homebox/backend/internal/data/ent/runtime.go
|
// The schema-stitching logic is generated in github.com/hay-kot/homebox/backend/internal/data/ent/runtime.go
|
||||||
|
|
||||||
const (
|
const (
|
||||||
Version = "v0.12.3" // Version of ent codegen.
|
Version = "v0.12.5" // Version of ent codegen.
|
||||||
Sum = "h1:N5lO2EOrHpCH5HYfiMOCHYbo+oh5M8GjT0/cx5x6xkk=" // Sum of ent codegen.
|
Sum = "h1:KREM5E4CSoej4zeGa88Ou/gfturAnpUv0mzAjch1sj4=" // Sum of ent codegen.
|
||||||
)
|
)
|
||||||
|
|
|
@ -532,32 +532,15 @@ func HasNotifiersWith(preds ...predicate.Notifier) predicate.User {
|
||||||
|
|
||||||
// And groups predicates with the AND operator between them.
|
// And groups predicates with the AND operator between them.
|
||||||
func And(predicates ...predicate.User) predicate.User {
|
func And(predicates ...predicate.User) predicate.User {
|
||||||
return predicate.User(func(s *sql.Selector) {
|
return predicate.User(sql.AndPredicates(predicates...))
|
||||||
s1 := s.Clone().SetP(nil)
|
|
||||||
for _, p := range predicates {
|
|
||||||
p(s1)
|
|
||||||
}
|
|
||||||
s.Where(s1.P())
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Or groups predicates with the OR operator between them.
|
// Or groups predicates with the OR operator between them.
|
||||||
func Or(predicates ...predicate.User) predicate.User {
|
func Or(predicates ...predicate.User) predicate.User {
|
||||||
return predicate.User(func(s *sql.Selector) {
|
return predicate.User(sql.OrPredicates(predicates...))
|
||||||
s1 := s.Clone().SetP(nil)
|
|
||||||
for i, p := range predicates {
|
|
||||||
if i > 0 {
|
|
||||||
s1.Or()
|
|
||||||
}
|
|
||||||
p(s1)
|
|
||||||
}
|
|
||||||
s.Where(s1.P())
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Not applies the not operator on the given predicate.
|
// Not applies the not operator on the given predicate.
|
||||||
func Not(p predicate.User) predicate.User {
|
func Not(p predicate.User) predicate.User {
|
||||||
return predicate.User(func(s *sql.Selector) {
|
return predicate.User(sql.NotPredicates(p))
|
||||||
p(s.Not())
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -417,11 +417,15 @@ func (uc *UserCreate) createSpec() (*User, *sqlgraph.CreateSpec) {
|
||||||
// UserCreateBulk is the builder for creating many User entities in bulk.
|
// UserCreateBulk is the builder for creating many User entities in bulk.
|
||||||
type UserCreateBulk struct {
|
type UserCreateBulk struct {
|
||||||
config
|
config
|
||||||
|
err error
|
||||||
builders []*UserCreate
|
builders []*UserCreate
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save creates the User entities in the database.
|
// Save creates the User entities in the database.
|
||||||
func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error) {
|
func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error) {
|
||||||
|
if ucb.err != nil {
|
||||||
|
return nil, ucb.err
|
||||||
|
}
|
||||||
specs := make([]*sqlgraph.CreateSpec, len(ucb.builders))
|
specs := make([]*sqlgraph.CreateSpec, len(ucb.builders))
|
||||||
nodes := make([]*User, len(ucb.builders))
|
nodes := make([]*User, len(ucb.builders))
|
||||||
mutators := make([]Mutator, len(ucb.builders))
|
mutators := make([]Mutator, len(ucb.builders))
|
||||||
|
|
|
@ -44,18 +44,42 @@ func (uu *UserUpdate) SetName(s string) *UserUpdate {
|
||||||
return uu
|
return uu
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetNillableName sets the "name" field if the given value is not nil.
|
||||||
|
func (uu *UserUpdate) SetNillableName(s *string) *UserUpdate {
|
||||||
|
if s != nil {
|
||||||
|
uu.SetName(*s)
|
||||||
|
}
|
||||||
|
return uu
|
||||||
|
}
|
||||||
|
|
||||||
// SetEmail sets the "email" field.
|
// SetEmail sets the "email" field.
|
||||||
func (uu *UserUpdate) SetEmail(s string) *UserUpdate {
|
func (uu *UserUpdate) SetEmail(s string) *UserUpdate {
|
||||||
uu.mutation.SetEmail(s)
|
uu.mutation.SetEmail(s)
|
||||||
return uu
|
return uu
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetNillableEmail sets the "email" field if the given value is not nil.
|
||||||
|
func (uu *UserUpdate) SetNillableEmail(s *string) *UserUpdate {
|
||||||
|
if s != nil {
|
||||||
|
uu.SetEmail(*s)
|
||||||
|
}
|
||||||
|
return uu
|
||||||
|
}
|
||||||
|
|
||||||
// SetPassword sets the "password" field.
|
// SetPassword sets the "password" field.
|
||||||
func (uu *UserUpdate) SetPassword(s string) *UserUpdate {
|
func (uu *UserUpdate) SetPassword(s string) *UserUpdate {
|
||||||
uu.mutation.SetPassword(s)
|
uu.mutation.SetPassword(s)
|
||||||
return uu
|
return uu
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetNillablePassword sets the "password" field if the given value is not nil.
|
||||||
|
func (uu *UserUpdate) SetNillablePassword(s *string) *UserUpdate {
|
||||||
|
if s != nil {
|
||||||
|
uu.SetPassword(*s)
|
||||||
|
}
|
||||||
|
return uu
|
||||||
|
}
|
||||||
|
|
||||||
// SetIsSuperuser sets the "is_superuser" field.
|
// SetIsSuperuser sets the "is_superuser" field.
|
||||||
func (uu *UserUpdate) SetIsSuperuser(b bool) *UserUpdate {
|
func (uu *UserUpdate) SetIsSuperuser(b bool) *UserUpdate {
|
||||||
uu.mutation.SetIsSuperuser(b)
|
uu.mutation.SetIsSuperuser(b)
|
||||||
|
@ -466,18 +490,42 @@ func (uuo *UserUpdateOne) SetName(s string) *UserUpdateOne {
|
||||||
return uuo
|
return uuo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetNillableName sets the "name" field if the given value is not nil.
|
||||||
|
func (uuo *UserUpdateOne) SetNillableName(s *string) *UserUpdateOne {
|
||||||
|
if s != nil {
|
||||||
|
uuo.SetName(*s)
|
||||||
|
}
|
||||||
|
return uuo
|
||||||
|
}
|
||||||
|
|
||||||
// SetEmail sets the "email" field.
|
// SetEmail sets the "email" field.
|
||||||
func (uuo *UserUpdateOne) SetEmail(s string) *UserUpdateOne {
|
func (uuo *UserUpdateOne) SetEmail(s string) *UserUpdateOne {
|
||||||
uuo.mutation.SetEmail(s)
|
uuo.mutation.SetEmail(s)
|
||||||
return uuo
|
return uuo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetNillableEmail sets the "email" field if the given value is not nil.
|
||||||
|
func (uuo *UserUpdateOne) SetNillableEmail(s *string) *UserUpdateOne {
|
||||||
|
if s != nil {
|
||||||
|
uuo.SetEmail(*s)
|
||||||
|
}
|
||||||
|
return uuo
|
||||||
|
}
|
||||||
|
|
||||||
// SetPassword sets the "password" field.
|
// SetPassword sets the "password" field.
|
||||||
func (uuo *UserUpdateOne) SetPassword(s string) *UserUpdateOne {
|
func (uuo *UserUpdateOne) SetPassword(s string) *UserUpdateOne {
|
||||||
uuo.mutation.SetPassword(s)
|
uuo.mutation.SetPassword(s)
|
||||||
return uuo
|
return uuo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetNillablePassword sets the "password" field if the given value is not nil.
|
||||||
|
func (uuo *UserUpdateOne) SetNillablePassword(s *string) *UserUpdateOne {
|
||||||
|
if s != nil {
|
||||||
|
uuo.SetPassword(*s)
|
||||||
|
}
|
||||||
|
return uuo
|
||||||
|
}
|
||||||
|
|
||||||
// SetIsSuperuser sets the "is_superuser" field.
|
// SetIsSuperuser sets the "is_superuser" field.
|
||||||
func (uuo *UserUpdateOne) SetIsSuperuser(b bool) *UserUpdateOne {
|
func (uuo *UserUpdateOne) SetIsSuperuser(b bool) *UserUpdateOne {
|
||||||
uuo.mutation.SetIsSuperuser(b)
|
uuo.mutation.SetIsSuperuser(b)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue