Documentation ¶
Index ¶
- Constants
- func Asc(fields ...string) func(*sql.Selector)
- func Desc(fields ...string) func(*sql.Selector)
- func IsConstraintError(err error) bool
- func IsNotFound(err error) bool
- func IsNotLoaded(err error) bool
- func IsNotSingular(err error) bool
- func IsValidationError(err error) bool
- func MaskNotFound(err error) error
- func NewContext(parent context.Context, c *Client) context.Context
- func NewTxContext(parent context.Context, tx *Tx) context.Context
- type AggregateFunc
- type Book
- type BookAuthor
- func (ba *BookAuthor) NamedBooks(name string) ([]*Book, error)
- func (ba *BookAuthor) QueryBooks() *BookQuery
- func (ba *BookAuthor) String() string
- func (ba *BookAuthor) Unwrap() *BookAuthor
- func (ba *BookAuthor) Update() *BookAuthorUpdateOne
- func (ba *BookAuthor) Value(name string) (ent.Value, error)
- type BookAuthorClient
- func (c *BookAuthorClient) Create() *BookAuthorCreate
- func (c *BookAuthorClient) CreateBulk(builders ...*BookAuthorCreate) *BookAuthorCreateBulk
- func (c *BookAuthorClient) Delete() *BookAuthorDelete
- func (c *BookAuthorClient) DeleteOne(ba *BookAuthor) *BookAuthorDeleteOne
- func (c *BookAuthorClient) DeleteOneID(id uuid.UUID) *BookAuthorDeleteOne
- func (c *BookAuthorClient) Get(ctx context.Context, id uuid.UUID) (*BookAuthor, error)
- func (c *BookAuthorClient) GetX(ctx context.Context, id uuid.UUID) *BookAuthor
- func (c *BookAuthorClient) Hooks() []Hook
- func (c *BookAuthorClient) Intercept(interceptors ...Interceptor)
- func (c *BookAuthorClient) Interceptors() []Interceptor
- func (c *BookAuthorClient) Query() *BookAuthorQuery
- func (c *BookAuthorClient) QueryBooks(ba *BookAuthor) *BookQuery
- func (c *BookAuthorClient) Update() *BookAuthorUpdate
- func (c *BookAuthorClient) UpdateOne(ba *BookAuthor) *BookAuthorUpdateOne
- func (c *BookAuthorClient) UpdateOneID(id uuid.UUID) *BookAuthorUpdateOne
- func (c *BookAuthorClient) Use(hooks ...Hook)
- type BookAuthorCreate
- func (bac *BookAuthorCreate) AddBookIDs(ids ...uuid.UUID) *BookAuthorCreate
- func (bac *BookAuthorCreate) AddBooks(b ...*Book) *BookAuthorCreate
- func (bac *BookAuthorCreate) Exec(ctx context.Context) error
- func (bac *BookAuthorCreate) ExecX(ctx context.Context)
- func (bac *BookAuthorCreate) Mutation() *BookAuthorMutation
- func (bac *BookAuthorCreate) OnConflict(opts ...sql.ConflictOption) *BookAuthorUpsertOne
- func (bac *BookAuthorCreate) OnConflictColumns(columns ...string) *BookAuthorUpsertOne
- func (bac *BookAuthorCreate) Save(ctx context.Context) (*BookAuthor, error)
- func (bac *BookAuthorCreate) SaveX(ctx context.Context) *BookAuthor
- func (bac *BookAuthorCreate) SetFullName(s string) *BookAuthorCreate
- func (bac *BookAuthorCreate) SetID(u uuid.UUID) *BookAuthorCreate
- type BookAuthorCreateBulk
- func (bacb *BookAuthorCreateBulk) Exec(ctx context.Context) error
- func (bacb *BookAuthorCreateBulk) ExecX(ctx context.Context)
- func (bacb *BookAuthorCreateBulk) OnConflict(opts ...sql.ConflictOption) *BookAuthorUpsertBulk
- func (bacb *BookAuthorCreateBulk) OnConflictColumns(columns ...string) *BookAuthorUpsertBulk
- func (bacb *BookAuthorCreateBulk) Save(ctx context.Context) ([]*BookAuthor, error)
- func (bacb *BookAuthorCreateBulk) SaveX(ctx context.Context) []*BookAuthor
- type BookAuthorDelete
- type BookAuthorDeleteOne
- type BookAuthorEdges
- type BookAuthorGroupBy
- func (bagb *BookAuthorGroupBy) Aggregate(fns ...AggregateFunc) *BookAuthorGroupBy
- func (s *BookAuthorGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *BookAuthorGroupBy) BoolX(ctx context.Context) bool
- func (s *BookAuthorGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *BookAuthorGroupBy) BoolsX(ctx context.Context) []bool
- func (s *BookAuthorGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *BookAuthorGroupBy) Float64X(ctx context.Context) float64
- func (s *BookAuthorGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *BookAuthorGroupBy) Float64sX(ctx context.Context) []float64
- func (s *BookAuthorGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *BookAuthorGroupBy) IntX(ctx context.Context) int
- func (s *BookAuthorGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *BookAuthorGroupBy) IntsX(ctx context.Context) []int
- func (bagb *BookAuthorGroupBy) Scan(ctx context.Context, v any) error
- func (s *BookAuthorGroupBy) ScanX(ctx context.Context, v any)
- func (s *BookAuthorGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *BookAuthorGroupBy) StringX(ctx context.Context) string
- func (s *BookAuthorGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *BookAuthorGroupBy) StringsX(ctx context.Context) []string
- type BookAuthorMutation
- func (m *BookAuthorMutation) AddBookIDs(ids ...uuid.UUID)
- func (m *BookAuthorMutation) AddField(name string, value ent.Value) error
- func (m *BookAuthorMutation) AddedEdges() []string
- func (m *BookAuthorMutation) AddedField(name string) (ent.Value, bool)
- func (m *BookAuthorMutation) AddedFields() []string
- func (m *BookAuthorMutation) AddedIDs(name string) []ent.Value
- func (m *BookAuthorMutation) BooksCleared() bool
- func (m *BookAuthorMutation) BooksIDs() (ids []uuid.UUID)
- func (m *BookAuthorMutation) ClearBooks()
- func (m *BookAuthorMutation) ClearEdge(name string) error
- func (m *BookAuthorMutation) ClearField(name string) error
- func (m *BookAuthorMutation) ClearedEdges() []string
- func (m *BookAuthorMutation) ClearedFields() []string
- func (m BookAuthorMutation) Client() *Client
- func (m *BookAuthorMutation) EdgeCleared(name string) bool
- func (m *BookAuthorMutation) Field(name string) (ent.Value, bool)
- func (m *BookAuthorMutation) FieldCleared(name string) bool
- func (m *BookAuthorMutation) Fields() []string
- func (m *BookAuthorMutation) FullName() (r string, exists bool)
- func (m *BookAuthorMutation) ID() (id uuid.UUID, exists bool)
- func (m *BookAuthorMutation) IDs(ctx context.Context) ([]uuid.UUID, error)
- func (m *BookAuthorMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *BookAuthorMutation) OldFullName(ctx context.Context) (v string, err error)
- func (m *BookAuthorMutation) Op() Op
- func (m *BookAuthorMutation) RemoveBookIDs(ids ...uuid.UUID)
- func (m *BookAuthorMutation) RemovedBooksIDs() (ids []uuid.UUID)
- func (m *BookAuthorMutation) RemovedEdges() []string
- func (m *BookAuthorMutation) RemovedIDs(name string) []ent.Value
- func (m *BookAuthorMutation) ResetBooks()
- func (m *BookAuthorMutation) ResetEdge(name string) error
- func (m *BookAuthorMutation) ResetField(name string) error
- func (m *BookAuthorMutation) ResetFullName()
- func (m *BookAuthorMutation) SetField(name string, value ent.Value) error
- func (m *BookAuthorMutation) SetFullName(s string)
- func (m *BookAuthorMutation) SetID(id uuid.UUID)
- func (m *BookAuthorMutation) SetOp(op Op)
- func (m BookAuthorMutation) Tx() (*Tx, error)
- func (m *BookAuthorMutation) Type() string
- func (m *BookAuthorMutation) Where(ps ...predicate.BookAuthor)
- func (m *BookAuthorMutation) WhereP(ps ...func(*sql.Selector))
- type BookAuthorQuery
- func (baq *BookAuthorQuery) Aggregate(fns ...AggregateFunc) *BookAuthorSelect
- func (baq *BookAuthorQuery) All(ctx context.Context) ([]*BookAuthor, error)
- func (baq *BookAuthorQuery) AllX(ctx context.Context) []*BookAuthor
- func (baq *BookAuthorQuery) Clone() *BookAuthorQuery
- func (baq *BookAuthorQuery) Count(ctx context.Context) (int, error)
- func (baq *BookAuthorQuery) CountX(ctx context.Context) int
- func (baq *BookAuthorQuery) Exist(ctx context.Context) (bool, error)
- func (baq *BookAuthorQuery) ExistX(ctx context.Context) bool
- func (baq *BookAuthorQuery) First(ctx context.Context) (*BookAuthor, error)
- func (baq *BookAuthorQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)
- func (baq *BookAuthorQuery) FirstIDX(ctx context.Context) uuid.UUID
- func (baq *BookAuthorQuery) FirstX(ctx context.Context) *BookAuthor
- func (baq *BookAuthorQuery) ForShare(opts ...sql.LockOption) *BookAuthorQuery
- func (baq *BookAuthorQuery) ForUpdate(opts ...sql.LockOption) *BookAuthorQuery
- func (baq *BookAuthorQuery) GroupBy(field string, fields ...string) *BookAuthorGroupBy
- func (baq *BookAuthorQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)
- func (baq *BookAuthorQuery) IDsX(ctx context.Context) []uuid.UUID
- func (baq *BookAuthorQuery) Limit(limit int) *BookAuthorQuery
- func (baq *BookAuthorQuery) Offset(offset int) *BookAuthorQuery
- func (baq *BookAuthorQuery) Only(ctx context.Context) (*BookAuthor, error)
- func (baq *BookAuthorQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)
- func (baq *BookAuthorQuery) OnlyIDX(ctx context.Context) uuid.UUID
- func (baq *BookAuthorQuery) OnlyX(ctx context.Context) *BookAuthor
- func (baq *BookAuthorQuery) Order(o ...bookauthor.OrderOption) *BookAuthorQuery
- func (baq *BookAuthorQuery) QueryBooks() *BookQuery
- func (baq *BookAuthorQuery) Select(fields ...string) *BookAuthorSelect
- func (baq *BookAuthorQuery) Unique(unique bool) *BookAuthorQuery
- func (baq *BookAuthorQuery) Where(ps ...predicate.BookAuthor) *BookAuthorQuery
- func (baq *BookAuthorQuery) WithBooks(opts ...func(*BookQuery)) *BookAuthorQuery
- func (baq *BookAuthorQuery) WithNamedBooks(name string, opts ...func(*BookQuery)) *BookAuthorQuery
- type BookAuthorSelect
- func (bas *BookAuthorSelect) Aggregate(fns ...AggregateFunc) *BookAuthorSelect
- func (s *BookAuthorSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *BookAuthorSelect) BoolX(ctx context.Context) bool
- func (s *BookAuthorSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *BookAuthorSelect) BoolsX(ctx context.Context) []bool
- func (s *BookAuthorSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *BookAuthorSelect) Float64X(ctx context.Context) float64
- func (s *BookAuthorSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *BookAuthorSelect) Float64sX(ctx context.Context) []float64
- func (s *BookAuthorSelect) Int(ctx context.Context) (_ int, err error)
- func (s *BookAuthorSelect) IntX(ctx context.Context) int
- func (s *BookAuthorSelect) Ints(ctx context.Context) ([]int, error)
- func (s *BookAuthorSelect) IntsX(ctx context.Context) []int
- func (bas *BookAuthorSelect) Scan(ctx context.Context, v any) error
- func (s *BookAuthorSelect) ScanX(ctx context.Context, v any)
- func (s *BookAuthorSelect) String(ctx context.Context) (_ string, err error)
- func (s *BookAuthorSelect) StringX(ctx context.Context) string
- func (s *BookAuthorSelect) Strings(ctx context.Context) ([]string, error)
- func (s *BookAuthorSelect) StringsX(ctx context.Context) []string
- type BookAuthorUpdate
- func (bau *BookAuthorUpdate) AddBookIDs(ids ...uuid.UUID) *BookAuthorUpdate
- func (bau *BookAuthorUpdate) AddBooks(b ...*Book) *BookAuthorUpdate
- func (bau *BookAuthorUpdate) ClearBooks() *BookAuthorUpdate
- func (bau *BookAuthorUpdate) Exec(ctx context.Context) error
- func (bau *BookAuthorUpdate) ExecX(ctx context.Context)
- func (bau *BookAuthorUpdate) Mutation() *BookAuthorMutation
- func (bau *BookAuthorUpdate) RemoveBookIDs(ids ...uuid.UUID) *BookAuthorUpdate
- func (bau *BookAuthorUpdate) RemoveBooks(b ...*Book) *BookAuthorUpdate
- func (bau *BookAuthorUpdate) Save(ctx context.Context) (int, error)
- func (bau *BookAuthorUpdate) SaveX(ctx context.Context) int
- func (bau *BookAuthorUpdate) SetFullName(s string) *BookAuthorUpdate
- func (bau *BookAuthorUpdate) Where(ps ...predicate.BookAuthor) *BookAuthorUpdate
- type BookAuthorUpdateOne
- func (bauo *BookAuthorUpdateOne) AddBookIDs(ids ...uuid.UUID) *BookAuthorUpdateOne
- func (bauo *BookAuthorUpdateOne) AddBooks(b ...*Book) *BookAuthorUpdateOne
- func (bauo *BookAuthorUpdateOne) ClearBooks() *BookAuthorUpdateOne
- func (bauo *BookAuthorUpdateOne) Exec(ctx context.Context) error
- func (bauo *BookAuthorUpdateOne) ExecX(ctx context.Context)
- func (bauo *BookAuthorUpdateOne) Mutation() *BookAuthorMutation
- func (bauo *BookAuthorUpdateOne) RemoveBookIDs(ids ...uuid.UUID) *BookAuthorUpdateOne
- func (bauo *BookAuthorUpdateOne) RemoveBooks(b ...*Book) *BookAuthorUpdateOne
- func (bauo *BookAuthorUpdateOne) Save(ctx context.Context) (*BookAuthor, error)
- func (bauo *BookAuthorUpdateOne) SaveX(ctx context.Context) *BookAuthor
- func (bauo *BookAuthorUpdateOne) Select(field string, fields ...string) *BookAuthorUpdateOne
- func (bauo *BookAuthorUpdateOne) SetFullName(s string) *BookAuthorUpdateOne
- func (bauo *BookAuthorUpdateOne) Where(ps ...predicate.BookAuthor) *BookAuthorUpdateOne
- type BookAuthorUpsert
- type BookAuthorUpsertBulk
- func (u *BookAuthorUpsertBulk) DoNothing() *BookAuthorUpsertBulk
- func (u *BookAuthorUpsertBulk) Exec(ctx context.Context) error
- func (u *BookAuthorUpsertBulk) ExecX(ctx context.Context)
- func (u *BookAuthorUpsertBulk) Ignore() *BookAuthorUpsertBulk
- func (u *BookAuthorUpsertBulk) SetFullName(v string) *BookAuthorUpsertBulk
- func (u *BookAuthorUpsertBulk) Update(set func(*BookAuthorUpsert)) *BookAuthorUpsertBulk
- func (u *BookAuthorUpsertBulk) UpdateFullName() *BookAuthorUpsertBulk
- func (u *BookAuthorUpsertBulk) UpdateNewValues() *BookAuthorUpsertBulk
- type BookAuthorUpsertOne
- func (u *BookAuthorUpsertOne) DoNothing() *BookAuthorUpsertOne
- func (u *BookAuthorUpsertOne) Exec(ctx context.Context) error
- func (u *BookAuthorUpsertOne) ExecX(ctx context.Context)
- func (u *BookAuthorUpsertOne) ID(ctx context.Context) (id uuid.UUID, err error)
- func (u *BookAuthorUpsertOne) IDX(ctx context.Context) uuid.UUID
- func (u *BookAuthorUpsertOne) Ignore() *BookAuthorUpsertOne
- func (u *BookAuthorUpsertOne) SetFullName(v string) *BookAuthorUpsertOne
- func (u *BookAuthorUpsertOne) Update(set func(*BookAuthorUpsert)) *BookAuthorUpsertOne
- func (u *BookAuthorUpsertOne) UpdateFullName() *BookAuthorUpsertOne
- func (u *BookAuthorUpsertOne) UpdateNewValues() *BookAuthorUpsertOne
- type BookAuthors
- type BookClient
- func (c *BookClient) Create() *BookCreate
- func (c *BookClient) CreateBulk(builders ...*BookCreate) *BookCreateBulk
- func (c *BookClient) Delete() *BookDelete
- func (c *BookClient) DeleteOne(b *Book) *BookDeleteOne
- func (c *BookClient) DeleteOneID(id uuid.UUID) *BookDeleteOne
- func (c *BookClient) Get(ctx context.Context, id uuid.UUID) (*Book, error)
- func (c *BookClient) GetX(ctx context.Context, id uuid.UUID) *Book
- func (c *BookClient) Hooks() []Hook
- func (c *BookClient) Intercept(interceptors ...Interceptor)
- func (c *BookClient) Interceptors() []Interceptor
- func (c *BookClient) Query() *BookQuery
- func (c *BookClient) QueryBookAuthor(b *Book) *BookAuthorQuery
- func (c *BookClient) Update() *BookUpdate
- func (c *BookClient) UpdateOne(b *Book) *BookUpdateOne
- func (c *BookClient) UpdateOneID(id uuid.UUID) *BookUpdateOne
- func (c *BookClient) Use(hooks ...Hook)
- type BookCreate
- func (bc *BookCreate) AddBookAuthor(b ...*BookAuthor) *BookCreate
- func (bc *BookCreate) AddBookAuthorIDs(ids ...uuid.UUID) *BookCreate
- func (bc *BookCreate) Exec(ctx context.Context) error
- func (bc *BookCreate) ExecX(ctx context.Context)
- func (bc *BookCreate) Mutation() *BookMutation
- func (bc *BookCreate) OnConflict(opts ...sql.ConflictOption) *BookUpsertOne
- func (bc *BookCreate) OnConflictColumns(columns ...string) *BookUpsertOne
- func (bc *BookCreate) Save(ctx context.Context) (*Book, error)
- func (bc *BookCreate) SaveX(ctx context.Context) *Book
- func (bc *BookCreate) SetDescription(s string) *BookCreate
- func (bc *BookCreate) SetGoodreadsID(s string) *BookCreate
- func (bc *BookCreate) SetGoogleVolumeID(s string) *BookCreate
- func (bc *BookCreate) SetID(u uuid.UUID) *BookCreate
- func (bc *BookCreate) SetIsbn10(s string) *BookCreate
- func (bc *BookCreate) SetIsbn13(s string) *BookCreate
- func (bc *BookCreate) SetTitle(s string) *BookCreate
- type BookCreateBulk
- func (bcb *BookCreateBulk) Exec(ctx context.Context) error
- func (bcb *BookCreateBulk) ExecX(ctx context.Context)
- func (bcb *BookCreateBulk) OnConflict(opts ...sql.ConflictOption) *BookUpsertBulk
- func (bcb *BookCreateBulk) OnConflictColumns(columns ...string) *BookUpsertBulk
- func (bcb *BookCreateBulk) Save(ctx context.Context) ([]*Book, error)
- func (bcb *BookCreateBulk) SaveX(ctx context.Context) []*Book
- type BookDelete
- type BookDeleteOne
- type BookEdges
- type BookGroupBy
- func (bgb *BookGroupBy) Aggregate(fns ...AggregateFunc) *BookGroupBy
- func (s *BookGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *BookGroupBy) BoolX(ctx context.Context) bool
- func (s *BookGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *BookGroupBy) BoolsX(ctx context.Context) []bool
- func (s *BookGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *BookGroupBy) Float64X(ctx context.Context) float64
- func (s *BookGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *BookGroupBy) Float64sX(ctx context.Context) []float64
- func (s *BookGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *BookGroupBy) IntX(ctx context.Context) int
- func (s *BookGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *BookGroupBy) IntsX(ctx context.Context) []int
- func (bgb *BookGroupBy) Scan(ctx context.Context, v any) error
- func (s *BookGroupBy) ScanX(ctx context.Context, v any)
- func (s *BookGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *BookGroupBy) StringX(ctx context.Context) string
- func (s *BookGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *BookGroupBy) StringsX(ctx context.Context) []string
- type BookMutation
- func (m *BookMutation) AddBookAuthorIDs(ids ...uuid.UUID)
- func (m *BookMutation) AddField(name string, value ent.Value) error
- func (m *BookMutation) AddedEdges() []string
- func (m *BookMutation) AddedField(name string) (ent.Value, bool)
- func (m *BookMutation) AddedFields() []string
- func (m *BookMutation) AddedIDs(name string) []ent.Value
- func (m *BookMutation) BookAuthorCleared() bool
- func (m *BookMutation) BookAuthorIDs() (ids []uuid.UUID)
- func (m *BookMutation) ClearBookAuthor()
- func (m *BookMutation) ClearEdge(name string) error
- func (m *BookMutation) ClearField(name string) error
- func (m *BookMutation) ClearedEdges() []string
- func (m *BookMutation) ClearedFields() []string
- func (m BookMutation) Client() *Client
- func (m *BookMutation) Description() (r string, exists bool)
- func (m *BookMutation) EdgeCleared(name string) bool
- func (m *BookMutation) Field(name string) (ent.Value, bool)
- func (m *BookMutation) FieldCleared(name string) bool
- func (m *BookMutation) Fields() []string
- func (m *BookMutation) GoodreadsID() (r string, exists bool)
- func (m *BookMutation) GoogleVolumeID() (r string, exists bool)
- func (m *BookMutation) ID() (id uuid.UUID, exists bool)
- func (m *BookMutation) IDs(ctx context.Context) ([]uuid.UUID, error)
- func (m *BookMutation) Isbn10() (r string, exists bool)
- func (m *BookMutation) Isbn13() (r string, exists bool)
- func (m *BookMutation) OldDescription(ctx context.Context) (v string, err error)
- func (m *BookMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *BookMutation) OldGoodreadsID(ctx context.Context) (v string, err error)
- func (m *BookMutation) OldGoogleVolumeID(ctx context.Context) (v string, err error)
- func (m *BookMutation) OldIsbn10(ctx context.Context) (v string, err error)
- func (m *BookMutation) OldIsbn13(ctx context.Context) (v string, err error)
- func (m *BookMutation) OldTitle(ctx context.Context) (v string, err error)
- func (m *BookMutation) Op() Op
- func (m *BookMutation) RemoveBookAuthorIDs(ids ...uuid.UUID)
- func (m *BookMutation) RemovedBookAuthorIDs() (ids []uuid.UUID)
- func (m *BookMutation) RemovedEdges() []string
- func (m *BookMutation) RemovedIDs(name string) []ent.Value
- func (m *BookMutation) ResetBookAuthor()
- func (m *BookMutation) ResetDescription()
- func (m *BookMutation) ResetEdge(name string) error
- func (m *BookMutation) ResetField(name string) error
- func (m *BookMutation) ResetGoodreadsID()
- func (m *BookMutation) ResetGoogleVolumeID()
- func (m *BookMutation) ResetIsbn10()
- func (m *BookMutation) ResetIsbn13()
- func (m *BookMutation) ResetTitle()
- func (m *BookMutation) SetDescription(s string)
- func (m *BookMutation) SetField(name string, value ent.Value) error
- func (m *BookMutation) SetGoodreadsID(s string)
- func (m *BookMutation) SetGoogleVolumeID(s string)
- func (m *BookMutation) SetID(id uuid.UUID)
- func (m *BookMutation) SetIsbn10(s string)
- func (m *BookMutation) SetIsbn13(s string)
- func (m *BookMutation) SetOp(op Op)
- func (m *BookMutation) SetTitle(s string)
- func (m *BookMutation) Title() (r string, exists bool)
- func (m BookMutation) Tx() (*Tx, error)
- func (m *BookMutation) Type() string
- func (m *BookMutation) Where(ps ...predicate.Book)
- func (m *BookMutation) WhereP(ps ...func(*sql.Selector))
- type BookQuery
- func (bq *BookQuery) Aggregate(fns ...AggregateFunc) *BookSelect
- func (bq *BookQuery) All(ctx context.Context) ([]*Book, error)
- func (bq *BookQuery) AllX(ctx context.Context) []*Book
- func (bq *BookQuery) Clone() *BookQuery
- func (bq *BookQuery) Count(ctx context.Context) (int, error)
- func (bq *BookQuery) CountX(ctx context.Context) int
- func (bq *BookQuery) Exist(ctx context.Context) (bool, error)
- func (bq *BookQuery) ExistX(ctx context.Context) bool
- func (bq *BookQuery) First(ctx context.Context) (*Book, error)
- func (bq *BookQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)
- func (bq *BookQuery) FirstIDX(ctx context.Context) uuid.UUID
- func (bq *BookQuery) FirstX(ctx context.Context) *Book
- func (bq *BookQuery) ForShare(opts ...sql.LockOption) *BookQuery
- func (bq *BookQuery) ForUpdate(opts ...sql.LockOption) *BookQuery
- func (bq *BookQuery) GroupBy(field string, fields ...string) *BookGroupBy
- func (bq *BookQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)
- func (bq *BookQuery) IDsX(ctx context.Context) []uuid.UUID
- func (bq *BookQuery) Limit(limit int) *BookQuery
- func (bq *BookQuery) Offset(offset int) *BookQuery
- func (bq *BookQuery) Only(ctx context.Context) (*Book, error)
- func (bq *BookQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)
- func (bq *BookQuery) OnlyIDX(ctx context.Context) uuid.UUID
- func (bq *BookQuery) OnlyX(ctx context.Context) *Book
- func (bq *BookQuery) Order(o ...book.OrderOption) *BookQuery
- func (bq *BookQuery) QueryBookAuthor() *BookAuthorQuery
- func (bq *BookQuery) Select(fields ...string) *BookSelect
- func (bq *BookQuery) Unique(unique bool) *BookQuery
- func (bq *BookQuery) Where(ps ...predicate.Book) *BookQuery
- func (bq *BookQuery) WithBookAuthor(opts ...func(*BookAuthorQuery)) *BookQuery
- func (bq *BookQuery) WithNamedBookAuthor(name string, opts ...func(*BookAuthorQuery)) *BookQuery
- type BookSelect
- func (bs *BookSelect) Aggregate(fns ...AggregateFunc) *BookSelect
- func (s *BookSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *BookSelect) BoolX(ctx context.Context) bool
- func (s *BookSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *BookSelect) BoolsX(ctx context.Context) []bool
- func (s *BookSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *BookSelect) Float64X(ctx context.Context) float64
- func (s *BookSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *BookSelect) Float64sX(ctx context.Context) []float64
- func (s *BookSelect) Int(ctx context.Context) (_ int, err error)
- func (s *BookSelect) IntX(ctx context.Context) int
- func (s *BookSelect) Ints(ctx context.Context) ([]int, error)
- func (s *BookSelect) IntsX(ctx context.Context) []int
- func (bs *BookSelect) Scan(ctx context.Context, v any) error
- func (s *BookSelect) ScanX(ctx context.Context, v any)
- func (s *BookSelect) String(ctx context.Context) (_ string, err error)
- func (s *BookSelect) StringX(ctx context.Context) string
- func (s *BookSelect) Strings(ctx context.Context) ([]string, error)
- func (s *BookSelect) StringsX(ctx context.Context) []string
- type BookUpdate
- func (bu *BookUpdate) AddBookAuthor(b ...*BookAuthor) *BookUpdate
- func (bu *BookUpdate) AddBookAuthorIDs(ids ...uuid.UUID) *BookUpdate
- func (bu *BookUpdate) ClearBookAuthor() *BookUpdate
- func (bu *BookUpdate) Exec(ctx context.Context) error
- func (bu *BookUpdate) ExecX(ctx context.Context)
- func (bu *BookUpdate) Mutation() *BookMutation
- func (bu *BookUpdate) RemoveBookAuthor(b ...*BookAuthor) *BookUpdate
- func (bu *BookUpdate) RemoveBookAuthorIDs(ids ...uuid.UUID) *BookUpdate
- func (bu *BookUpdate) Save(ctx context.Context) (int, error)
- func (bu *BookUpdate) SaveX(ctx context.Context) int
- func (bu *BookUpdate) SetDescription(s string) *BookUpdate
- func (bu *BookUpdate) SetGoodreadsID(s string) *BookUpdate
- func (bu *BookUpdate) SetGoogleVolumeID(s string) *BookUpdate
- func (bu *BookUpdate) SetIsbn10(s string) *BookUpdate
- func (bu *BookUpdate) SetIsbn13(s string) *BookUpdate
- func (bu *BookUpdate) SetTitle(s string) *BookUpdate
- func (bu *BookUpdate) Where(ps ...predicate.Book) *BookUpdate
- type BookUpdateOne
- func (buo *BookUpdateOne) AddBookAuthor(b ...*BookAuthor) *BookUpdateOne
- func (buo *BookUpdateOne) AddBookAuthorIDs(ids ...uuid.UUID) *BookUpdateOne
- func (buo *BookUpdateOne) ClearBookAuthor() *BookUpdateOne
- func (buo *BookUpdateOne) Exec(ctx context.Context) error
- func (buo *BookUpdateOne) ExecX(ctx context.Context)
- func (buo *BookUpdateOne) Mutation() *BookMutation
- func (buo *BookUpdateOne) RemoveBookAuthor(b ...*BookAuthor) *BookUpdateOne
- func (buo *BookUpdateOne) RemoveBookAuthorIDs(ids ...uuid.UUID) *BookUpdateOne
- func (buo *BookUpdateOne) Save(ctx context.Context) (*Book, error)
- func (buo *BookUpdateOne) SaveX(ctx context.Context) *Book
- func (buo *BookUpdateOne) Select(field string, fields ...string) *BookUpdateOne
- func (buo *BookUpdateOne) SetDescription(s string) *BookUpdateOne
- func (buo *BookUpdateOne) SetGoodreadsID(s string) *BookUpdateOne
- func (buo *BookUpdateOne) SetGoogleVolumeID(s string) *BookUpdateOne
- func (buo *BookUpdateOne) SetIsbn10(s string) *BookUpdateOne
- func (buo *BookUpdateOne) SetIsbn13(s string) *BookUpdateOne
- func (buo *BookUpdateOne) SetTitle(s string) *BookUpdateOne
- func (buo *BookUpdateOne) Where(ps ...predicate.Book) *BookUpdateOne
- type BookUpsert
- func (u *BookUpsert) SetDescription(v string) *BookUpsert
- func (u *BookUpsert) SetGoodreadsID(v string) *BookUpsert
- func (u *BookUpsert) SetGoogleVolumeID(v string) *BookUpsert
- func (u *BookUpsert) SetIsbn10(v string) *BookUpsert
- func (u *BookUpsert) SetIsbn13(v string) *BookUpsert
- func (u *BookUpsert) SetTitle(v string) *BookUpsert
- func (u *BookUpsert) UpdateDescription() *BookUpsert
- func (u *BookUpsert) UpdateGoodreadsID() *BookUpsert
- func (u *BookUpsert) UpdateGoogleVolumeID() *BookUpsert
- func (u *BookUpsert) UpdateIsbn10() *BookUpsert
- func (u *BookUpsert) UpdateIsbn13() *BookUpsert
- func (u *BookUpsert) UpdateTitle() *BookUpsert
- type BookUpsertBulk
- func (u *BookUpsertBulk) DoNothing() *BookUpsertBulk
- func (u *BookUpsertBulk) Exec(ctx context.Context) error
- func (u *BookUpsertBulk) ExecX(ctx context.Context)
- func (u *BookUpsertBulk) Ignore() *BookUpsertBulk
- func (u *BookUpsertBulk) SetDescription(v string) *BookUpsertBulk
- func (u *BookUpsertBulk) SetGoodreadsID(v string) *BookUpsertBulk
- func (u *BookUpsertBulk) SetGoogleVolumeID(v string) *BookUpsertBulk
- func (u *BookUpsertBulk) SetIsbn10(v string) *BookUpsertBulk
- func (u *BookUpsertBulk) SetIsbn13(v string) *BookUpsertBulk
- func (u *BookUpsertBulk) SetTitle(v string) *BookUpsertBulk
- func (u *BookUpsertBulk) Update(set func(*BookUpsert)) *BookUpsertBulk
- func (u *BookUpsertBulk) UpdateDescription() *BookUpsertBulk
- func (u *BookUpsertBulk) UpdateGoodreadsID() *BookUpsertBulk
- func (u *BookUpsertBulk) UpdateGoogleVolumeID() *BookUpsertBulk
- func (u *BookUpsertBulk) UpdateIsbn10() *BookUpsertBulk
- func (u *BookUpsertBulk) UpdateIsbn13() *BookUpsertBulk
- func (u *BookUpsertBulk) UpdateNewValues() *BookUpsertBulk
- func (u *BookUpsertBulk) UpdateTitle() *BookUpsertBulk
- type BookUpsertOne
- func (u *BookUpsertOne) DoNothing() *BookUpsertOne
- func (u *BookUpsertOne) Exec(ctx context.Context) error
- func (u *BookUpsertOne) ExecX(ctx context.Context)
- func (u *BookUpsertOne) ID(ctx context.Context) (id uuid.UUID, err error)
- func (u *BookUpsertOne) IDX(ctx context.Context) uuid.UUID
- func (u *BookUpsertOne) Ignore() *BookUpsertOne
- func (u *BookUpsertOne) SetDescription(v string) *BookUpsertOne
- func (u *BookUpsertOne) SetGoodreadsID(v string) *BookUpsertOne
- func (u *BookUpsertOne) SetGoogleVolumeID(v string) *BookUpsertOne
- func (u *BookUpsertOne) SetIsbn10(v string) *BookUpsertOne
- func (u *BookUpsertOne) SetIsbn13(v string) *BookUpsertOne
- func (u *BookUpsertOne) SetTitle(v string) *BookUpsertOne
- func (u *BookUpsertOne) Update(set func(*BookUpsert)) *BookUpsertOne
- func (u *BookUpsertOne) UpdateDescription() *BookUpsertOne
- func (u *BookUpsertOne) UpdateGoodreadsID() *BookUpsertOne
- func (u *BookUpsertOne) UpdateGoogleVolumeID() *BookUpsertOne
- func (u *BookUpsertOne) UpdateIsbn10() *BookUpsertOne
- func (u *BookUpsertOne) UpdateIsbn13() *BookUpsertOne
- func (u *BookUpsertOne) UpdateNewValues() *BookUpsertOne
- func (u *BookUpsertOne) UpdateTitle() *BookUpsertOne
- type Books
- type Client
- func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)
- func (c *Client) Close() error
- func (c *Client) Debug() *Client
- func (c *Client) Intercept(interceptors ...Interceptor)
- func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error)
- func (c *Client) Tx(ctx context.Context) (*Tx, error)
- func (c *Client) Use(hooks ...Hook)
- type CommitFunc
- type CommitHook
- type Committer
- type ConstraintError
- type DiscordMessage
- func (dm *DiscordMessage) NamedAuthor(name string) ([]*DiscordUser, error)
- func (dm *DiscordMessage) QueryAuthor() *DiscordUserQuery
- func (dm *DiscordMessage) String() string
- func (dm *DiscordMessage) Unwrap() *DiscordMessage
- func (dm *DiscordMessage) Update() *DiscordMessageUpdateOne
- func (dm *DiscordMessage) Value(name string) (ent.Value, error)
- type DiscordMessageClient
- func (c *DiscordMessageClient) Create() *DiscordMessageCreate
- func (c *DiscordMessageClient) CreateBulk(builders ...*DiscordMessageCreate) *DiscordMessageCreateBulk
- func (c *DiscordMessageClient) Delete() *DiscordMessageDelete
- func (c *DiscordMessageClient) DeleteOne(dm *DiscordMessage) *DiscordMessageDeleteOne
- func (c *DiscordMessageClient) DeleteOneID(id string) *DiscordMessageDeleteOne
- func (c *DiscordMessageClient) Get(ctx context.Context, id string) (*DiscordMessage, error)
- func (c *DiscordMessageClient) GetX(ctx context.Context, id string) *DiscordMessage
- func (c *DiscordMessageClient) Hooks() []Hook
- func (c *DiscordMessageClient) Intercept(interceptors ...Interceptor)
- func (c *DiscordMessageClient) Interceptors() []Interceptor
- func (c *DiscordMessageClient) Query() *DiscordMessageQuery
- func (c *DiscordMessageClient) QueryAuthor(dm *DiscordMessage) *DiscordUserQuery
- func (c *DiscordMessageClient) Update() *DiscordMessageUpdate
- func (c *DiscordMessageClient) UpdateOne(dm *DiscordMessage) *DiscordMessageUpdateOne
- func (c *DiscordMessageClient) UpdateOneID(id string) *DiscordMessageUpdateOne
- func (c *DiscordMessageClient) Use(hooks ...Hook)
- type DiscordMessageCreate
- func (dmc *DiscordMessageCreate) AddAuthor(d ...*DiscordUser) *DiscordMessageCreate
- func (dmc *DiscordMessageCreate) AddAuthorIDs(ids ...uuid.UUID) *DiscordMessageCreate
- func (dmc *DiscordMessageCreate) Exec(ctx context.Context) error
- func (dmc *DiscordMessageCreate) ExecX(ctx context.Context)
- func (dmc *DiscordMessageCreate) Mutation() *DiscordMessageMutation
- func (dmc *DiscordMessageCreate) OnConflict(opts ...sql.ConflictOption) *DiscordMessageUpsertOne
- func (dmc *DiscordMessageCreate) OnConflictColumns(columns ...string) *DiscordMessageUpsertOne
- func (dmc *DiscordMessageCreate) Save(ctx context.Context) (*DiscordMessage, error)
- func (dmc *DiscordMessageCreate) SaveX(ctx context.Context) *DiscordMessage
- func (dmc *DiscordMessageCreate) SetCreateTime(t time.Time) *DiscordMessageCreate
- func (dmc *DiscordMessageCreate) SetID(s string) *DiscordMessageCreate
- func (dmc *DiscordMessageCreate) SetNillableCreateTime(t *time.Time) *DiscordMessageCreate
- func (dmc *DiscordMessageCreate) SetNillableUpdateTime(t *time.Time) *DiscordMessageCreate
- func (dmc *DiscordMessageCreate) SetRaw(d discordgo.Message) *DiscordMessageCreate
- func (dmc *DiscordMessageCreate) SetUpdateTime(t time.Time) *DiscordMessageCreate
- type DiscordMessageCreateBulk
- func (dmcb *DiscordMessageCreateBulk) Exec(ctx context.Context) error
- func (dmcb *DiscordMessageCreateBulk) ExecX(ctx context.Context)
- func (dmcb *DiscordMessageCreateBulk) OnConflict(opts ...sql.ConflictOption) *DiscordMessageUpsertBulk
- func (dmcb *DiscordMessageCreateBulk) OnConflictColumns(columns ...string) *DiscordMessageUpsertBulk
- func (dmcb *DiscordMessageCreateBulk) Save(ctx context.Context) ([]*DiscordMessage, error)
- func (dmcb *DiscordMessageCreateBulk) SaveX(ctx context.Context) []*DiscordMessage
- type DiscordMessageDelete
- type DiscordMessageDeleteOne
- type DiscordMessageEdges
- type DiscordMessageGroupBy
- func (dmgb *DiscordMessageGroupBy) Aggregate(fns ...AggregateFunc) *DiscordMessageGroupBy
- func (s *DiscordMessageGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *DiscordMessageGroupBy) BoolX(ctx context.Context) bool
- func (s *DiscordMessageGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *DiscordMessageGroupBy) BoolsX(ctx context.Context) []bool
- func (s *DiscordMessageGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *DiscordMessageGroupBy) Float64X(ctx context.Context) float64
- func (s *DiscordMessageGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *DiscordMessageGroupBy) Float64sX(ctx context.Context) []float64
- func (s *DiscordMessageGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *DiscordMessageGroupBy) IntX(ctx context.Context) int
- func (s *DiscordMessageGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *DiscordMessageGroupBy) IntsX(ctx context.Context) []int
- func (dmgb *DiscordMessageGroupBy) Scan(ctx context.Context, v any) error
- func (s *DiscordMessageGroupBy) ScanX(ctx context.Context, v any)
- func (s *DiscordMessageGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *DiscordMessageGroupBy) StringX(ctx context.Context) string
- func (s *DiscordMessageGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *DiscordMessageGroupBy) StringsX(ctx context.Context) []string
- type DiscordMessageMutation
- func (m *DiscordMessageMutation) AddAuthorIDs(ids ...uuid.UUID)
- func (m *DiscordMessageMutation) AddField(name string, value ent.Value) error
- func (m *DiscordMessageMutation) AddedEdges() []string
- func (m *DiscordMessageMutation) AddedField(name string) (ent.Value, bool)
- func (m *DiscordMessageMutation) AddedFields() []string
- func (m *DiscordMessageMutation) AddedIDs(name string) []ent.Value
- func (m *DiscordMessageMutation) AuthorCleared() bool
- func (m *DiscordMessageMutation) AuthorIDs() (ids []uuid.UUID)
- func (m *DiscordMessageMutation) ClearAuthor()
- func (m *DiscordMessageMutation) ClearEdge(name string) error
- func (m *DiscordMessageMutation) ClearField(name string) error
- func (m *DiscordMessageMutation) ClearedEdges() []string
- func (m *DiscordMessageMutation) ClearedFields() []string
- func (m DiscordMessageMutation) Client() *Client
- func (m *DiscordMessageMutation) CreateTime() (r time.Time, exists bool)
- func (m *DiscordMessageMutation) EdgeCleared(name string) bool
- func (m *DiscordMessageMutation) Field(name string) (ent.Value, bool)
- func (m *DiscordMessageMutation) FieldCleared(name string) bool
- func (m *DiscordMessageMutation) Fields() []string
- func (m *DiscordMessageMutation) ID() (id string, exists bool)
- func (m *DiscordMessageMutation) IDs(ctx context.Context) ([]string, error)
- func (m *DiscordMessageMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)
- func (m *DiscordMessageMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *DiscordMessageMutation) OldRaw(ctx context.Context) (v discordgo.Message, err error)
- func (m *DiscordMessageMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)
- func (m *DiscordMessageMutation) Op() Op
- func (m *DiscordMessageMutation) Raw() (r discordgo.Message, exists bool)
- func (m *DiscordMessageMutation) RemoveAuthorIDs(ids ...uuid.UUID)
- func (m *DiscordMessageMutation) RemovedAuthorIDs() (ids []uuid.UUID)
- func (m *DiscordMessageMutation) RemovedEdges() []string
- func (m *DiscordMessageMutation) RemovedIDs(name string) []ent.Value
- func (m *DiscordMessageMutation) ResetAuthor()
- func (m *DiscordMessageMutation) ResetCreateTime()
- func (m *DiscordMessageMutation) ResetEdge(name string) error
- func (m *DiscordMessageMutation) ResetField(name string) error
- func (m *DiscordMessageMutation) ResetRaw()
- func (m *DiscordMessageMutation) ResetUpdateTime()
- func (m *DiscordMessageMutation) SetCreateTime(t time.Time)
- func (m *DiscordMessageMutation) SetField(name string, value ent.Value) error
- func (m *DiscordMessageMutation) SetID(id string)
- func (m *DiscordMessageMutation) SetOp(op Op)
- func (m *DiscordMessageMutation) SetRaw(d discordgo.Message)
- func (m *DiscordMessageMutation) SetUpdateTime(t time.Time)
- func (m DiscordMessageMutation) Tx() (*Tx, error)
- func (m *DiscordMessageMutation) Type() string
- func (m *DiscordMessageMutation) UpdateTime() (r time.Time, exists bool)
- func (m *DiscordMessageMutation) Where(ps ...predicate.DiscordMessage)
- func (m *DiscordMessageMutation) WhereP(ps ...func(*sql.Selector))
- type DiscordMessageQuery
- func (dmq *DiscordMessageQuery) Aggregate(fns ...AggregateFunc) *DiscordMessageSelect
- func (dmq *DiscordMessageQuery) All(ctx context.Context) ([]*DiscordMessage, error)
- func (dmq *DiscordMessageQuery) AllX(ctx context.Context) []*DiscordMessage
- func (dmq *DiscordMessageQuery) Clone() *DiscordMessageQuery
- func (dmq *DiscordMessageQuery) Count(ctx context.Context) (int, error)
- func (dmq *DiscordMessageQuery) CountX(ctx context.Context) int
- func (dmq *DiscordMessageQuery) Exist(ctx context.Context) (bool, error)
- func (dmq *DiscordMessageQuery) ExistX(ctx context.Context) bool
- func (dmq *DiscordMessageQuery) First(ctx context.Context) (*DiscordMessage, error)
- func (dmq *DiscordMessageQuery) FirstID(ctx context.Context) (id string, err error)
- func (dmq *DiscordMessageQuery) FirstIDX(ctx context.Context) string
- func (dmq *DiscordMessageQuery) FirstX(ctx context.Context) *DiscordMessage
- func (dmq *DiscordMessageQuery) ForShare(opts ...sql.LockOption) *DiscordMessageQuery
- func (dmq *DiscordMessageQuery) ForUpdate(opts ...sql.LockOption) *DiscordMessageQuery
- func (dmq *DiscordMessageQuery) GroupBy(field string, fields ...string) *DiscordMessageGroupBy
- func (dmq *DiscordMessageQuery) IDs(ctx context.Context) (ids []string, err error)
- func (dmq *DiscordMessageQuery) IDsX(ctx context.Context) []string
- func (dmq *DiscordMessageQuery) Limit(limit int) *DiscordMessageQuery
- func (dmq *DiscordMessageQuery) Offset(offset int) *DiscordMessageQuery
- func (dmq *DiscordMessageQuery) Only(ctx context.Context) (*DiscordMessage, error)
- func (dmq *DiscordMessageQuery) OnlyID(ctx context.Context) (id string, err error)
- func (dmq *DiscordMessageQuery) OnlyIDX(ctx context.Context) string
- func (dmq *DiscordMessageQuery) OnlyX(ctx context.Context) *DiscordMessage
- func (dmq *DiscordMessageQuery) Order(o ...discordmessage.OrderOption) *DiscordMessageQuery
- func (dmq *DiscordMessageQuery) QueryAuthor() *DiscordUserQuery
- func (dmq *DiscordMessageQuery) Select(fields ...string) *DiscordMessageSelect
- func (dmq *DiscordMessageQuery) Unique(unique bool) *DiscordMessageQuery
- func (dmq *DiscordMessageQuery) Where(ps ...predicate.DiscordMessage) *DiscordMessageQuery
- func (dmq *DiscordMessageQuery) WithAuthor(opts ...func(*DiscordUserQuery)) *DiscordMessageQuery
- func (dmq *DiscordMessageQuery) WithNamedAuthor(name string, opts ...func(*DiscordUserQuery)) *DiscordMessageQuery
- type DiscordMessageSelect
- func (dms *DiscordMessageSelect) Aggregate(fns ...AggregateFunc) *DiscordMessageSelect
- func (s *DiscordMessageSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *DiscordMessageSelect) BoolX(ctx context.Context) bool
- func (s *DiscordMessageSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *DiscordMessageSelect) BoolsX(ctx context.Context) []bool
- func (s *DiscordMessageSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *DiscordMessageSelect) Float64X(ctx context.Context) float64
- func (s *DiscordMessageSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *DiscordMessageSelect) Float64sX(ctx context.Context) []float64
- func (s *DiscordMessageSelect) Int(ctx context.Context) (_ int, err error)
- func (s *DiscordMessageSelect) IntX(ctx context.Context) int
- func (s *DiscordMessageSelect) Ints(ctx context.Context) ([]int, error)
- func (s *DiscordMessageSelect) IntsX(ctx context.Context) []int
- func (dms *DiscordMessageSelect) Scan(ctx context.Context, v any) error
- func (s *DiscordMessageSelect) ScanX(ctx context.Context, v any)
- func (s *DiscordMessageSelect) String(ctx context.Context) (_ string, err error)
- func (s *DiscordMessageSelect) StringX(ctx context.Context) string
- func (s *DiscordMessageSelect) Strings(ctx context.Context) ([]string, error)
- func (s *DiscordMessageSelect) StringsX(ctx context.Context) []string
- type DiscordMessageUpdate
- func (dmu *DiscordMessageUpdate) AddAuthor(d ...*DiscordUser) *DiscordMessageUpdate
- func (dmu *DiscordMessageUpdate) AddAuthorIDs(ids ...uuid.UUID) *DiscordMessageUpdate
- func (dmu *DiscordMessageUpdate) ClearAuthor() *DiscordMessageUpdate
- func (dmu *DiscordMessageUpdate) Exec(ctx context.Context) error
- func (dmu *DiscordMessageUpdate) ExecX(ctx context.Context)
- func (dmu *DiscordMessageUpdate) Mutation() *DiscordMessageMutation
- func (dmu *DiscordMessageUpdate) RemoveAuthor(d ...*DiscordUser) *DiscordMessageUpdate
- func (dmu *DiscordMessageUpdate) RemoveAuthorIDs(ids ...uuid.UUID) *DiscordMessageUpdate
- func (dmu *DiscordMessageUpdate) Save(ctx context.Context) (int, error)
- func (dmu *DiscordMessageUpdate) SaveX(ctx context.Context) int
- func (dmu *DiscordMessageUpdate) SetRaw(d discordgo.Message) *DiscordMessageUpdate
- func (dmu *DiscordMessageUpdate) SetUpdateTime(t time.Time) *DiscordMessageUpdate
- func (dmu *DiscordMessageUpdate) Where(ps ...predicate.DiscordMessage) *DiscordMessageUpdate
- type DiscordMessageUpdateOne
- func (dmuo *DiscordMessageUpdateOne) AddAuthor(d ...*DiscordUser) *DiscordMessageUpdateOne
- func (dmuo *DiscordMessageUpdateOne) AddAuthorIDs(ids ...uuid.UUID) *DiscordMessageUpdateOne
- func (dmuo *DiscordMessageUpdateOne) ClearAuthor() *DiscordMessageUpdateOne
- func (dmuo *DiscordMessageUpdateOne) Exec(ctx context.Context) error
- func (dmuo *DiscordMessageUpdateOne) ExecX(ctx context.Context)
- func (dmuo *DiscordMessageUpdateOne) Mutation() *DiscordMessageMutation
- func (dmuo *DiscordMessageUpdateOne) RemoveAuthor(d ...*DiscordUser) *DiscordMessageUpdateOne
- func (dmuo *DiscordMessageUpdateOne) RemoveAuthorIDs(ids ...uuid.UUID) *DiscordMessageUpdateOne
- func (dmuo *DiscordMessageUpdateOne) Save(ctx context.Context) (*DiscordMessage, error)
- func (dmuo *DiscordMessageUpdateOne) SaveX(ctx context.Context) *DiscordMessage
- func (dmuo *DiscordMessageUpdateOne) Select(field string, fields ...string) *DiscordMessageUpdateOne
- func (dmuo *DiscordMessageUpdateOne) SetRaw(d discordgo.Message) *DiscordMessageUpdateOne
- func (dmuo *DiscordMessageUpdateOne) SetUpdateTime(t time.Time) *DiscordMessageUpdateOne
- func (dmuo *DiscordMessageUpdateOne) Where(ps ...predicate.DiscordMessage) *DiscordMessageUpdateOne
- type DiscordMessageUpsert
- type DiscordMessageUpsertBulk
- func (u *DiscordMessageUpsertBulk) DoNothing() *DiscordMessageUpsertBulk
- func (u *DiscordMessageUpsertBulk) Exec(ctx context.Context) error
- func (u *DiscordMessageUpsertBulk) ExecX(ctx context.Context)
- func (u *DiscordMessageUpsertBulk) Ignore() *DiscordMessageUpsertBulk
- func (u *DiscordMessageUpsertBulk) SetRaw(v discordgo.Message) *DiscordMessageUpsertBulk
- func (u *DiscordMessageUpsertBulk) SetUpdateTime(v time.Time) *DiscordMessageUpsertBulk
- func (u *DiscordMessageUpsertBulk) Update(set func(*DiscordMessageUpsert)) *DiscordMessageUpsertBulk
- func (u *DiscordMessageUpsertBulk) UpdateNewValues() *DiscordMessageUpsertBulk
- func (u *DiscordMessageUpsertBulk) UpdateRaw() *DiscordMessageUpsertBulk
- func (u *DiscordMessageUpsertBulk) UpdateUpdateTime() *DiscordMessageUpsertBulk
- type DiscordMessageUpsertOne
- func (u *DiscordMessageUpsertOne) DoNothing() *DiscordMessageUpsertOne
- func (u *DiscordMessageUpsertOne) Exec(ctx context.Context) error
- func (u *DiscordMessageUpsertOne) ExecX(ctx context.Context)
- func (u *DiscordMessageUpsertOne) ID(ctx context.Context) (id string, err error)
- func (u *DiscordMessageUpsertOne) IDX(ctx context.Context) string
- func (u *DiscordMessageUpsertOne) Ignore() *DiscordMessageUpsertOne
- func (u *DiscordMessageUpsertOne) SetRaw(v discordgo.Message) *DiscordMessageUpsertOne
- func (u *DiscordMessageUpsertOne) SetUpdateTime(v time.Time) *DiscordMessageUpsertOne
- func (u *DiscordMessageUpsertOne) Update(set func(*DiscordMessageUpsert)) *DiscordMessageUpsertOne
- func (u *DiscordMessageUpsertOne) UpdateNewValues() *DiscordMessageUpsertOne
- func (u *DiscordMessageUpsertOne) UpdateRaw() *DiscordMessageUpsertOne
- func (u *DiscordMessageUpsertOne) UpdateUpdateTime() *DiscordMessageUpsertOne
- type DiscordMessages
- type DiscordUser
- func (du *DiscordUser) NamedDiscordMessages(name string) ([]*DiscordMessage, error)
- func (du *DiscordUser) QueryDiscordMessages() *DiscordMessageQuery
- func (du *DiscordUser) String() string
- func (du *DiscordUser) Unwrap() *DiscordUser
- func (du *DiscordUser) Update() *DiscordUserUpdateOne
- func (du *DiscordUser) Value(name string) (ent.Value, error)
- type DiscordUserClient
- func (c *DiscordUserClient) Create() *DiscordUserCreate
- func (c *DiscordUserClient) CreateBulk(builders ...*DiscordUserCreate) *DiscordUserCreateBulk
- func (c *DiscordUserClient) Delete() *DiscordUserDelete
- func (c *DiscordUserClient) DeleteOne(du *DiscordUser) *DiscordUserDeleteOne
- func (c *DiscordUserClient) DeleteOneID(id uuid.UUID) *DiscordUserDeleteOne
- func (c *DiscordUserClient) Get(ctx context.Context, id uuid.UUID) (*DiscordUser, error)
- func (c *DiscordUserClient) GetX(ctx context.Context, id uuid.UUID) *DiscordUser
- func (c *DiscordUserClient) Hooks() []Hook
- func (c *DiscordUserClient) Intercept(interceptors ...Interceptor)
- func (c *DiscordUserClient) Interceptors() []Interceptor
- func (c *DiscordUserClient) Query() *DiscordUserQuery
- func (c *DiscordUserClient) QueryDiscordMessages(du *DiscordUser) *DiscordMessageQuery
- func (c *DiscordUserClient) Update() *DiscordUserUpdate
- func (c *DiscordUserClient) UpdateOne(du *DiscordUser) *DiscordUserUpdateOne
- func (c *DiscordUserClient) UpdateOneID(id uuid.UUID) *DiscordUserUpdateOne
- func (c *DiscordUserClient) Use(hooks ...Hook)
- type DiscordUserCreate
- func (duc *DiscordUserCreate) AddDiscordMessageIDs(ids ...string) *DiscordUserCreate
- func (duc *DiscordUserCreate) AddDiscordMessages(d ...*DiscordMessage) *DiscordUserCreate
- func (duc *DiscordUserCreate) Exec(ctx context.Context) error
- func (duc *DiscordUserCreate) ExecX(ctx context.Context)
- func (duc *DiscordUserCreate) Mutation() *DiscordUserMutation
- func (duc *DiscordUserCreate) OnConflict(opts ...sql.ConflictOption) *DiscordUserUpsertOne
- func (duc *DiscordUserCreate) OnConflictColumns(columns ...string) *DiscordUserUpsertOne
- func (duc *DiscordUserCreate) Save(ctx context.Context) (*DiscordUser, error)
- func (duc *DiscordUserCreate) SaveX(ctx context.Context) *DiscordUser
- func (duc *DiscordUserCreate) SetDiscordid(s string) *DiscordUserCreate
- func (duc *DiscordUserCreate) SetID(u uuid.UUID) *DiscordUserCreate
- func (duc *DiscordUserCreate) SetNillableDiscordid(s *string) *DiscordUserCreate
- func (duc *DiscordUserCreate) SetUsername(s string) *DiscordUserCreate
- type DiscordUserCreateBulk
- func (ducb *DiscordUserCreateBulk) Exec(ctx context.Context) error
- func (ducb *DiscordUserCreateBulk) ExecX(ctx context.Context)
- func (ducb *DiscordUserCreateBulk) OnConflict(opts ...sql.ConflictOption) *DiscordUserUpsertBulk
- func (ducb *DiscordUserCreateBulk) OnConflictColumns(columns ...string) *DiscordUserUpsertBulk
- func (ducb *DiscordUserCreateBulk) Save(ctx context.Context) ([]*DiscordUser, error)
- func (ducb *DiscordUserCreateBulk) SaveX(ctx context.Context) []*DiscordUser
- type DiscordUserDelete
- type DiscordUserDeleteOne
- type DiscordUserEdges
- type DiscordUserGroupBy
- func (dugb *DiscordUserGroupBy) Aggregate(fns ...AggregateFunc) *DiscordUserGroupBy
- func (s *DiscordUserGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *DiscordUserGroupBy) BoolX(ctx context.Context) bool
- func (s *DiscordUserGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *DiscordUserGroupBy) BoolsX(ctx context.Context) []bool
- func (s *DiscordUserGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *DiscordUserGroupBy) Float64X(ctx context.Context) float64
- func (s *DiscordUserGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *DiscordUserGroupBy) Float64sX(ctx context.Context) []float64
- func (s *DiscordUserGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *DiscordUserGroupBy) IntX(ctx context.Context) int
- func (s *DiscordUserGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *DiscordUserGroupBy) IntsX(ctx context.Context) []int
- func (dugb *DiscordUserGroupBy) Scan(ctx context.Context, v any) error
- func (s *DiscordUserGroupBy) ScanX(ctx context.Context, v any)
- func (s *DiscordUserGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *DiscordUserGroupBy) StringX(ctx context.Context) string
- func (s *DiscordUserGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *DiscordUserGroupBy) StringsX(ctx context.Context) []string
- type DiscordUserMutation
- func (m *DiscordUserMutation) AddDiscordMessageIDs(ids ...string)
- func (m *DiscordUserMutation) AddField(name string, value ent.Value) error
- func (m *DiscordUserMutation) AddedEdges() []string
- func (m *DiscordUserMutation) AddedField(name string) (ent.Value, bool)
- func (m *DiscordUserMutation) AddedFields() []string
- func (m *DiscordUserMutation) AddedIDs(name string) []ent.Value
- func (m *DiscordUserMutation) ClearDiscordMessages()
- func (m *DiscordUserMutation) ClearEdge(name string) error
- func (m *DiscordUserMutation) ClearField(name string) error
- func (m *DiscordUserMutation) ClearedEdges() []string
- func (m *DiscordUserMutation) ClearedFields() []string
- func (m DiscordUserMutation) Client() *Client
- func (m *DiscordUserMutation) DiscordMessagesCleared() bool
- func (m *DiscordUserMutation) DiscordMessagesIDs() (ids []string)
- func (m *DiscordUserMutation) Discordid() (r string, exists bool)
- func (m *DiscordUserMutation) EdgeCleared(name string) bool
- func (m *DiscordUserMutation) Field(name string) (ent.Value, bool)
- func (m *DiscordUserMutation) FieldCleared(name string) bool
- func (m *DiscordUserMutation) Fields() []string
- func (m *DiscordUserMutation) ID() (id uuid.UUID, exists bool)
- func (m *DiscordUserMutation) IDs(ctx context.Context) ([]uuid.UUID, error)
- func (m *DiscordUserMutation) OldDiscordid(ctx context.Context) (v string, err error)
- func (m *DiscordUserMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *DiscordUserMutation) OldUsername(ctx context.Context) (v string, err error)
- func (m *DiscordUserMutation) Op() Op
- func (m *DiscordUserMutation) RemoveDiscordMessageIDs(ids ...string)
- func (m *DiscordUserMutation) RemovedDiscordMessagesIDs() (ids []string)
- func (m *DiscordUserMutation) RemovedEdges() []string
- func (m *DiscordUserMutation) RemovedIDs(name string) []ent.Value
- func (m *DiscordUserMutation) ResetDiscordMessages()
- func (m *DiscordUserMutation) ResetDiscordid()
- func (m *DiscordUserMutation) ResetEdge(name string) error
- func (m *DiscordUserMutation) ResetField(name string) error
- func (m *DiscordUserMutation) ResetUsername()
- func (m *DiscordUserMutation) SetDiscordid(s string)
- func (m *DiscordUserMutation) SetField(name string, value ent.Value) error
- func (m *DiscordUserMutation) SetID(id uuid.UUID)
- func (m *DiscordUserMutation) SetOp(op Op)
- func (m *DiscordUserMutation) SetUsername(s string)
- func (m DiscordUserMutation) Tx() (*Tx, error)
- func (m *DiscordUserMutation) Type() string
- func (m *DiscordUserMutation) Username() (r string, exists bool)
- func (m *DiscordUserMutation) Where(ps ...predicate.DiscordUser)
- func (m *DiscordUserMutation) WhereP(ps ...func(*sql.Selector))
- type DiscordUserQuery
- func (duq *DiscordUserQuery) Aggregate(fns ...AggregateFunc) *DiscordUserSelect
- func (duq *DiscordUserQuery) All(ctx context.Context) ([]*DiscordUser, error)
- func (duq *DiscordUserQuery) AllX(ctx context.Context) []*DiscordUser
- func (duq *DiscordUserQuery) Clone() *DiscordUserQuery
- func (duq *DiscordUserQuery) Count(ctx context.Context) (int, error)
- func (duq *DiscordUserQuery) CountX(ctx context.Context) int
- func (duq *DiscordUserQuery) Exist(ctx context.Context) (bool, error)
- func (duq *DiscordUserQuery) ExistX(ctx context.Context) bool
- func (duq *DiscordUserQuery) First(ctx context.Context) (*DiscordUser, error)
- func (duq *DiscordUserQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)
- func (duq *DiscordUserQuery) FirstIDX(ctx context.Context) uuid.UUID
- func (duq *DiscordUserQuery) FirstX(ctx context.Context) *DiscordUser
- func (duq *DiscordUserQuery) ForShare(opts ...sql.LockOption) *DiscordUserQuery
- func (duq *DiscordUserQuery) ForUpdate(opts ...sql.LockOption) *DiscordUserQuery
- func (duq *DiscordUserQuery) GroupBy(field string, fields ...string) *DiscordUserGroupBy
- func (duq *DiscordUserQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)
- func (duq *DiscordUserQuery) IDsX(ctx context.Context) []uuid.UUID
- func (duq *DiscordUserQuery) Limit(limit int) *DiscordUserQuery
- func (duq *DiscordUserQuery) Offset(offset int) *DiscordUserQuery
- func (duq *DiscordUserQuery) Only(ctx context.Context) (*DiscordUser, error)
- func (duq *DiscordUserQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)
- func (duq *DiscordUserQuery) OnlyIDX(ctx context.Context) uuid.UUID
- func (duq *DiscordUserQuery) OnlyX(ctx context.Context) *DiscordUser
- func (duq *DiscordUserQuery) Order(o ...discorduser.OrderOption) *DiscordUserQuery
- func (duq *DiscordUserQuery) QueryDiscordMessages() *DiscordMessageQuery
- func (duq *DiscordUserQuery) Select(fields ...string) *DiscordUserSelect
- func (duq *DiscordUserQuery) Unique(unique bool) *DiscordUserQuery
- func (duq *DiscordUserQuery) Where(ps ...predicate.DiscordUser) *DiscordUserQuery
- func (duq *DiscordUserQuery) WithDiscordMessages(opts ...func(*DiscordMessageQuery)) *DiscordUserQuery
- func (duq *DiscordUserQuery) WithNamedDiscordMessages(name string, opts ...func(*DiscordMessageQuery)) *DiscordUserQuery
- type DiscordUserSelect
- func (dus *DiscordUserSelect) Aggregate(fns ...AggregateFunc) *DiscordUserSelect
- func (s *DiscordUserSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *DiscordUserSelect) BoolX(ctx context.Context) bool
- func (s *DiscordUserSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *DiscordUserSelect) BoolsX(ctx context.Context) []bool
- func (s *DiscordUserSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *DiscordUserSelect) Float64X(ctx context.Context) float64
- func (s *DiscordUserSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *DiscordUserSelect) Float64sX(ctx context.Context) []float64
- func (s *DiscordUserSelect) Int(ctx context.Context) (_ int, err error)
- func (s *DiscordUserSelect) IntX(ctx context.Context) int
- func (s *DiscordUserSelect) Ints(ctx context.Context) ([]int, error)
- func (s *DiscordUserSelect) IntsX(ctx context.Context) []int
- func (dus *DiscordUserSelect) Scan(ctx context.Context, v any) error
- func (s *DiscordUserSelect) ScanX(ctx context.Context, v any)
- func (s *DiscordUserSelect) String(ctx context.Context) (_ string, err error)
- func (s *DiscordUserSelect) StringX(ctx context.Context) string
- func (s *DiscordUserSelect) Strings(ctx context.Context) ([]string, error)
- func (s *DiscordUserSelect) StringsX(ctx context.Context) []string
- type DiscordUserUpdate
- func (duu *DiscordUserUpdate) AddDiscordMessageIDs(ids ...string) *DiscordUserUpdate
- func (duu *DiscordUserUpdate) AddDiscordMessages(d ...*DiscordMessage) *DiscordUserUpdate
- func (duu *DiscordUserUpdate) ClearDiscordMessages() *DiscordUserUpdate
- func (duu *DiscordUserUpdate) Exec(ctx context.Context) error
- func (duu *DiscordUserUpdate) ExecX(ctx context.Context)
- func (duu *DiscordUserUpdate) Mutation() *DiscordUserMutation
- func (duu *DiscordUserUpdate) RemoveDiscordMessageIDs(ids ...string) *DiscordUserUpdate
- func (duu *DiscordUserUpdate) RemoveDiscordMessages(d ...*DiscordMessage) *DiscordUserUpdate
- func (duu *DiscordUserUpdate) Save(ctx context.Context) (int, error)
- func (duu *DiscordUserUpdate) SaveX(ctx context.Context) int
- func (duu *DiscordUserUpdate) SetDiscordid(s string) *DiscordUserUpdate
- func (duu *DiscordUserUpdate) SetNillableDiscordid(s *string) *DiscordUserUpdate
- func (duu *DiscordUserUpdate) SetUsername(s string) *DiscordUserUpdate
- func (duu *DiscordUserUpdate) Where(ps ...predicate.DiscordUser) *DiscordUserUpdate
- type DiscordUserUpdateOne
- func (duuo *DiscordUserUpdateOne) AddDiscordMessageIDs(ids ...string) *DiscordUserUpdateOne
- func (duuo *DiscordUserUpdateOne) AddDiscordMessages(d ...*DiscordMessage) *DiscordUserUpdateOne
- func (duuo *DiscordUserUpdateOne) ClearDiscordMessages() *DiscordUserUpdateOne
- func (duuo *DiscordUserUpdateOne) Exec(ctx context.Context) error
- func (duuo *DiscordUserUpdateOne) ExecX(ctx context.Context)
- func (duuo *DiscordUserUpdateOne) Mutation() *DiscordUserMutation
- func (duuo *DiscordUserUpdateOne) RemoveDiscordMessageIDs(ids ...string) *DiscordUserUpdateOne
- func (duuo *DiscordUserUpdateOne) RemoveDiscordMessages(d ...*DiscordMessage) *DiscordUserUpdateOne
- func (duuo *DiscordUserUpdateOne) Save(ctx context.Context) (*DiscordUser, error)
- func (duuo *DiscordUserUpdateOne) SaveX(ctx context.Context) *DiscordUser
- func (duuo *DiscordUserUpdateOne) Select(field string, fields ...string) *DiscordUserUpdateOne
- func (duuo *DiscordUserUpdateOne) SetDiscordid(s string) *DiscordUserUpdateOne
- func (duuo *DiscordUserUpdateOne) SetNillableDiscordid(s *string) *DiscordUserUpdateOne
- func (duuo *DiscordUserUpdateOne) SetUsername(s string) *DiscordUserUpdateOne
- func (duuo *DiscordUserUpdateOne) Where(ps ...predicate.DiscordUser) *DiscordUserUpdateOne
- type DiscordUserUpsert
- type DiscordUserUpsertBulk
- func (u *DiscordUserUpsertBulk) DoNothing() *DiscordUserUpsertBulk
- func (u *DiscordUserUpsertBulk) Exec(ctx context.Context) error
- func (u *DiscordUserUpsertBulk) ExecX(ctx context.Context)
- func (u *DiscordUserUpsertBulk) Ignore() *DiscordUserUpsertBulk
- func (u *DiscordUserUpsertBulk) SetDiscordid(v string) *DiscordUserUpsertBulk
- func (u *DiscordUserUpsertBulk) SetUsername(v string) *DiscordUserUpsertBulk
- func (u *DiscordUserUpsertBulk) Update(set func(*DiscordUserUpsert)) *DiscordUserUpsertBulk
- func (u *DiscordUserUpsertBulk) UpdateDiscordid() *DiscordUserUpsertBulk
- func (u *DiscordUserUpsertBulk) UpdateNewValues() *DiscordUserUpsertBulk
- func (u *DiscordUserUpsertBulk) UpdateUsername() *DiscordUserUpsertBulk
- type DiscordUserUpsertOne
- func (u *DiscordUserUpsertOne) DoNothing() *DiscordUserUpsertOne
- func (u *DiscordUserUpsertOne) Exec(ctx context.Context) error
- func (u *DiscordUserUpsertOne) ExecX(ctx context.Context)
- func (u *DiscordUserUpsertOne) ID(ctx context.Context) (id uuid.UUID, err error)
- func (u *DiscordUserUpsertOne) IDX(ctx context.Context) uuid.UUID
- func (u *DiscordUserUpsertOne) Ignore() *DiscordUserUpsertOne
- func (u *DiscordUserUpsertOne) SetDiscordid(v string) *DiscordUserUpsertOne
- func (u *DiscordUserUpsertOne) SetUsername(v string) *DiscordUserUpsertOne
- func (u *DiscordUserUpsertOne) Update(set func(*DiscordUserUpsert)) *DiscordUserUpsertOne
- func (u *DiscordUserUpsertOne) UpdateDiscordid() *DiscordUserUpsertOne
- func (u *DiscordUserUpsertOne) UpdateNewValues() *DiscordUserUpsertOne
- func (u *DiscordUserUpsertOne) UpdateUsername() *DiscordUserUpsertOne
- type DiscordUsers
- type Hook
- type InterceptFunc
- type Interceptor
- type MutateFunc
- type Mutation
- type Mutator
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type OrderFunc
- type Policy
- type Querier
- type QuerierFunc
- type Query
- type QueryContext
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type TraverseFunc
- type Traverser
- type Tx
- type ValidationError
- type Value
Constants ¶
const ( // Operation types. OpCreate = ent.OpCreate OpDelete = ent.OpDelete OpDeleteOne = ent.OpDeleteOne OpUpdate = ent.OpUpdate OpUpdateOne = ent.OpUpdateOne // Node types. TypeBook = "Book" TypeBookAuthor = "BookAuthor" TypeDiscordMessage = "DiscordMessage" TypeDiscordUser = "DiscordUser" )
Variables ¶
This section is empty.
Functions ¶
func IsConstraintError ¶
IsConstraintError returns a boolean indicating whether the error is a constraint failure.
func IsNotFound ¶
IsNotFound returns a boolean indicating whether the error is a not found error.
func IsNotLoaded ¶
IsNotLoaded returns a boolean indicating whether the error is a not loaded error.
func IsNotSingular ¶
IsNotSingular returns a boolean indicating whether the error is a not singular error.
func IsValidationError ¶
IsValidationError returns a boolean indicating whether the error is a validation error.
func NewContext ¶
NewContext returns a new context with the given Client attached.
Types ¶
type AggregateFunc ¶
AggregateFunc applies an aggregation step on the group-by traversal/selector.
func As ¶
func As(fn AggregateFunc, end string) AggregateFunc
As is a pseudo aggregation function for renaming another other functions with custom names. For example:
GroupBy(field1, field2). Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")). Scan(ctx, &v)
func Count ¶
func Count() AggregateFunc
Count applies the "count" aggregation function on each group.
func Max ¶
func Max(field string) AggregateFunc
Max applies the "max" aggregation function on the given field of each group.
func Mean ¶
func Mean(field string) AggregateFunc
Mean applies the "mean" aggregation function on the given field of each group.
func Min ¶
func Min(field string) AggregateFunc
Min applies the "min" aggregation function on the given field of each group.
func Sum ¶
func Sum(field string) AggregateFunc
Sum applies the "sum" aggregation function on the given field of each group.
type Book ¶
type Book struct { // ID of the ent. ID uuid.UUID `json:"id,omitempty"` // Title holds the value of the "title" field. Title string `json:"title,omitempty"` // Description holds the value of the "description" field. Description string `json:"description,omitempty"` // GoodreadsID holds the value of the "goodreads_id" field. GoodreadsID string `json:"goodreads_id,omitempty"` // GoogleVolumeID holds the value of the "google_volume_id" field. GoogleVolumeID string `json:"google_volume_id,omitempty"` // Isbn10 holds the value of the "isbn_10" field. Isbn10 string `json:"isbn_10,omitempty"` // Isbn13 holds the value of the "isbn_13" field. Isbn13 string `json:"isbn_13,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the BookQuery when eager-loading is set. Edges BookEdges `json:"edges"` // contains filtered or unexported fields }
Book is the model entity for the Book schema.
func (*Book) NamedBookAuthor ¶
func (b *Book) NamedBookAuthor(name string) ([]*BookAuthor, error)
NamedBookAuthor returns the BookAuthor named value or an error if the edge was not loaded in eager-loading with this name.
func (*Book) QueryBookAuthor ¶
func (b *Book) QueryBookAuthor() *BookAuthorQuery
QueryBookAuthor queries the "book_author" edge of the Book entity.
func (*Book) Unwrap ¶
Unwrap unwraps the Book entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.
func (*Book) Update ¶
func (b *Book) Update() *BookUpdateOne
Update returns a builder for updating this Book. Note that you need to call Book.Unwrap() before calling this method if this Book was returned from a transaction, and the transaction was committed or rolled back.
type BookAuthor ¶
type BookAuthor struct { // ID of the ent. ID uuid.UUID `json:"id,omitempty"` // FullName holds the value of the "full_name" field. FullName string `json:"full_name,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the BookAuthorQuery when eager-loading is set. Edges BookAuthorEdges `json:"edges"` // contains filtered or unexported fields }
BookAuthor is the model entity for the BookAuthor schema.
func (*BookAuthor) NamedBooks ¶
func (ba *BookAuthor) NamedBooks(name string) ([]*Book, error)
NamedBooks returns the Books named value or an error if the edge was not loaded in eager-loading with this name.
func (*BookAuthor) QueryBooks ¶
func (ba *BookAuthor) QueryBooks() *BookQuery
QueryBooks queries the "books" edge of the BookAuthor entity.
func (*BookAuthor) String ¶
func (ba *BookAuthor) String() string
String implements the fmt.Stringer.
func (*BookAuthor) Unwrap ¶
func (ba *BookAuthor) Unwrap() *BookAuthor
Unwrap unwraps the BookAuthor entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.
func (*BookAuthor) Update ¶
func (ba *BookAuthor) Update() *BookAuthorUpdateOne
Update returns a builder for updating this BookAuthor. Note that you need to call BookAuthor.Unwrap() before calling this method if this BookAuthor was returned from a transaction, and the transaction was committed or rolled back.
type BookAuthorClient ¶
type BookAuthorClient struct {
// contains filtered or unexported fields
}
BookAuthorClient is a client for the BookAuthor schema.
func NewBookAuthorClient ¶
func NewBookAuthorClient(c config) *BookAuthorClient
NewBookAuthorClient returns a client for the BookAuthor from the given config.
func (*BookAuthorClient) Create ¶
func (c *BookAuthorClient) Create() *BookAuthorCreate
Create returns a builder for creating a BookAuthor entity.
func (*BookAuthorClient) CreateBulk ¶
func (c *BookAuthorClient) CreateBulk(builders ...*BookAuthorCreate) *BookAuthorCreateBulk
CreateBulk returns a builder for creating a bulk of BookAuthor entities.
func (*BookAuthorClient) Delete ¶
func (c *BookAuthorClient) Delete() *BookAuthorDelete
Delete returns a delete builder for BookAuthor.
func (*BookAuthorClient) DeleteOne ¶
func (c *BookAuthorClient) DeleteOne(ba *BookAuthor) *BookAuthorDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*BookAuthorClient) DeleteOneID ¶
func (c *BookAuthorClient) DeleteOneID(id uuid.UUID) *BookAuthorDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*BookAuthorClient) Get ¶
func (c *BookAuthorClient) Get(ctx context.Context, id uuid.UUID) (*BookAuthor, error)
Get returns a BookAuthor entity by its id.
func (*BookAuthorClient) GetX ¶
func (c *BookAuthorClient) GetX(ctx context.Context, id uuid.UUID) *BookAuthor
GetX is like Get, but panics if an error occurs.
func (*BookAuthorClient) Hooks ¶
func (c *BookAuthorClient) Hooks() []Hook
Hooks returns the client hooks.
func (*BookAuthorClient) Intercept ¶
func (c *BookAuthorClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `bookauthor.Intercept(f(g(h())))`.
func (*BookAuthorClient) Interceptors ¶
func (c *BookAuthorClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*BookAuthorClient) Query ¶
func (c *BookAuthorClient) Query() *BookAuthorQuery
Query returns a query builder for BookAuthor.
func (*BookAuthorClient) QueryBooks ¶
func (c *BookAuthorClient) QueryBooks(ba *BookAuthor) *BookQuery
QueryBooks queries the books edge of a BookAuthor.
func (*BookAuthorClient) Update ¶
func (c *BookAuthorClient) Update() *BookAuthorUpdate
Update returns an update builder for BookAuthor.
func (*BookAuthorClient) UpdateOne ¶
func (c *BookAuthorClient) UpdateOne(ba *BookAuthor) *BookAuthorUpdateOne
UpdateOne returns an update builder for the given entity.
func (*BookAuthorClient) UpdateOneID ¶
func (c *BookAuthorClient) UpdateOneID(id uuid.UUID) *BookAuthorUpdateOne
UpdateOneID returns an update builder for the given id.
func (*BookAuthorClient) Use ¶
func (c *BookAuthorClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `bookauthor.Hooks(f(g(h())))`.
type BookAuthorCreate ¶
type BookAuthorCreate struct {
// contains filtered or unexported fields
}
BookAuthorCreate is the builder for creating a BookAuthor entity.
func (*BookAuthorCreate) AddBookIDs ¶
func (bac *BookAuthorCreate) AddBookIDs(ids ...uuid.UUID) *BookAuthorCreate
AddBookIDs adds the "books" edge to the Book entity by IDs.
func (*BookAuthorCreate) AddBooks ¶
func (bac *BookAuthorCreate) AddBooks(b ...*Book) *BookAuthorCreate
AddBooks adds the "books" edges to the Book entity.
func (*BookAuthorCreate) Exec ¶
func (bac *BookAuthorCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*BookAuthorCreate) ExecX ¶
func (bac *BookAuthorCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BookAuthorCreate) Mutation ¶
func (bac *BookAuthorCreate) Mutation() *BookAuthorMutation
Mutation returns the BookAuthorMutation object of the builder.
func (*BookAuthorCreate) OnConflict ¶
func (bac *BookAuthorCreate) OnConflict(opts ...sql.ConflictOption) *BookAuthorUpsertOne
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.BookAuthor.Create(). SetFullName(v). OnConflict( // Update the row with the new values // the was proposed for insertion. sql.ResolveWithNewValues(), ). // Override some of the fields with custom // update values. Update(func(u *ent.BookAuthorUpsert) { SetFullName(v+v). }). Exec(ctx)
func (*BookAuthorCreate) OnConflictColumns ¶
func (bac *BookAuthorCreate) OnConflictColumns(columns ...string) *BookAuthorUpsertOne
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.BookAuthor.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*BookAuthorCreate) Save ¶
func (bac *BookAuthorCreate) Save(ctx context.Context) (*BookAuthor, error)
Save creates the BookAuthor in the database.
func (*BookAuthorCreate) SaveX ¶
func (bac *BookAuthorCreate) SaveX(ctx context.Context) *BookAuthor
SaveX calls Save and panics if Save returns an error.
func (*BookAuthorCreate) SetFullName ¶
func (bac *BookAuthorCreate) SetFullName(s string) *BookAuthorCreate
SetFullName sets the "full_name" field.
func (*BookAuthorCreate) SetID ¶
func (bac *BookAuthorCreate) SetID(u uuid.UUID) *BookAuthorCreate
SetID sets the "id" field.
type BookAuthorCreateBulk ¶
type BookAuthorCreateBulk struct {
// contains filtered or unexported fields
}
BookAuthorCreateBulk is the builder for creating many BookAuthor entities in bulk.
func (*BookAuthorCreateBulk) Exec ¶
func (bacb *BookAuthorCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*BookAuthorCreateBulk) ExecX ¶
func (bacb *BookAuthorCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BookAuthorCreateBulk) OnConflict ¶
func (bacb *BookAuthorCreateBulk) OnConflict(opts ...sql.ConflictOption) *BookAuthorUpsertBulk
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.BookAuthor.CreateBulk(builders...). OnConflict( // Update the row with the new values // the was proposed for insertion. sql.ResolveWithNewValues(), ). // Override some of the fields with custom // update values. Update(func(u *ent.BookAuthorUpsert) { SetFullName(v+v). }). Exec(ctx)
func (*BookAuthorCreateBulk) OnConflictColumns ¶
func (bacb *BookAuthorCreateBulk) OnConflictColumns(columns ...string) *BookAuthorUpsertBulk
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.BookAuthor.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*BookAuthorCreateBulk) Save ¶
func (bacb *BookAuthorCreateBulk) Save(ctx context.Context) ([]*BookAuthor, error)
Save creates the BookAuthor entities in the database.
func (*BookAuthorCreateBulk) SaveX ¶
func (bacb *BookAuthorCreateBulk) SaveX(ctx context.Context) []*BookAuthor
SaveX is like Save, but panics if an error occurs.
type BookAuthorDelete ¶
type BookAuthorDelete struct {
// contains filtered or unexported fields
}
BookAuthorDelete is the builder for deleting a BookAuthor entity.
func (*BookAuthorDelete) Exec ¶
func (bad *BookAuthorDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*BookAuthorDelete) ExecX ¶
func (bad *BookAuthorDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*BookAuthorDelete) Where ¶
func (bad *BookAuthorDelete) Where(ps ...predicate.BookAuthor) *BookAuthorDelete
Where appends a list predicates to the BookAuthorDelete builder.
type BookAuthorDeleteOne ¶
type BookAuthorDeleteOne struct {
// contains filtered or unexported fields
}
BookAuthorDeleteOne is the builder for deleting a single BookAuthor entity.
func (*BookAuthorDeleteOne) Exec ¶
func (bado *BookAuthorDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*BookAuthorDeleteOne) ExecX ¶
func (bado *BookAuthorDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BookAuthorDeleteOne) Where ¶
func (bado *BookAuthorDeleteOne) Where(ps ...predicate.BookAuthor) *BookAuthorDeleteOne
Where appends a list predicates to the BookAuthorDelete builder.
type BookAuthorEdges ¶
type BookAuthorEdges struct { // Books holds the value of the books edge. Books []*Book `json:"books,omitempty"` // contains filtered or unexported fields }
BookAuthorEdges holds the relations/edges for other nodes in the graph.
func (BookAuthorEdges) BooksOrErr ¶
func (e BookAuthorEdges) BooksOrErr() ([]*Book, error)
BooksOrErr returns the Books value or an error if the edge was not loaded in eager-loading.
type BookAuthorGroupBy ¶
type BookAuthorGroupBy struct {
// contains filtered or unexported fields
}
BookAuthorGroupBy is the group-by builder for BookAuthor entities.
func (*BookAuthorGroupBy) Aggregate ¶
func (bagb *BookAuthorGroupBy) Aggregate(fns ...AggregateFunc) *BookAuthorGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*BookAuthorGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*BookAuthorGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*BookAuthorGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*BookAuthorGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*BookAuthorGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*BookAuthorGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*BookAuthorGroupBy) Scan ¶
func (bagb *BookAuthorGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*BookAuthorGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type BookAuthorMutation ¶
type BookAuthorMutation struct {
// contains filtered or unexported fields
}
BookAuthorMutation represents an operation that mutates the BookAuthor nodes in the graph.
func (*BookAuthorMutation) AddBookIDs ¶
func (m *BookAuthorMutation) AddBookIDs(ids ...uuid.UUID)
AddBookIDs adds the "books" edge to the Book entity by ids.
func (*BookAuthorMutation) AddField ¶
func (m *BookAuthorMutation) AddField(name string, value ent.Value) error
AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*BookAuthorMutation) AddedEdges ¶
func (m *BookAuthorMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*BookAuthorMutation) AddedField ¶
func (m *BookAuthorMutation) AddedField(name string) (ent.Value, bool)
AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*BookAuthorMutation) AddedFields ¶
func (m *BookAuthorMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*BookAuthorMutation) AddedIDs ¶
func (m *BookAuthorMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*BookAuthorMutation) BooksCleared ¶
func (m *BookAuthorMutation) BooksCleared() bool
BooksCleared reports if the "books" edge to the Book entity was cleared.
func (*BookAuthorMutation) BooksIDs ¶
func (m *BookAuthorMutation) BooksIDs() (ids []uuid.UUID)
BooksIDs returns the "books" edge IDs in the mutation.
func (*BookAuthorMutation) ClearBooks ¶
func (m *BookAuthorMutation) ClearBooks()
ClearBooks clears the "books" edge to the Book entity.
func (*BookAuthorMutation) ClearEdge ¶
func (m *BookAuthorMutation) ClearEdge(name string) error
ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.
func (*BookAuthorMutation) ClearField ¶
func (m *BookAuthorMutation) ClearField(name string) error
ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.
func (*BookAuthorMutation) ClearedEdges ¶
func (m *BookAuthorMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*BookAuthorMutation) ClearedFields ¶
func (m *BookAuthorMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (BookAuthorMutation) Client ¶
func (m BookAuthorMutation) Client() *Client
Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.
func (*BookAuthorMutation) EdgeCleared ¶
func (m *BookAuthorMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*BookAuthorMutation) Field ¶
func (m *BookAuthorMutation) Field(name string) (ent.Value, bool)
Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*BookAuthorMutation) FieldCleared ¶
func (m *BookAuthorMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*BookAuthorMutation) Fields ¶
func (m *BookAuthorMutation) Fields() []string
Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().
func (*BookAuthorMutation) FullName ¶
func (m *BookAuthorMutation) FullName() (r string, exists bool)
FullName returns the value of the "full_name" field in the mutation.
func (*BookAuthorMutation) ID ¶
func (m *BookAuthorMutation) ID() (id uuid.UUID, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*BookAuthorMutation) IDs ¶
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*BookAuthorMutation) OldField ¶
OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.
func (*BookAuthorMutation) OldFullName ¶
func (m *BookAuthorMutation) OldFullName(ctx context.Context) (v string, err error)
OldFullName returns the old "full_name" field's value of the BookAuthor entity. If the BookAuthor object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*BookAuthorMutation) RemoveBookIDs ¶
func (m *BookAuthorMutation) RemoveBookIDs(ids ...uuid.UUID)
RemoveBookIDs removes the "books" edge to the Book entity by IDs.
func (*BookAuthorMutation) RemovedBooksIDs ¶
func (m *BookAuthorMutation) RemovedBooksIDs() (ids []uuid.UUID)
RemovedBooks returns the removed IDs of the "books" edge to the Book entity.
func (*BookAuthorMutation) RemovedEdges ¶
func (m *BookAuthorMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*BookAuthorMutation) RemovedIDs ¶
func (m *BookAuthorMutation) RemovedIDs(name string) []ent.Value
RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.
func (*BookAuthorMutation) ResetBooks ¶
func (m *BookAuthorMutation) ResetBooks()
ResetBooks resets all changes to the "books" edge.
func (*BookAuthorMutation) ResetEdge ¶
func (m *BookAuthorMutation) ResetEdge(name string) error
ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.
func (*BookAuthorMutation) ResetField ¶
func (m *BookAuthorMutation) ResetField(name string) error
ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.
func (*BookAuthorMutation) ResetFullName ¶
func (m *BookAuthorMutation) ResetFullName()
ResetFullName resets all changes to the "full_name" field.
func (*BookAuthorMutation) SetField ¶
func (m *BookAuthorMutation) SetField(name string, value ent.Value) error
SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*BookAuthorMutation) SetFullName ¶
func (m *BookAuthorMutation) SetFullName(s string)
SetFullName sets the "full_name" field.
func (*BookAuthorMutation) SetID ¶
func (m *BookAuthorMutation) SetID(id uuid.UUID)
SetID sets the value of the id field. Note that this operation is only accepted on creation of BookAuthor entities.
func (*BookAuthorMutation) SetOp ¶
func (m *BookAuthorMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (BookAuthorMutation) Tx ¶
func (m BookAuthorMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*BookAuthorMutation) Type ¶
func (m *BookAuthorMutation) Type() string
Type returns the node type of this mutation (BookAuthor).
func (*BookAuthorMutation) Where ¶
func (m *BookAuthorMutation) Where(ps ...predicate.BookAuthor)
Where appends a list predicates to the BookAuthorMutation builder.
func (*BookAuthorMutation) WhereP ¶
func (m *BookAuthorMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the BookAuthorMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type BookAuthorQuery ¶
type BookAuthorQuery struct {
// contains filtered or unexported fields
}
BookAuthorQuery is the builder for querying BookAuthor entities.
func (*BookAuthorQuery) Aggregate ¶
func (baq *BookAuthorQuery) Aggregate(fns ...AggregateFunc) *BookAuthorSelect
Aggregate returns a BookAuthorSelect configured with the given aggregations.
func (*BookAuthorQuery) All ¶
func (baq *BookAuthorQuery) All(ctx context.Context) ([]*BookAuthor, error)
All executes the query and returns a list of BookAuthors.
func (*BookAuthorQuery) AllX ¶
func (baq *BookAuthorQuery) AllX(ctx context.Context) []*BookAuthor
AllX is like All, but panics if an error occurs.
func (*BookAuthorQuery) Clone ¶
func (baq *BookAuthorQuery) Clone() *BookAuthorQuery
Clone returns a duplicate of the BookAuthorQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*BookAuthorQuery) Count ¶
func (baq *BookAuthorQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*BookAuthorQuery) CountX ¶
func (baq *BookAuthorQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*BookAuthorQuery) Exist ¶
func (baq *BookAuthorQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*BookAuthorQuery) ExistX ¶
func (baq *BookAuthorQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*BookAuthorQuery) First ¶
func (baq *BookAuthorQuery) First(ctx context.Context) (*BookAuthor, error)
First returns the first BookAuthor entity from the query. Returns a *NotFoundError when no BookAuthor was found.
func (*BookAuthorQuery) FirstID ¶
FirstID returns the first BookAuthor ID from the query. Returns a *NotFoundError when no BookAuthor ID was found.
func (*BookAuthorQuery) FirstIDX ¶
func (baq *BookAuthorQuery) FirstIDX(ctx context.Context) uuid.UUID
FirstIDX is like FirstID, but panics if an error occurs.
func (*BookAuthorQuery) FirstX ¶
func (baq *BookAuthorQuery) FirstX(ctx context.Context) *BookAuthor
FirstX is like First, but panics if an error occurs.
func (*BookAuthorQuery) ForShare ¶
func (baq *BookAuthorQuery) ForShare(opts ...sql.LockOption) *BookAuthorQuery
ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.
func (*BookAuthorQuery) ForUpdate ¶
func (baq *BookAuthorQuery) ForUpdate(opts ...sql.LockOption) *BookAuthorQuery
ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.
func (*BookAuthorQuery) GroupBy ¶
func (baq *BookAuthorQuery) GroupBy(field string, fields ...string) *BookAuthorGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { FullName string `json:"full_name,omitempty"` Count int `json:"count,omitempty"` } client.BookAuthor.Query(). GroupBy(bookauthor.FieldFullName). Aggregate(ent.Count()). Scan(ctx, &v)
func (*BookAuthorQuery) IDsX ¶
func (baq *BookAuthorQuery) IDsX(ctx context.Context) []uuid.UUID
IDsX is like IDs, but panics if an error occurs.
func (*BookAuthorQuery) Limit ¶
func (baq *BookAuthorQuery) Limit(limit int) *BookAuthorQuery
Limit the number of records to be returned by this query.
func (*BookAuthorQuery) Offset ¶
func (baq *BookAuthorQuery) Offset(offset int) *BookAuthorQuery
Offset to start from.
func (*BookAuthorQuery) Only ¶
func (baq *BookAuthorQuery) Only(ctx context.Context) (*BookAuthor, error)
Only returns a single BookAuthor entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one BookAuthor entity is found. Returns a *NotFoundError when no BookAuthor entities are found.
func (*BookAuthorQuery) OnlyID ¶
OnlyID is like Only, but returns the only BookAuthor ID in the query. Returns a *NotSingularError when more than one BookAuthor ID is found. Returns a *NotFoundError when no entities are found.
func (*BookAuthorQuery) OnlyIDX ¶
func (baq *BookAuthorQuery) OnlyIDX(ctx context.Context) uuid.UUID
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*BookAuthorQuery) OnlyX ¶
func (baq *BookAuthorQuery) OnlyX(ctx context.Context) *BookAuthor
OnlyX is like Only, but panics if an error occurs.
func (*BookAuthorQuery) Order ¶
func (baq *BookAuthorQuery) Order(o ...bookauthor.OrderOption) *BookAuthorQuery
Order specifies how the records should be ordered.
func (*BookAuthorQuery) QueryBooks ¶
func (baq *BookAuthorQuery) QueryBooks() *BookQuery
QueryBooks chains the current query on the "books" edge.
func (*BookAuthorQuery) Select ¶
func (baq *BookAuthorQuery) Select(fields ...string) *BookAuthorSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { FullName string `json:"full_name,omitempty"` } client.BookAuthor.Query(). Select(bookauthor.FieldFullName). Scan(ctx, &v)
func (*BookAuthorQuery) Unique ¶
func (baq *BookAuthorQuery) Unique(unique bool) *BookAuthorQuery
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
func (*BookAuthorQuery) Where ¶
func (baq *BookAuthorQuery) Where(ps ...predicate.BookAuthor) *BookAuthorQuery
Where adds a new predicate for the BookAuthorQuery builder.
func (*BookAuthorQuery) WithBooks ¶
func (baq *BookAuthorQuery) WithBooks(opts ...func(*BookQuery)) *BookAuthorQuery
WithBooks tells the query-builder to eager-load the nodes that are connected to the "books" edge. The optional arguments are used to configure the query builder of the edge.
func (*BookAuthorQuery) WithNamedBooks ¶
func (baq *BookAuthorQuery) WithNamedBooks(name string, opts ...func(*BookQuery)) *BookAuthorQuery
WithNamedBooks tells the query-builder to eager-load the nodes that are connected to the "books" edge with the given name. The optional arguments are used to configure the query builder of the edge.
type BookAuthorSelect ¶
type BookAuthorSelect struct { *BookAuthorQuery // contains filtered or unexported fields }
BookAuthorSelect is the builder for selecting fields of BookAuthor entities.
func (*BookAuthorSelect) Aggregate ¶
func (bas *BookAuthorSelect) Aggregate(fns ...AggregateFunc) *BookAuthorSelect
Aggregate adds the given aggregation functions to the selector query.
func (*BookAuthorSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*BookAuthorSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*BookAuthorSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*BookAuthorSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*BookAuthorSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*BookAuthorSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*BookAuthorSelect) Scan ¶
func (bas *BookAuthorSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*BookAuthorSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type BookAuthorUpdate ¶
type BookAuthorUpdate struct {
// contains filtered or unexported fields
}
BookAuthorUpdate is the builder for updating BookAuthor entities.
func (*BookAuthorUpdate) AddBookIDs ¶
func (bau *BookAuthorUpdate) AddBookIDs(ids ...uuid.UUID) *BookAuthorUpdate
AddBookIDs adds the "books" edge to the Book entity by IDs.
func (*BookAuthorUpdate) AddBooks ¶
func (bau *BookAuthorUpdate) AddBooks(b ...*Book) *BookAuthorUpdate
AddBooks adds the "books" edges to the Book entity.
func (*BookAuthorUpdate) ClearBooks ¶
func (bau *BookAuthorUpdate) ClearBooks() *BookAuthorUpdate
ClearBooks clears all "books" edges to the Book entity.
func (*BookAuthorUpdate) Exec ¶
func (bau *BookAuthorUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*BookAuthorUpdate) ExecX ¶
func (bau *BookAuthorUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BookAuthorUpdate) Mutation ¶
func (bau *BookAuthorUpdate) Mutation() *BookAuthorMutation
Mutation returns the BookAuthorMutation object of the builder.
func (*BookAuthorUpdate) RemoveBookIDs ¶
func (bau *BookAuthorUpdate) RemoveBookIDs(ids ...uuid.UUID) *BookAuthorUpdate
RemoveBookIDs removes the "books" edge to Book entities by IDs.
func (*BookAuthorUpdate) RemoveBooks ¶
func (bau *BookAuthorUpdate) RemoveBooks(b ...*Book) *BookAuthorUpdate
RemoveBooks removes "books" edges to Book entities.
func (*BookAuthorUpdate) Save ¶
func (bau *BookAuthorUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*BookAuthorUpdate) SaveX ¶
func (bau *BookAuthorUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*BookAuthorUpdate) SetFullName ¶
func (bau *BookAuthorUpdate) SetFullName(s string) *BookAuthorUpdate
SetFullName sets the "full_name" field.
func (*BookAuthorUpdate) Where ¶
func (bau *BookAuthorUpdate) Where(ps ...predicate.BookAuthor) *BookAuthorUpdate
Where appends a list predicates to the BookAuthorUpdate builder.
type BookAuthorUpdateOne ¶
type BookAuthorUpdateOne struct {
// contains filtered or unexported fields
}
BookAuthorUpdateOne is the builder for updating a single BookAuthor entity.
func (*BookAuthorUpdateOne) AddBookIDs ¶
func (bauo *BookAuthorUpdateOne) AddBookIDs(ids ...uuid.UUID) *BookAuthorUpdateOne
AddBookIDs adds the "books" edge to the Book entity by IDs.
func (*BookAuthorUpdateOne) AddBooks ¶
func (bauo *BookAuthorUpdateOne) AddBooks(b ...*Book) *BookAuthorUpdateOne
AddBooks adds the "books" edges to the Book entity.
func (*BookAuthorUpdateOne) ClearBooks ¶
func (bauo *BookAuthorUpdateOne) ClearBooks() *BookAuthorUpdateOne
ClearBooks clears all "books" edges to the Book entity.
func (*BookAuthorUpdateOne) Exec ¶
func (bauo *BookAuthorUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*BookAuthorUpdateOne) ExecX ¶
func (bauo *BookAuthorUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BookAuthorUpdateOne) Mutation ¶
func (bauo *BookAuthorUpdateOne) Mutation() *BookAuthorMutation
Mutation returns the BookAuthorMutation object of the builder.
func (*BookAuthorUpdateOne) RemoveBookIDs ¶
func (bauo *BookAuthorUpdateOne) RemoveBookIDs(ids ...uuid.UUID) *BookAuthorUpdateOne
RemoveBookIDs removes the "books" edge to Book entities by IDs.
func (*BookAuthorUpdateOne) RemoveBooks ¶
func (bauo *BookAuthorUpdateOne) RemoveBooks(b ...*Book) *BookAuthorUpdateOne
RemoveBooks removes "books" edges to Book entities.
func (*BookAuthorUpdateOne) Save ¶
func (bauo *BookAuthorUpdateOne) Save(ctx context.Context) (*BookAuthor, error)
Save executes the query and returns the updated BookAuthor entity.
func (*BookAuthorUpdateOne) SaveX ¶
func (bauo *BookAuthorUpdateOne) SaveX(ctx context.Context) *BookAuthor
SaveX is like Save, but panics if an error occurs.
func (*BookAuthorUpdateOne) Select ¶
func (bauo *BookAuthorUpdateOne) Select(field string, fields ...string) *BookAuthorUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*BookAuthorUpdateOne) SetFullName ¶
func (bauo *BookAuthorUpdateOne) SetFullName(s string) *BookAuthorUpdateOne
SetFullName sets the "full_name" field.
func (*BookAuthorUpdateOne) Where ¶
func (bauo *BookAuthorUpdateOne) Where(ps ...predicate.BookAuthor) *BookAuthorUpdateOne
Where appends a list predicates to the BookAuthorUpdate builder.
type BookAuthorUpsert ¶
BookAuthorUpsert is the "OnConflict" setter.
func (*BookAuthorUpsert) SetFullName ¶
func (u *BookAuthorUpsert) SetFullName(v string) *BookAuthorUpsert
SetFullName sets the "full_name" field.
func (*BookAuthorUpsert) UpdateFullName ¶
func (u *BookAuthorUpsert) UpdateFullName() *BookAuthorUpsert
UpdateFullName sets the "full_name" field to the value that was provided on create.
type BookAuthorUpsertBulk ¶
type BookAuthorUpsertBulk struct {
// contains filtered or unexported fields
}
BookAuthorUpsertBulk is the builder for "upsert"-ing a bulk of BookAuthor nodes.
func (*BookAuthorUpsertBulk) DoNothing ¶
func (u *BookAuthorUpsertBulk) DoNothing() *BookAuthorUpsertBulk
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*BookAuthorUpsertBulk) Exec ¶
func (u *BookAuthorUpsertBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*BookAuthorUpsertBulk) ExecX ¶
func (u *BookAuthorUpsertBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BookAuthorUpsertBulk) Ignore ¶
func (u *BookAuthorUpsertBulk) Ignore() *BookAuthorUpsertBulk
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.BookAuthor.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*BookAuthorUpsertBulk) SetFullName ¶
func (u *BookAuthorUpsertBulk) SetFullName(v string) *BookAuthorUpsertBulk
SetFullName sets the "full_name" field.
func (*BookAuthorUpsertBulk) Update ¶
func (u *BookAuthorUpsertBulk) Update(set func(*BookAuthorUpsert)) *BookAuthorUpsertBulk
Update allows overriding fields `UPDATE` values. See the BookAuthorCreateBulk.OnConflict documentation for more info.
func (*BookAuthorUpsertBulk) UpdateFullName ¶
func (u *BookAuthorUpsertBulk) UpdateFullName() *BookAuthorUpsertBulk
UpdateFullName sets the "full_name" field to the value that was provided on create.
func (*BookAuthorUpsertBulk) UpdateNewValues ¶
func (u *BookAuthorUpsertBulk) UpdateNewValues() *BookAuthorUpsertBulk
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.BookAuthor.Create(). OnConflict( sql.ResolveWithNewValues(), sql.ResolveWith(func(u *sql.UpdateSet) { u.SetIgnore(bookauthor.FieldID) }), ). Exec(ctx)
type BookAuthorUpsertOne ¶
type BookAuthorUpsertOne struct {
// contains filtered or unexported fields
}
BookAuthorUpsertOne is the builder for "upsert"-ing
one BookAuthor node.
func (*BookAuthorUpsertOne) DoNothing ¶
func (u *BookAuthorUpsertOne) DoNothing() *BookAuthorUpsertOne
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*BookAuthorUpsertOne) Exec ¶
func (u *BookAuthorUpsertOne) Exec(ctx context.Context) error
Exec executes the query.
func (*BookAuthorUpsertOne) ExecX ¶
func (u *BookAuthorUpsertOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BookAuthorUpsertOne) ID ¶
Exec executes the UPSERT query and returns the inserted/updated ID.
func (*BookAuthorUpsertOne) IDX ¶
func (u *BookAuthorUpsertOne) IDX(ctx context.Context) uuid.UUID
IDX is like ID, but panics if an error occurs.
func (*BookAuthorUpsertOne) Ignore ¶
func (u *BookAuthorUpsertOne) Ignore() *BookAuthorUpsertOne
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.BookAuthor.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*BookAuthorUpsertOne) SetFullName ¶
func (u *BookAuthorUpsertOne) SetFullName(v string) *BookAuthorUpsertOne
SetFullName sets the "full_name" field.
func (*BookAuthorUpsertOne) Update ¶
func (u *BookAuthorUpsertOne) Update(set func(*BookAuthorUpsert)) *BookAuthorUpsertOne
Update allows overriding fields `UPDATE` values. See the BookAuthorCreate.OnConflict documentation for more info.
func (*BookAuthorUpsertOne) UpdateFullName ¶
func (u *BookAuthorUpsertOne) UpdateFullName() *BookAuthorUpsertOne
UpdateFullName sets the "full_name" field to the value that was provided on create.
func (*BookAuthorUpsertOne) UpdateNewValues ¶
func (u *BookAuthorUpsertOne) UpdateNewValues() *BookAuthorUpsertOne
UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:
client.BookAuthor.Create(). OnConflict( sql.ResolveWithNewValues(), sql.ResolveWith(func(u *sql.UpdateSet) { u.SetIgnore(bookauthor.FieldID) }), ). Exec(ctx)
type BookClient ¶
type BookClient struct {
// contains filtered or unexported fields
}
BookClient is a client for the Book schema.
func NewBookClient ¶
func NewBookClient(c config) *BookClient
NewBookClient returns a client for the Book from the given config.
func (*BookClient) Create ¶
func (c *BookClient) Create() *BookCreate
Create returns a builder for creating a Book entity.
func (*BookClient) CreateBulk ¶
func (c *BookClient) CreateBulk(builders ...*BookCreate) *BookCreateBulk
CreateBulk returns a builder for creating a bulk of Book entities.
func (*BookClient) Delete ¶
func (c *BookClient) Delete() *BookDelete
Delete returns a delete builder for Book.
func (*BookClient) DeleteOne ¶
func (c *BookClient) DeleteOne(b *Book) *BookDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*BookClient) DeleteOneID ¶
func (c *BookClient) DeleteOneID(id uuid.UUID) *BookDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*BookClient) Intercept ¶
func (c *BookClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `book.Intercept(f(g(h())))`.
func (*BookClient) Interceptors ¶
func (c *BookClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*BookClient) Query ¶
func (c *BookClient) Query() *BookQuery
Query returns a query builder for Book.
func (*BookClient) QueryBookAuthor ¶
func (c *BookClient) QueryBookAuthor(b *Book) *BookAuthorQuery
QueryBookAuthor queries the book_author edge of a Book.
func (*BookClient) Update ¶
func (c *BookClient) Update() *BookUpdate
Update returns an update builder for Book.
func (*BookClient) UpdateOne ¶
func (c *BookClient) UpdateOne(b *Book) *BookUpdateOne
UpdateOne returns an update builder for the given entity.
func (*BookClient) UpdateOneID ¶
func (c *BookClient) UpdateOneID(id uuid.UUID) *BookUpdateOne
UpdateOneID returns an update builder for the given id.
func (*BookClient) Use ¶
func (c *BookClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `book.Hooks(f(g(h())))`.
type BookCreate ¶
type BookCreate struct {
// contains filtered or unexported fields
}
BookCreate is the builder for creating a Book entity.
func (*BookCreate) AddBookAuthor ¶
func (bc *BookCreate) AddBookAuthor(b ...*BookAuthor) *BookCreate
AddBookAuthor adds the "book_author" edges to the BookAuthor entity.
func (*BookCreate) AddBookAuthorIDs ¶
func (bc *BookCreate) AddBookAuthorIDs(ids ...uuid.UUID) *BookCreate
AddBookAuthorIDs adds the "book_author" edge to the BookAuthor entity by IDs.
func (*BookCreate) Exec ¶
func (bc *BookCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*BookCreate) ExecX ¶
func (bc *BookCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BookCreate) Mutation ¶
func (bc *BookCreate) Mutation() *BookMutation
Mutation returns the BookMutation object of the builder.
func (*BookCreate) OnConflict ¶
func (bc *BookCreate) OnConflict(opts ...sql.ConflictOption) *BookUpsertOne
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.Book.Create(). SetTitle(v). OnConflict( // Update the row with the new values // the was proposed for insertion. sql.ResolveWithNewValues(), ). // Override some of the fields with custom // update values. Update(func(u *ent.BookUpsert) { SetTitle(v+v). }). Exec(ctx)
func (*BookCreate) OnConflictColumns ¶
func (bc *BookCreate) OnConflictColumns(columns ...string) *BookUpsertOne
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.Book.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*BookCreate) Save ¶
func (bc *BookCreate) Save(ctx context.Context) (*Book, error)
Save creates the Book in the database.
func (*BookCreate) SaveX ¶
func (bc *BookCreate) SaveX(ctx context.Context) *Book
SaveX calls Save and panics if Save returns an error.
func (*BookCreate) SetDescription ¶
func (bc *BookCreate) SetDescription(s string) *BookCreate
SetDescription sets the "description" field.
func (*BookCreate) SetGoodreadsID ¶
func (bc *BookCreate) SetGoodreadsID(s string) *BookCreate
SetGoodreadsID sets the "goodreads_id" field.
func (*BookCreate) SetGoogleVolumeID ¶
func (bc *BookCreate) SetGoogleVolumeID(s string) *BookCreate
SetGoogleVolumeID sets the "google_volume_id" field.
func (*BookCreate) SetID ¶
func (bc *BookCreate) SetID(u uuid.UUID) *BookCreate
SetID sets the "id" field.
func (*BookCreate) SetIsbn10 ¶
func (bc *BookCreate) SetIsbn10(s string) *BookCreate
SetIsbn10 sets the "isbn_10" field.
func (*BookCreate) SetIsbn13 ¶
func (bc *BookCreate) SetIsbn13(s string) *BookCreate
SetIsbn13 sets the "isbn_13" field.
func (*BookCreate) SetTitle ¶
func (bc *BookCreate) SetTitle(s string) *BookCreate
SetTitle sets the "title" field.
type BookCreateBulk ¶
type BookCreateBulk struct {
// contains filtered or unexported fields
}
BookCreateBulk is the builder for creating many Book entities in bulk.
func (*BookCreateBulk) Exec ¶
func (bcb *BookCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*BookCreateBulk) ExecX ¶
func (bcb *BookCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BookCreateBulk) OnConflict ¶
func (bcb *BookCreateBulk) OnConflict(opts ...sql.ConflictOption) *BookUpsertBulk
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.Book.CreateBulk(builders...). OnConflict( // Update the row with the new values // the was proposed for insertion. sql.ResolveWithNewValues(), ). // Override some of the fields with custom // update values. Update(func(u *ent.BookUpsert) { SetTitle(v+v). }). Exec(ctx)
func (*BookCreateBulk) OnConflictColumns ¶
func (bcb *BookCreateBulk) OnConflictColumns(columns ...string) *BookUpsertBulk
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.Book.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
type BookDelete ¶
type BookDelete struct {
// contains filtered or unexported fields
}
BookDelete is the builder for deleting a Book entity.
func (*BookDelete) Exec ¶
func (bd *BookDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*BookDelete) ExecX ¶
func (bd *BookDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*BookDelete) Where ¶
func (bd *BookDelete) Where(ps ...predicate.Book) *BookDelete
Where appends a list predicates to the BookDelete builder.
type BookDeleteOne ¶
type BookDeleteOne struct {
// contains filtered or unexported fields
}
BookDeleteOne is the builder for deleting a single Book entity.
func (*BookDeleteOne) Exec ¶
func (bdo *BookDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*BookDeleteOne) ExecX ¶
func (bdo *BookDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BookDeleteOne) Where ¶
func (bdo *BookDeleteOne) Where(ps ...predicate.Book) *BookDeleteOne
Where appends a list predicates to the BookDelete builder.
type BookEdges ¶
type BookEdges struct { // BookAuthor holds the value of the book_author edge. BookAuthor []*BookAuthor `json:"book_author,omitempty"` // contains filtered or unexported fields }
BookEdges holds the relations/edges for other nodes in the graph.
func (BookEdges) BookAuthorOrErr ¶
func (e BookEdges) BookAuthorOrErr() ([]*BookAuthor, error)
BookAuthorOrErr returns the BookAuthor value or an error if the edge was not loaded in eager-loading.
type BookGroupBy ¶
type BookGroupBy struct {
// contains filtered or unexported fields
}
BookGroupBy is the group-by builder for Book entities.
func (*BookGroupBy) Aggregate ¶
func (bgb *BookGroupBy) Aggregate(fns ...AggregateFunc) *BookGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*BookGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*BookGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*BookGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*BookGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*BookGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*BookGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*BookGroupBy) Scan ¶
func (bgb *BookGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*BookGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type BookMutation ¶
type BookMutation struct {
// contains filtered or unexported fields
}
BookMutation represents an operation that mutates the Book nodes in the graph.
func (*BookMutation) AddBookAuthorIDs ¶
func (m *BookMutation) AddBookAuthorIDs(ids ...uuid.UUID)
AddBookAuthorIDs adds the "book_author" edge to the BookAuthor entity by ids.
func (*BookMutation) AddField ¶
func (m *BookMutation) AddField(name string, value ent.Value) error
AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*BookMutation) AddedEdges ¶
func (m *BookMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*BookMutation) AddedField ¶
func (m *BookMutation) AddedField(name string) (ent.Value, bool)
AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*BookMutation) AddedFields ¶
func (m *BookMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*BookMutation) AddedIDs ¶
func (m *BookMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*BookMutation) BookAuthorCleared ¶
func (m *BookMutation) BookAuthorCleared() bool
BookAuthorCleared reports if the "book_author" edge to the BookAuthor entity was cleared.
func (*BookMutation) BookAuthorIDs ¶
func (m *BookMutation) BookAuthorIDs() (ids []uuid.UUID)
BookAuthorIDs returns the "book_author" edge IDs in the mutation.
func (*BookMutation) ClearBookAuthor ¶
func (m *BookMutation) ClearBookAuthor()
ClearBookAuthor clears the "book_author" edge to the BookAuthor entity.
func (*BookMutation) ClearEdge ¶
func (m *BookMutation) ClearEdge(name string) error
ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.
func (*BookMutation) ClearField ¶
func (m *BookMutation) ClearField(name string) error
ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.
func (*BookMutation) ClearedEdges ¶
func (m *BookMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*BookMutation) ClearedFields ¶
func (m *BookMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (BookMutation) Client ¶
func (m BookMutation) Client() *Client
Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.
func (*BookMutation) Description ¶
func (m *BookMutation) Description() (r string, exists bool)
Description returns the value of the "description" field in the mutation.
func (*BookMutation) EdgeCleared ¶
func (m *BookMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*BookMutation) Field ¶
func (m *BookMutation) Field(name string) (ent.Value, bool)
Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*BookMutation) FieldCleared ¶
func (m *BookMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*BookMutation) Fields ¶
func (m *BookMutation) Fields() []string
Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().
func (*BookMutation) GoodreadsID ¶
func (m *BookMutation) GoodreadsID() (r string, exists bool)
GoodreadsID returns the value of the "goodreads_id" field in the mutation.
func (*BookMutation) GoogleVolumeID ¶
func (m *BookMutation) GoogleVolumeID() (r string, exists bool)
GoogleVolumeID returns the value of the "google_volume_id" field in the mutation.
func (*BookMutation) ID ¶
func (m *BookMutation) ID() (id uuid.UUID, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*BookMutation) IDs ¶
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*BookMutation) Isbn10 ¶
func (m *BookMutation) Isbn10() (r string, exists bool)
Isbn10 returns the value of the "isbn_10" field in the mutation.
func (*BookMutation) Isbn13 ¶
func (m *BookMutation) Isbn13() (r string, exists bool)
Isbn13 returns the value of the "isbn_13" field in the mutation.
func (*BookMutation) OldDescription ¶
func (m *BookMutation) OldDescription(ctx context.Context) (v string, err error)
OldDescription returns the old "description" field's value of the Book entity. If the Book object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*BookMutation) OldField ¶
OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.
func (*BookMutation) OldGoodreadsID ¶
func (m *BookMutation) OldGoodreadsID(ctx context.Context) (v string, err error)
OldGoodreadsID returns the old "goodreads_id" field's value of the Book entity. If the Book object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*BookMutation) OldGoogleVolumeID ¶
func (m *BookMutation) OldGoogleVolumeID(ctx context.Context) (v string, err error)
OldGoogleVolumeID returns the old "google_volume_id" field's value of the Book entity. If the Book object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*BookMutation) OldIsbn10 ¶
func (m *BookMutation) OldIsbn10(ctx context.Context) (v string, err error)
OldIsbn10 returns the old "isbn_10" field's value of the Book entity. If the Book object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*BookMutation) OldIsbn13 ¶
func (m *BookMutation) OldIsbn13(ctx context.Context) (v string, err error)
OldIsbn13 returns the old "isbn_13" field's value of the Book entity. If the Book object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*BookMutation) OldTitle ¶
func (m *BookMutation) OldTitle(ctx context.Context) (v string, err error)
OldTitle returns the old "title" field's value of the Book entity. If the Book object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*BookMutation) RemoveBookAuthorIDs ¶
func (m *BookMutation) RemoveBookAuthorIDs(ids ...uuid.UUID)
RemoveBookAuthorIDs removes the "book_author" edge to the BookAuthor entity by IDs.
func (*BookMutation) RemovedBookAuthorIDs ¶
func (m *BookMutation) RemovedBookAuthorIDs() (ids []uuid.UUID)
RemovedBookAuthor returns the removed IDs of the "book_author" edge to the BookAuthor entity.
func (*BookMutation) RemovedEdges ¶
func (m *BookMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*BookMutation) RemovedIDs ¶
func (m *BookMutation) RemovedIDs(name string) []ent.Value
RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.
func (*BookMutation) ResetBookAuthor ¶
func (m *BookMutation) ResetBookAuthor()
ResetBookAuthor resets all changes to the "book_author" edge.
func (*BookMutation) ResetDescription ¶
func (m *BookMutation) ResetDescription()
ResetDescription resets all changes to the "description" field.
func (*BookMutation) ResetEdge ¶
func (m *BookMutation) ResetEdge(name string) error
ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.
func (*BookMutation) ResetField ¶
func (m *BookMutation) ResetField(name string) error
ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.
func (*BookMutation) ResetGoodreadsID ¶
func (m *BookMutation) ResetGoodreadsID()
ResetGoodreadsID resets all changes to the "goodreads_id" field.
func (*BookMutation) ResetGoogleVolumeID ¶
func (m *BookMutation) ResetGoogleVolumeID()
ResetGoogleVolumeID resets all changes to the "google_volume_id" field.
func (*BookMutation) ResetIsbn10 ¶
func (m *BookMutation) ResetIsbn10()
ResetIsbn10 resets all changes to the "isbn_10" field.
func (*BookMutation) ResetIsbn13 ¶
func (m *BookMutation) ResetIsbn13()
ResetIsbn13 resets all changes to the "isbn_13" field.
func (*BookMutation) ResetTitle ¶
func (m *BookMutation) ResetTitle()
ResetTitle resets all changes to the "title" field.
func (*BookMutation) SetDescription ¶
func (m *BookMutation) SetDescription(s string)
SetDescription sets the "description" field.
func (*BookMutation) SetField ¶
func (m *BookMutation) SetField(name string, value ent.Value) error
SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*BookMutation) SetGoodreadsID ¶
func (m *BookMutation) SetGoodreadsID(s string)
SetGoodreadsID sets the "goodreads_id" field.
func (*BookMutation) SetGoogleVolumeID ¶
func (m *BookMutation) SetGoogleVolumeID(s string)
SetGoogleVolumeID sets the "google_volume_id" field.
func (*BookMutation) SetID ¶
func (m *BookMutation) SetID(id uuid.UUID)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Book entities.
func (*BookMutation) SetIsbn10 ¶
func (m *BookMutation) SetIsbn10(s string)
SetIsbn10 sets the "isbn_10" field.
func (*BookMutation) SetIsbn13 ¶
func (m *BookMutation) SetIsbn13(s string)
SetIsbn13 sets the "isbn_13" field.
func (*BookMutation) SetOp ¶
func (m *BookMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*BookMutation) SetTitle ¶
func (m *BookMutation) SetTitle(s string)
SetTitle sets the "title" field.
func (*BookMutation) Title ¶
func (m *BookMutation) Title() (r string, exists bool)
Title returns the value of the "title" field in the mutation.
func (BookMutation) Tx ¶
func (m BookMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*BookMutation) Type ¶
func (m *BookMutation) Type() string
Type returns the node type of this mutation (Book).
func (*BookMutation) Where ¶
func (m *BookMutation) Where(ps ...predicate.Book)
Where appends a list predicates to the BookMutation builder.
func (*BookMutation) WhereP ¶
func (m *BookMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the BookMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type BookQuery ¶
type BookQuery struct {
// contains filtered or unexported fields
}
BookQuery is the builder for querying Book entities.
func (*BookQuery) Aggregate ¶
func (bq *BookQuery) Aggregate(fns ...AggregateFunc) *BookSelect
Aggregate returns a BookSelect configured with the given aggregations.
func (*BookQuery) Clone ¶
Clone returns a duplicate of the BookQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*BookQuery) First ¶
First returns the first Book entity from the query. Returns a *NotFoundError when no Book was found.
func (*BookQuery) FirstID ¶
FirstID returns the first Book ID from the query. Returns a *NotFoundError when no Book ID was found.
func (*BookQuery) ForShare ¶
func (bq *BookQuery) ForShare(opts ...sql.LockOption) *BookQuery
ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.
func (*BookQuery) ForUpdate ¶
func (bq *BookQuery) ForUpdate(opts ...sql.LockOption) *BookQuery
ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.
func (*BookQuery) GroupBy ¶
func (bq *BookQuery) GroupBy(field string, fields ...string) *BookGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { Title string `json:"title,omitempty"` Count int `json:"count,omitempty"` } client.Book.Query(). GroupBy(book.FieldTitle). Aggregate(ent.Count()). Scan(ctx, &v)
func (*BookQuery) Only ¶
Only returns a single Book entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Book entity is found. Returns a *NotFoundError when no Book entities are found.
func (*BookQuery) OnlyID ¶
OnlyID is like Only, but returns the only Book ID in the query. Returns a *NotSingularError when more than one Book ID is found. Returns a *NotFoundError when no entities are found.
func (*BookQuery) Order ¶
func (bq *BookQuery) Order(o ...book.OrderOption) *BookQuery
Order specifies how the records should be ordered.
func (*BookQuery) QueryBookAuthor ¶
func (bq *BookQuery) QueryBookAuthor() *BookAuthorQuery
QueryBookAuthor chains the current query on the "book_author" edge.
func (*BookQuery) Select ¶
func (bq *BookQuery) Select(fields ...string) *BookSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { Title string `json:"title,omitempty"` } client.Book.Query(). Select(book.FieldTitle). Scan(ctx, &v)
func (*BookQuery) Unique ¶
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
func (*BookQuery) WithBookAuthor ¶
func (bq *BookQuery) WithBookAuthor(opts ...func(*BookAuthorQuery)) *BookQuery
WithBookAuthor tells the query-builder to eager-load the nodes that are connected to the "book_author" edge. The optional arguments are used to configure the query builder of the edge.
func (*BookQuery) WithNamedBookAuthor ¶
func (bq *BookQuery) WithNamedBookAuthor(name string, opts ...func(*BookAuthorQuery)) *BookQuery
WithNamedBookAuthor tells the query-builder to eager-load the nodes that are connected to the "book_author" edge with the given name. The optional arguments are used to configure the query builder of the edge.
type BookSelect ¶
type BookSelect struct { *BookQuery // contains filtered or unexported fields }
BookSelect is the builder for selecting fields of Book entities.
func (*BookSelect) Aggregate ¶
func (bs *BookSelect) Aggregate(fns ...AggregateFunc) *BookSelect
Aggregate adds the given aggregation functions to the selector query.
func (*BookSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*BookSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*BookSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*BookSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*BookSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*BookSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*BookSelect) Scan ¶
func (bs *BookSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*BookSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type BookUpdate ¶
type BookUpdate struct {
// contains filtered or unexported fields
}
BookUpdate is the builder for updating Book entities.
func (*BookUpdate) AddBookAuthor ¶
func (bu *BookUpdate) AddBookAuthor(b ...*BookAuthor) *BookUpdate
AddBookAuthor adds the "book_author" edges to the BookAuthor entity.
func (*BookUpdate) AddBookAuthorIDs ¶
func (bu *BookUpdate) AddBookAuthorIDs(ids ...uuid.UUID) *BookUpdate
AddBookAuthorIDs adds the "book_author" edge to the BookAuthor entity by IDs.
func (*BookUpdate) ClearBookAuthor ¶
func (bu *BookUpdate) ClearBookAuthor() *BookUpdate
ClearBookAuthor clears all "book_author" edges to the BookAuthor entity.
func (*BookUpdate) Exec ¶
func (bu *BookUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*BookUpdate) ExecX ¶
func (bu *BookUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BookUpdate) Mutation ¶
func (bu *BookUpdate) Mutation() *BookMutation
Mutation returns the BookMutation object of the builder.
func (*BookUpdate) RemoveBookAuthor ¶
func (bu *BookUpdate) RemoveBookAuthor(b ...*BookAuthor) *BookUpdate
RemoveBookAuthor removes "book_author" edges to BookAuthor entities.
func (*BookUpdate) RemoveBookAuthorIDs ¶
func (bu *BookUpdate) RemoveBookAuthorIDs(ids ...uuid.UUID) *BookUpdate
RemoveBookAuthorIDs removes the "book_author" edge to BookAuthor entities by IDs.
func (*BookUpdate) Save ¶
func (bu *BookUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*BookUpdate) SaveX ¶
func (bu *BookUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*BookUpdate) SetDescription ¶
func (bu *BookUpdate) SetDescription(s string) *BookUpdate
SetDescription sets the "description" field.
func (*BookUpdate) SetGoodreadsID ¶
func (bu *BookUpdate) SetGoodreadsID(s string) *BookUpdate
SetGoodreadsID sets the "goodreads_id" field.
func (*BookUpdate) SetGoogleVolumeID ¶
func (bu *BookUpdate) SetGoogleVolumeID(s string) *BookUpdate
SetGoogleVolumeID sets the "google_volume_id" field.
func (*BookUpdate) SetIsbn10 ¶
func (bu *BookUpdate) SetIsbn10(s string) *BookUpdate
SetIsbn10 sets the "isbn_10" field.
func (*BookUpdate) SetIsbn13 ¶
func (bu *BookUpdate) SetIsbn13(s string) *BookUpdate
SetIsbn13 sets the "isbn_13" field.
func (*BookUpdate) SetTitle ¶
func (bu *BookUpdate) SetTitle(s string) *BookUpdate
SetTitle sets the "title" field.
func (*BookUpdate) Where ¶
func (bu *BookUpdate) Where(ps ...predicate.Book) *BookUpdate
Where appends a list predicates to the BookUpdate builder.
type BookUpdateOne ¶
type BookUpdateOne struct {
// contains filtered or unexported fields
}
BookUpdateOne is the builder for updating a single Book entity.
func (*BookUpdateOne) AddBookAuthor ¶
func (buo *BookUpdateOne) AddBookAuthor(b ...*BookAuthor) *BookUpdateOne
AddBookAuthor adds the "book_author" edges to the BookAuthor entity.
func (*BookUpdateOne) AddBookAuthorIDs ¶
func (buo *BookUpdateOne) AddBookAuthorIDs(ids ...uuid.UUID) *BookUpdateOne
AddBookAuthorIDs adds the "book_author" edge to the BookAuthor entity by IDs.
func (*BookUpdateOne) ClearBookAuthor ¶
func (buo *BookUpdateOne) ClearBookAuthor() *BookUpdateOne
ClearBookAuthor clears all "book_author" edges to the BookAuthor entity.
func (*BookUpdateOne) Exec ¶
func (buo *BookUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*BookUpdateOne) ExecX ¶
func (buo *BookUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BookUpdateOne) Mutation ¶
func (buo *BookUpdateOne) Mutation() *BookMutation
Mutation returns the BookMutation object of the builder.
func (*BookUpdateOne) RemoveBookAuthor ¶
func (buo *BookUpdateOne) RemoveBookAuthor(b ...*BookAuthor) *BookUpdateOne
RemoveBookAuthor removes "book_author" edges to BookAuthor entities.
func (*BookUpdateOne) RemoveBookAuthorIDs ¶
func (buo *BookUpdateOne) RemoveBookAuthorIDs(ids ...uuid.UUID) *BookUpdateOne
RemoveBookAuthorIDs removes the "book_author" edge to BookAuthor entities by IDs.
func (*BookUpdateOne) Save ¶
func (buo *BookUpdateOne) Save(ctx context.Context) (*Book, error)
Save executes the query and returns the updated Book entity.
func (*BookUpdateOne) SaveX ¶
func (buo *BookUpdateOne) SaveX(ctx context.Context) *Book
SaveX is like Save, but panics if an error occurs.
func (*BookUpdateOne) Select ¶
func (buo *BookUpdateOne) Select(field string, fields ...string) *BookUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*BookUpdateOne) SetDescription ¶
func (buo *BookUpdateOne) SetDescription(s string) *BookUpdateOne
SetDescription sets the "description" field.
func (*BookUpdateOne) SetGoodreadsID ¶
func (buo *BookUpdateOne) SetGoodreadsID(s string) *BookUpdateOne
SetGoodreadsID sets the "goodreads_id" field.
func (*BookUpdateOne) SetGoogleVolumeID ¶
func (buo *BookUpdateOne) SetGoogleVolumeID(s string) *BookUpdateOne
SetGoogleVolumeID sets the "google_volume_id" field.
func (*BookUpdateOne) SetIsbn10 ¶
func (buo *BookUpdateOne) SetIsbn10(s string) *BookUpdateOne
SetIsbn10 sets the "isbn_10" field.
func (*BookUpdateOne) SetIsbn13 ¶
func (buo *BookUpdateOne) SetIsbn13(s string) *BookUpdateOne
SetIsbn13 sets the "isbn_13" field.
func (*BookUpdateOne) SetTitle ¶
func (buo *BookUpdateOne) SetTitle(s string) *BookUpdateOne
SetTitle sets the "title" field.
func (*BookUpdateOne) Where ¶
func (buo *BookUpdateOne) Where(ps ...predicate.Book) *BookUpdateOne
Where appends a list predicates to the BookUpdate builder.
type BookUpsert ¶
BookUpsert is the "OnConflict" setter.
func (*BookUpsert) SetDescription ¶
func (u *BookUpsert) SetDescription(v string) *BookUpsert
SetDescription sets the "description" field.
func (*BookUpsert) SetGoodreadsID ¶
func (u *BookUpsert) SetGoodreadsID(v string) *BookUpsert
SetGoodreadsID sets the "goodreads_id" field.
func (*BookUpsert) SetGoogleVolumeID ¶
func (u *BookUpsert) SetGoogleVolumeID(v string) *BookUpsert
SetGoogleVolumeID sets the "google_volume_id" field.
func (*BookUpsert) SetIsbn10 ¶
func (u *BookUpsert) SetIsbn10(v string) *BookUpsert
SetIsbn10 sets the "isbn_10" field.
func (*BookUpsert) SetIsbn13 ¶
func (u *BookUpsert) SetIsbn13(v string) *BookUpsert
SetIsbn13 sets the "isbn_13" field.
func (*BookUpsert) SetTitle ¶
func (u *BookUpsert) SetTitle(v string) *BookUpsert
SetTitle sets the "title" field.
func (*BookUpsert) UpdateDescription ¶
func (u *BookUpsert) UpdateDescription() *BookUpsert
UpdateDescription sets the "description" field to the value that was provided on create.
func (*BookUpsert) UpdateGoodreadsID ¶
func (u *BookUpsert) UpdateGoodreadsID() *BookUpsert
UpdateGoodreadsID sets the "goodreads_id" field to the value that was provided on create.
func (*BookUpsert) UpdateGoogleVolumeID ¶
func (u *BookUpsert) UpdateGoogleVolumeID() *BookUpsert
UpdateGoogleVolumeID sets the "google_volume_id" field to the value that was provided on create.
func (*BookUpsert) UpdateIsbn10 ¶
func (u *BookUpsert) UpdateIsbn10() *BookUpsert
UpdateIsbn10 sets the "isbn_10" field to the value that was provided on create.
func (*BookUpsert) UpdateIsbn13 ¶
func (u *BookUpsert) UpdateIsbn13() *BookUpsert
UpdateIsbn13 sets the "isbn_13" field to the value that was provided on create.
func (*BookUpsert) UpdateTitle ¶
func (u *BookUpsert) UpdateTitle() *BookUpsert
UpdateTitle sets the "title" field to the value that was provided on create.
type BookUpsertBulk ¶
type BookUpsertBulk struct {
// contains filtered or unexported fields
}
BookUpsertBulk is the builder for "upsert"-ing a bulk of Book nodes.
func (*BookUpsertBulk) DoNothing ¶
func (u *BookUpsertBulk) DoNothing() *BookUpsertBulk
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*BookUpsertBulk) Exec ¶
func (u *BookUpsertBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*BookUpsertBulk) ExecX ¶
func (u *BookUpsertBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BookUpsertBulk) Ignore ¶
func (u *BookUpsertBulk) Ignore() *BookUpsertBulk
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.Book.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*BookUpsertBulk) SetDescription ¶
func (u *BookUpsertBulk) SetDescription(v string) *BookUpsertBulk
SetDescription sets the "description" field.
func (*BookUpsertBulk) SetGoodreadsID ¶
func (u *BookUpsertBulk) SetGoodreadsID(v string) *BookUpsertBulk
SetGoodreadsID sets the "goodreads_id" field.
func (*BookUpsertBulk) SetGoogleVolumeID ¶
func (u *BookUpsertBulk) SetGoogleVolumeID(v string) *BookUpsertBulk
SetGoogleVolumeID sets the "google_volume_id" field.
func (*BookUpsertBulk) SetIsbn10 ¶
func (u *BookUpsertBulk) SetIsbn10(v string) *BookUpsertBulk
SetIsbn10 sets the "isbn_10" field.
func (*BookUpsertBulk) SetIsbn13 ¶
func (u *BookUpsertBulk) SetIsbn13(v string) *BookUpsertBulk
SetIsbn13 sets the "isbn_13" field.
func (*BookUpsertBulk) SetTitle ¶
func (u *BookUpsertBulk) SetTitle(v string) *BookUpsertBulk
SetTitle sets the "title" field.
func (*BookUpsertBulk) Update ¶
func (u *BookUpsertBulk) Update(set func(*BookUpsert)) *BookUpsertBulk
Update allows overriding fields `UPDATE` values. See the BookCreateBulk.OnConflict documentation for more info.
func (*BookUpsertBulk) UpdateDescription ¶
func (u *BookUpsertBulk) UpdateDescription() *BookUpsertBulk
UpdateDescription sets the "description" field to the value that was provided on create.
func (*BookUpsertBulk) UpdateGoodreadsID ¶
func (u *BookUpsertBulk) UpdateGoodreadsID() *BookUpsertBulk
UpdateGoodreadsID sets the "goodreads_id" field to the value that was provided on create.
func (*BookUpsertBulk) UpdateGoogleVolumeID ¶
func (u *BookUpsertBulk) UpdateGoogleVolumeID() *BookUpsertBulk
UpdateGoogleVolumeID sets the "google_volume_id" field to the value that was provided on create.
func (*BookUpsertBulk) UpdateIsbn10 ¶
func (u *BookUpsertBulk) UpdateIsbn10() *BookUpsertBulk
UpdateIsbn10 sets the "isbn_10" field to the value that was provided on create.
func (*BookUpsertBulk) UpdateIsbn13 ¶
func (u *BookUpsertBulk) UpdateIsbn13() *BookUpsertBulk
UpdateIsbn13 sets the "isbn_13" field to the value that was provided on create.
func (*BookUpsertBulk) UpdateNewValues ¶
func (u *BookUpsertBulk) UpdateNewValues() *BookUpsertBulk
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.Book.Create(). OnConflict( sql.ResolveWithNewValues(), sql.ResolveWith(func(u *sql.UpdateSet) { u.SetIgnore(book.FieldID) }), ). Exec(ctx)
func (*BookUpsertBulk) UpdateTitle ¶
func (u *BookUpsertBulk) UpdateTitle() *BookUpsertBulk
UpdateTitle sets the "title" field to the value that was provided on create.
type BookUpsertOne ¶
type BookUpsertOne struct {
// contains filtered or unexported fields
}
BookUpsertOne is the builder for "upsert"-ing
one Book node.
func (*BookUpsertOne) DoNothing ¶
func (u *BookUpsertOne) DoNothing() *BookUpsertOne
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*BookUpsertOne) Exec ¶
func (u *BookUpsertOne) Exec(ctx context.Context) error
Exec executes the query.
func (*BookUpsertOne) ExecX ¶
func (u *BookUpsertOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BookUpsertOne) IDX ¶
func (u *BookUpsertOne) IDX(ctx context.Context) uuid.UUID
IDX is like ID, but panics if an error occurs.
func (*BookUpsertOne) Ignore ¶
func (u *BookUpsertOne) Ignore() *BookUpsertOne
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.Book.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*BookUpsertOne) SetDescription ¶
func (u *BookUpsertOne) SetDescription(v string) *BookUpsertOne
SetDescription sets the "description" field.
func (*BookUpsertOne) SetGoodreadsID ¶
func (u *BookUpsertOne) SetGoodreadsID(v string) *BookUpsertOne
SetGoodreadsID sets the "goodreads_id" field.
func (*BookUpsertOne) SetGoogleVolumeID ¶
func (u *BookUpsertOne) SetGoogleVolumeID(v string) *BookUpsertOne
SetGoogleVolumeID sets the "google_volume_id" field.
func (*BookUpsertOne) SetIsbn10 ¶
func (u *BookUpsertOne) SetIsbn10(v string) *BookUpsertOne
SetIsbn10 sets the "isbn_10" field.
func (*BookUpsertOne) SetIsbn13 ¶
func (u *BookUpsertOne) SetIsbn13(v string) *BookUpsertOne
SetIsbn13 sets the "isbn_13" field.
func (*BookUpsertOne) SetTitle ¶
func (u *BookUpsertOne) SetTitle(v string) *BookUpsertOne
SetTitle sets the "title" field.
func (*BookUpsertOne) Update ¶
func (u *BookUpsertOne) Update(set func(*BookUpsert)) *BookUpsertOne
Update allows overriding fields `UPDATE` values. See the BookCreate.OnConflict documentation for more info.
func (*BookUpsertOne) UpdateDescription ¶
func (u *BookUpsertOne) UpdateDescription() *BookUpsertOne
UpdateDescription sets the "description" field to the value that was provided on create.
func (*BookUpsertOne) UpdateGoodreadsID ¶
func (u *BookUpsertOne) UpdateGoodreadsID() *BookUpsertOne
UpdateGoodreadsID sets the "goodreads_id" field to the value that was provided on create.
func (*BookUpsertOne) UpdateGoogleVolumeID ¶
func (u *BookUpsertOne) UpdateGoogleVolumeID() *BookUpsertOne
UpdateGoogleVolumeID sets the "google_volume_id" field to the value that was provided on create.
func (*BookUpsertOne) UpdateIsbn10 ¶
func (u *BookUpsertOne) UpdateIsbn10() *BookUpsertOne
UpdateIsbn10 sets the "isbn_10" field to the value that was provided on create.
func (*BookUpsertOne) UpdateIsbn13 ¶
func (u *BookUpsertOne) UpdateIsbn13() *BookUpsertOne
UpdateIsbn13 sets the "isbn_13" field to the value that was provided on create.
func (*BookUpsertOne) UpdateNewValues ¶
func (u *BookUpsertOne) UpdateNewValues() *BookUpsertOne
UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:
client.Book.Create(). OnConflict( sql.ResolveWithNewValues(), sql.ResolveWith(func(u *sql.UpdateSet) { u.SetIgnore(book.FieldID) }), ). Exec(ctx)
func (*BookUpsertOne) UpdateTitle ¶
func (u *BookUpsertOne) UpdateTitle() *BookUpsertOne
UpdateTitle sets the "title" field to the value that was provided on create.
type Client ¶
type Client struct { // Schema is the client for creating, migrating and dropping schema. Schema *migrate.Schema // Book is the client for interacting with the Book builders. Book *BookClient // BookAuthor is the client for interacting with the BookAuthor builders. BookAuthor *BookAuthorClient // DiscordMessage is the client for interacting with the DiscordMessage builders. DiscordMessage *DiscordMessageClient // DiscordUser is the client for interacting with the DiscordUser builders. DiscordUser *DiscordUserClient // contains filtered or unexported fields }
Client is the client that holds all ent builders.
func FromContext ¶
FromContext returns a Client stored inside a context, or nil if there isn't one.
func Open ¶
Open opens a database/sql.DB specified by the driver name and the data source name, and returns a new client attached to it. Optional parameters can be added for configuring the client.
func (*Client) Debug ¶
Debug returns a new debug-client. It's used to get verbose logging on specific operations.
client.Debug(). Book. Query(). Count(ctx)
func (*Client) Intercept ¶
func (c *Client) Intercept(interceptors ...Interceptor)
Intercept adds the query interceptors to all the entity clients. In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`.
type CommitFunc ¶
The CommitFunc type is an adapter to allow the use of ordinary function as a Committer. If f is a function with the appropriate signature, CommitFunc(f) is a Committer that calls f.
type CommitHook ¶
CommitHook defines the "commit middleware". A function that gets a Committer and returns a Committer. For example:
hook := func(next ent.Committer) ent.Committer { return ent.CommitFunc(func(ctx context.Context, tx *ent.Tx) error { // Do some stuff before. if err := next.Commit(ctx, tx); err != nil { return err } // Do some stuff after. return nil }) }
type ConstraintError ¶
type ConstraintError struct {
// contains filtered or unexported fields
}
ConstraintError returns when trying to create/update one or more entities and one or more of their constraints failed. For example, violation of edge or field uniqueness.
func (ConstraintError) Error ¶
func (e ConstraintError) Error() string
Error implements the error interface.
func (*ConstraintError) Unwrap ¶
func (e *ConstraintError) Unwrap() error
Unwrap implements the errors.Wrapper interface.
type DiscordMessage ¶
type DiscordMessage struct { // ID of the ent. ID string `json:"id,omitempty"` // CreateTime holds the value of the "create_time" field. CreateTime time.Time `json:"create_time,omitempty"` // UpdateTime holds the value of the "update_time" field. UpdateTime time.Time `json:"update_time,omitempty"` // Raw holds the value of the "raw" field. Raw discordgo.Message `json:"raw,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the DiscordMessageQuery when eager-loading is set. Edges DiscordMessageEdges `json:"edges"` // contains filtered or unexported fields }
DiscordMessage is the model entity for the DiscordMessage schema.
func (*DiscordMessage) NamedAuthor ¶
func (dm *DiscordMessage) NamedAuthor(name string) ([]*DiscordUser, error)
NamedAuthor returns the Author named value or an error if the edge was not loaded in eager-loading with this name.
func (*DiscordMessage) QueryAuthor ¶
func (dm *DiscordMessage) QueryAuthor() *DiscordUserQuery
QueryAuthor queries the "author" edge of the DiscordMessage entity.
func (*DiscordMessage) String ¶
func (dm *DiscordMessage) String() string
String implements the fmt.Stringer.
func (*DiscordMessage) Unwrap ¶
func (dm *DiscordMessage) Unwrap() *DiscordMessage
Unwrap unwraps the DiscordMessage entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.
func (*DiscordMessage) Update ¶
func (dm *DiscordMessage) Update() *DiscordMessageUpdateOne
Update returns a builder for updating this DiscordMessage. Note that you need to call DiscordMessage.Unwrap() before calling this method if this DiscordMessage was returned from a transaction, and the transaction was committed or rolled back.
type DiscordMessageClient ¶
type DiscordMessageClient struct {
// contains filtered or unexported fields
}
DiscordMessageClient is a client for the DiscordMessage schema.
func NewDiscordMessageClient ¶
func NewDiscordMessageClient(c config) *DiscordMessageClient
NewDiscordMessageClient returns a client for the DiscordMessage from the given config.
func (*DiscordMessageClient) Create ¶
func (c *DiscordMessageClient) Create() *DiscordMessageCreate
Create returns a builder for creating a DiscordMessage entity.
func (*DiscordMessageClient) CreateBulk ¶
func (c *DiscordMessageClient) CreateBulk(builders ...*DiscordMessageCreate) *DiscordMessageCreateBulk
CreateBulk returns a builder for creating a bulk of DiscordMessage entities.
func (*DiscordMessageClient) Delete ¶
func (c *DiscordMessageClient) Delete() *DiscordMessageDelete
Delete returns a delete builder for DiscordMessage.
func (*DiscordMessageClient) DeleteOne ¶
func (c *DiscordMessageClient) DeleteOne(dm *DiscordMessage) *DiscordMessageDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*DiscordMessageClient) DeleteOneID ¶
func (c *DiscordMessageClient) DeleteOneID(id string) *DiscordMessageDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*DiscordMessageClient) Get ¶
func (c *DiscordMessageClient) Get(ctx context.Context, id string) (*DiscordMessage, error)
Get returns a DiscordMessage entity by its id.
func (*DiscordMessageClient) GetX ¶
func (c *DiscordMessageClient) GetX(ctx context.Context, id string) *DiscordMessage
GetX is like Get, but panics if an error occurs.
func (*DiscordMessageClient) Hooks ¶
func (c *DiscordMessageClient) Hooks() []Hook
Hooks returns the client hooks.
func (*DiscordMessageClient) Intercept ¶
func (c *DiscordMessageClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `discordmessage.Intercept(f(g(h())))`.
func (*DiscordMessageClient) Interceptors ¶
func (c *DiscordMessageClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*DiscordMessageClient) Query ¶
func (c *DiscordMessageClient) Query() *DiscordMessageQuery
Query returns a query builder for DiscordMessage.
func (*DiscordMessageClient) QueryAuthor ¶
func (c *DiscordMessageClient) QueryAuthor(dm *DiscordMessage) *DiscordUserQuery
QueryAuthor queries the author edge of a DiscordMessage.
func (*DiscordMessageClient) Update ¶
func (c *DiscordMessageClient) Update() *DiscordMessageUpdate
Update returns an update builder for DiscordMessage.
func (*DiscordMessageClient) UpdateOne ¶
func (c *DiscordMessageClient) UpdateOne(dm *DiscordMessage) *DiscordMessageUpdateOne
UpdateOne returns an update builder for the given entity.
func (*DiscordMessageClient) UpdateOneID ¶
func (c *DiscordMessageClient) UpdateOneID(id string) *DiscordMessageUpdateOne
UpdateOneID returns an update builder for the given id.
func (*DiscordMessageClient) Use ¶
func (c *DiscordMessageClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `discordmessage.Hooks(f(g(h())))`.
type DiscordMessageCreate ¶
type DiscordMessageCreate struct {
// contains filtered or unexported fields
}
DiscordMessageCreate is the builder for creating a DiscordMessage entity.
func (*DiscordMessageCreate) AddAuthor ¶
func (dmc *DiscordMessageCreate) AddAuthor(d ...*DiscordUser) *DiscordMessageCreate
AddAuthor adds the "author" edges to the DiscordUser entity.
func (*DiscordMessageCreate) AddAuthorIDs ¶
func (dmc *DiscordMessageCreate) AddAuthorIDs(ids ...uuid.UUID) *DiscordMessageCreate
AddAuthorIDs adds the "author" edge to the DiscordUser entity by IDs.
func (*DiscordMessageCreate) Exec ¶
func (dmc *DiscordMessageCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*DiscordMessageCreate) ExecX ¶
func (dmc *DiscordMessageCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*DiscordMessageCreate) Mutation ¶
func (dmc *DiscordMessageCreate) Mutation() *DiscordMessageMutation
Mutation returns the DiscordMessageMutation object of the builder.
func (*DiscordMessageCreate) OnConflict ¶
func (dmc *DiscordMessageCreate) OnConflict(opts ...sql.ConflictOption) *DiscordMessageUpsertOne
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.DiscordMessage.Create(). SetCreateTime(v). OnConflict( // Update the row with the new values // the was proposed for insertion. sql.ResolveWithNewValues(), ). // Override some of the fields with custom // update values. Update(func(u *ent.DiscordMessageUpsert) { SetCreateTime(v+v). }). Exec(ctx)
func (*DiscordMessageCreate) OnConflictColumns ¶
func (dmc *DiscordMessageCreate) OnConflictColumns(columns ...string) *DiscordMessageUpsertOne
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.DiscordMessage.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*DiscordMessageCreate) Save ¶
func (dmc *DiscordMessageCreate) Save(ctx context.Context) (*DiscordMessage, error)
Save creates the DiscordMessage in the database.
func (*DiscordMessageCreate) SaveX ¶
func (dmc *DiscordMessageCreate) SaveX(ctx context.Context) *DiscordMessage
SaveX calls Save and panics if Save returns an error.
func (*DiscordMessageCreate) SetCreateTime ¶
func (dmc *DiscordMessageCreate) SetCreateTime(t time.Time) *DiscordMessageCreate
SetCreateTime sets the "create_time" field.
func (*DiscordMessageCreate) SetID ¶
func (dmc *DiscordMessageCreate) SetID(s string) *DiscordMessageCreate
SetID sets the "id" field.
func (*DiscordMessageCreate) SetNillableCreateTime ¶
func (dmc *DiscordMessageCreate) SetNillableCreateTime(t *time.Time) *DiscordMessageCreate
SetNillableCreateTime sets the "create_time" field if the given value is not nil.
func (*DiscordMessageCreate) SetNillableUpdateTime ¶
func (dmc *DiscordMessageCreate) SetNillableUpdateTime(t *time.Time) *DiscordMessageCreate
SetNillableUpdateTime sets the "update_time" field if the given value is not nil.
func (*DiscordMessageCreate) SetRaw ¶
func (dmc *DiscordMessageCreate) SetRaw(d discordgo.Message) *DiscordMessageCreate
SetRaw sets the "raw" field.
func (*DiscordMessageCreate) SetUpdateTime ¶
func (dmc *DiscordMessageCreate) SetUpdateTime(t time.Time) *DiscordMessageCreate
SetUpdateTime sets the "update_time" field.
type DiscordMessageCreateBulk ¶
type DiscordMessageCreateBulk struct {
// contains filtered or unexported fields
}
DiscordMessageCreateBulk is the builder for creating many DiscordMessage entities in bulk.
func (*DiscordMessageCreateBulk) Exec ¶
func (dmcb *DiscordMessageCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*DiscordMessageCreateBulk) ExecX ¶
func (dmcb *DiscordMessageCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*DiscordMessageCreateBulk) OnConflict ¶
func (dmcb *DiscordMessageCreateBulk) OnConflict(opts ...sql.ConflictOption) *DiscordMessageUpsertBulk
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.DiscordMessage.CreateBulk(builders...). OnConflict( // Update the row with the new values // the was proposed for insertion. sql.ResolveWithNewValues(), ). // Override some of the fields with custom // update values. Update(func(u *ent.DiscordMessageUpsert) { SetCreateTime(v+v). }). Exec(ctx)
func (*DiscordMessageCreateBulk) OnConflictColumns ¶
func (dmcb *DiscordMessageCreateBulk) OnConflictColumns(columns ...string) *DiscordMessageUpsertBulk
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.DiscordMessage.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*DiscordMessageCreateBulk) Save ¶
func (dmcb *DiscordMessageCreateBulk) Save(ctx context.Context) ([]*DiscordMessage, error)
Save creates the DiscordMessage entities in the database.
func (*DiscordMessageCreateBulk) SaveX ¶
func (dmcb *DiscordMessageCreateBulk) SaveX(ctx context.Context) []*DiscordMessage
SaveX is like Save, but panics if an error occurs.
type DiscordMessageDelete ¶
type DiscordMessageDelete struct {
// contains filtered or unexported fields
}
DiscordMessageDelete is the builder for deleting a DiscordMessage entity.
func (*DiscordMessageDelete) Exec ¶
func (dmd *DiscordMessageDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*DiscordMessageDelete) ExecX ¶
func (dmd *DiscordMessageDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*DiscordMessageDelete) Where ¶
func (dmd *DiscordMessageDelete) Where(ps ...predicate.DiscordMessage) *DiscordMessageDelete
Where appends a list predicates to the DiscordMessageDelete builder.
type DiscordMessageDeleteOne ¶
type DiscordMessageDeleteOne struct {
// contains filtered or unexported fields
}
DiscordMessageDeleteOne is the builder for deleting a single DiscordMessage entity.
func (*DiscordMessageDeleteOne) Exec ¶
func (dmdo *DiscordMessageDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*DiscordMessageDeleteOne) ExecX ¶
func (dmdo *DiscordMessageDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*DiscordMessageDeleteOne) Where ¶
func (dmdo *DiscordMessageDeleteOne) Where(ps ...predicate.DiscordMessage) *DiscordMessageDeleteOne
Where appends a list predicates to the DiscordMessageDelete builder.
type DiscordMessageEdges ¶
type DiscordMessageEdges struct { // Author holds the value of the author edge. Author []*DiscordUser `json:"author,omitempty"` // contains filtered or unexported fields }
DiscordMessageEdges holds the relations/edges for other nodes in the graph.
func (DiscordMessageEdges) AuthorOrErr ¶
func (e DiscordMessageEdges) AuthorOrErr() ([]*DiscordUser, error)
AuthorOrErr returns the Author value or an error if the edge was not loaded in eager-loading.
type DiscordMessageGroupBy ¶
type DiscordMessageGroupBy struct {
// contains filtered or unexported fields
}
DiscordMessageGroupBy is the group-by builder for DiscordMessage entities.
func (*DiscordMessageGroupBy) Aggregate ¶
func (dmgb *DiscordMessageGroupBy) Aggregate(fns ...AggregateFunc) *DiscordMessageGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*DiscordMessageGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*DiscordMessageGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*DiscordMessageGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*DiscordMessageGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*DiscordMessageGroupBy) Float64sX ¶
Float64sX is like Float64s, but panics if an error occurs.
func (*DiscordMessageGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*DiscordMessageGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*DiscordMessageGroupBy) Scan ¶
func (dmgb *DiscordMessageGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*DiscordMessageGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type DiscordMessageMutation ¶
type DiscordMessageMutation struct {
// contains filtered or unexported fields
}
DiscordMessageMutation represents an operation that mutates the DiscordMessage nodes in the graph.
func (*DiscordMessageMutation) AddAuthorIDs ¶
func (m *DiscordMessageMutation) AddAuthorIDs(ids ...uuid.UUID)
AddAuthorIDs adds the "author" edge to the DiscordUser entity by ids.
func (*DiscordMessageMutation) AddField ¶
func (m *DiscordMessageMutation) AddField(name string, value ent.Value) error
AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*DiscordMessageMutation) AddedEdges ¶
func (m *DiscordMessageMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*DiscordMessageMutation) AddedField ¶
func (m *DiscordMessageMutation) AddedField(name string) (ent.Value, bool)
AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*DiscordMessageMutation) AddedFields ¶
func (m *DiscordMessageMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*DiscordMessageMutation) AddedIDs ¶
func (m *DiscordMessageMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*DiscordMessageMutation) AuthorCleared ¶
func (m *DiscordMessageMutation) AuthorCleared() bool
AuthorCleared reports if the "author" edge to the DiscordUser entity was cleared.
func (*DiscordMessageMutation) AuthorIDs ¶
func (m *DiscordMessageMutation) AuthorIDs() (ids []uuid.UUID)
AuthorIDs returns the "author" edge IDs in the mutation.
func (*DiscordMessageMutation) ClearAuthor ¶
func (m *DiscordMessageMutation) ClearAuthor()
ClearAuthor clears the "author" edge to the DiscordUser entity.
func (*DiscordMessageMutation) ClearEdge ¶
func (m *DiscordMessageMutation) ClearEdge(name string) error
ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.
func (*DiscordMessageMutation) ClearField ¶
func (m *DiscordMessageMutation) ClearField(name string) error
ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.
func (*DiscordMessageMutation) ClearedEdges ¶
func (m *DiscordMessageMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*DiscordMessageMutation) ClearedFields ¶
func (m *DiscordMessageMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (DiscordMessageMutation) Client ¶
func (m DiscordMessageMutation) Client() *Client
Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.
func (*DiscordMessageMutation) CreateTime ¶
func (m *DiscordMessageMutation) CreateTime() (r time.Time, exists bool)
CreateTime returns the value of the "create_time" field in the mutation.
func (*DiscordMessageMutation) EdgeCleared ¶
func (m *DiscordMessageMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*DiscordMessageMutation) Field ¶
func (m *DiscordMessageMutation) Field(name string) (ent.Value, bool)
Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*DiscordMessageMutation) FieldCleared ¶
func (m *DiscordMessageMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*DiscordMessageMutation) Fields ¶
func (m *DiscordMessageMutation) Fields() []string
Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().
func (*DiscordMessageMutation) ID ¶
func (m *DiscordMessageMutation) ID() (id string, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*DiscordMessageMutation) IDs ¶
func (m *DiscordMessageMutation) IDs(ctx context.Context) ([]string, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*DiscordMessageMutation) OldCreateTime ¶
OldCreateTime returns the old "create_time" field's value of the DiscordMessage entity. If the DiscordMessage object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*DiscordMessageMutation) OldField ¶
OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.
func (*DiscordMessageMutation) OldRaw ¶
OldRaw returns the old "raw" field's value of the DiscordMessage entity. If the DiscordMessage object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*DiscordMessageMutation) OldUpdateTime ¶
OldUpdateTime returns the old "update_time" field's value of the DiscordMessage entity. If the DiscordMessage object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*DiscordMessageMutation) Op ¶
func (m *DiscordMessageMutation) Op() Op
Op returns the operation name.
func (*DiscordMessageMutation) Raw ¶
func (m *DiscordMessageMutation) Raw() (r discordgo.Message, exists bool)
Raw returns the value of the "raw" field in the mutation.
func (*DiscordMessageMutation) RemoveAuthorIDs ¶
func (m *DiscordMessageMutation) RemoveAuthorIDs(ids ...uuid.UUID)
RemoveAuthorIDs removes the "author" edge to the DiscordUser entity by IDs.
func (*DiscordMessageMutation) RemovedAuthorIDs ¶
func (m *DiscordMessageMutation) RemovedAuthorIDs() (ids []uuid.UUID)
RemovedAuthor returns the removed IDs of the "author" edge to the DiscordUser entity.
func (*DiscordMessageMutation) RemovedEdges ¶
func (m *DiscordMessageMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*DiscordMessageMutation) RemovedIDs ¶
func (m *DiscordMessageMutation) RemovedIDs(name string) []ent.Value
RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.
func (*DiscordMessageMutation) ResetAuthor ¶
func (m *DiscordMessageMutation) ResetAuthor()
ResetAuthor resets all changes to the "author" edge.
func (*DiscordMessageMutation) ResetCreateTime ¶
func (m *DiscordMessageMutation) ResetCreateTime()
ResetCreateTime resets all changes to the "create_time" field.
func (*DiscordMessageMutation) ResetEdge ¶
func (m *DiscordMessageMutation) ResetEdge(name string) error
ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.
func (*DiscordMessageMutation) ResetField ¶
func (m *DiscordMessageMutation) ResetField(name string) error
ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.
func (*DiscordMessageMutation) ResetRaw ¶
func (m *DiscordMessageMutation) ResetRaw()
ResetRaw resets all changes to the "raw" field.
func (*DiscordMessageMutation) ResetUpdateTime ¶
func (m *DiscordMessageMutation) ResetUpdateTime()
ResetUpdateTime resets all changes to the "update_time" field.
func (*DiscordMessageMutation) SetCreateTime ¶
func (m *DiscordMessageMutation) SetCreateTime(t time.Time)
SetCreateTime sets the "create_time" field.
func (*DiscordMessageMutation) SetField ¶
func (m *DiscordMessageMutation) SetField(name string, value ent.Value) error
SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*DiscordMessageMutation) SetID ¶
func (m *DiscordMessageMutation) SetID(id string)
SetID sets the value of the id field. Note that this operation is only accepted on creation of DiscordMessage entities.
func (*DiscordMessageMutation) SetOp ¶
func (m *DiscordMessageMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*DiscordMessageMutation) SetRaw ¶
func (m *DiscordMessageMutation) SetRaw(d discordgo.Message)
SetRaw sets the "raw" field.
func (*DiscordMessageMutation) SetUpdateTime ¶
func (m *DiscordMessageMutation) SetUpdateTime(t time.Time)
SetUpdateTime sets the "update_time" field.
func (DiscordMessageMutation) Tx ¶
func (m DiscordMessageMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*DiscordMessageMutation) Type ¶
func (m *DiscordMessageMutation) Type() string
Type returns the node type of this mutation (DiscordMessage).
func (*DiscordMessageMutation) UpdateTime ¶
func (m *DiscordMessageMutation) UpdateTime() (r time.Time, exists bool)
UpdateTime returns the value of the "update_time" field in the mutation.
func (*DiscordMessageMutation) Where ¶
func (m *DiscordMessageMutation) Where(ps ...predicate.DiscordMessage)
Where appends a list predicates to the DiscordMessageMutation builder.
func (*DiscordMessageMutation) WhereP ¶
func (m *DiscordMessageMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the DiscordMessageMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type DiscordMessageQuery ¶
type DiscordMessageQuery struct {
// contains filtered or unexported fields
}
DiscordMessageQuery is the builder for querying DiscordMessage entities.
func (*DiscordMessageQuery) Aggregate ¶
func (dmq *DiscordMessageQuery) Aggregate(fns ...AggregateFunc) *DiscordMessageSelect
Aggregate returns a DiscordMessageSelect configured with the given aggregations.
func (*DiscordMessageQuery) All ¶
func (dmq *DiscordMessageQuery) All(ctx context.Context) ([]*DiscordMessage, error)
All executes the query and returns a list of DiscordMessages.
func (*DiscordMessageQuery) AllX ¶
func (dmq *DiscordMessageQuery) AllX(ctx context.Context) []*DiscordMessage
AllX is like All, but panics if an error occurs.
func (*DiscordMessageQuery) Clone ¶
func (dmq *DiscordMessageQuery) Clone() *DiscordMessageQuery
Clone returns a duplicate of the DiscordMessageQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*DiscordMessageQuery) Count ¶
func (dmq *DiscordMessageQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*DiscordMessageQuery) CountX ¶
func (dmq *DiscordMessageQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*DiscordMessageQuery) Exist ¶
func (dmq *DiscordMessageQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*DiscordMessageQuery) ExistX ¶
func (dmq *DiscordMessageQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*DiscordMessageQuery) First ¶
func (dmq *DiscordMessageQuery) First(ctx context.Context) (*DiscordMessage, error)
First returns the first DiscordMessage entity from the query. Returns a *NotFoundError when no DiscordMessage was found.
func (*DiscordMessageQuery) FirstID ¶
func (dmq *DiscordMessageQuery) FirstID(ctx context.Context) (id string, err error)
FirstID returns the first DiscordMessage ID from the query. Returns a *NotFoundError when no DiscordMessage ID was found.
func (*DiscordMessageQuery) FirstIDX ¶
func (dmq *DiscordMessageQuery) FirstIDX(ctx context.Context) string
FirstIDX is like FirstID, but panics if an error occurs.
func (*DiscordMessageQuery) FirstX ¶
func (dmq *DiscordMessageQuery) FirstX(ctx context.Context) *DiscordMessage
FirstX is like First, but panics if an error occurs.
func (*DiscordMessageQuery) ForShare ¶
func (dmq *DiscordMessageQuery) ForShare(opts ...sql.LockOption) *DiscordMessageQuery
ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.
func (*DiscordMessageQuery) ForUpdate ¶
func (dmq *DiscordMessageQuery) ForUpdate(opts ...sql.LockOption) *DiscordMessageQuery
ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.
func (*DiscordMessageQuery) GroupBy ¶
func (dmq *DiscordMessageQuery) GroupBy(field string, fields ...string) *DiscordMessageGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { CreateTime time.Time `json:"create_time,omitempty"` Count int `json:"count,omitempty"` } client.DiscordMessage.Query(). GroupBy(discordmessage.FieldCreateTime). Aggregate(ent.Count()). Scan(ctx, &v)
func (*DiscordMessageQuery) IDs ¶
func (dmq *DiscordMessageQuery) IDs(ctx context.Context) (ids []string, err error)
IDs executes the query and returns a list of DiscordMessage IDs.
func (*DiscordMessageQuery) IDsX ¶
func (dmq *DiscordMessageQuery) IDsX(ctx context.Context) []string
IDsX is like IDs, but panics if an error occurs.
func (*DiscordMessageQuery) Limit ¶
func (dmq *DiscordMessageQuery) Limit(limit int) *DiscordMessageQuery
Limit the number of records to be returned by this query.
func (*DiscordMessageQuery) Offset ¶
func (dmq *DiscordMessageQuery) Offset(offset int) *DiscordMessageQuery
Offset to start from.
func (*DiscordMessageQuery) Only ¶
func (dmq *DiscordMessageQuery) Only(ctx context.Context) (*DiscordMessage, error)
Only returns a single DiscordMessage entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one DiscordMessage entity is found. Returns a *NotFoundError when no DiscordMessage entities are found.
func (*DiscordMessageQuery) OnlyID ¶
func (dmq *DiscordMessageQuery) OnlyID(ctx context.Context) (id string, err error)
OnlyID is like Only, but returns the only DiscordMessage ID in the query. Returns a *NotSingularError when more than one DiscordMessage ID is found. Returns a *NotFoundError when no entities are found.
func (*DiscordMessageQuery) OnlyIDX ¶
func (dmq *DiscordMessageQuery) OnlyIDX(ctx context.Context) string
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*DiscordMessageQuery) OnlyX ¶
func (dmq *DiscordMessageQuery) OnlyX(ctx context.Context) *DiscordMessage
OnlyX is like Only, but panics if an error occurs.
func (*DiscordMessageQuery) Order ¶
func (dmq *DiscordMessageQuery) Order(o ...discordmessage.OrderOption) *DiscordMessageQuery
Order specifies how the records should be ordered.
func (*DiscordMessageQuery) QueryAuthor ¶
func (dmq *DiscordMessageQuery) QueryAuthor() *DiscordUserQuery
QueryAuthor chains the current query on the "author" edge.
func (*DiscordMessageQuery) Select ¶
func (dmq *DiscordMessageQuery) Select(fields ...string) *DiscordMessageSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { CreateTime time.Time `json:"create_time,omitempty"` } client.DiscordMessage.Query(). Select(discordmessage.FieldCreateTime). Scan(ctx, &v)
func (*DiscordMessageQuery) Unique ¶
func (dmq *DiscordMessageQuery) Unique(unique bool) *DiscordMessageQuery
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
func (*DiscordMessageQuery) Where ¶
func (dmq *DiscordMessageQuery) Where(ps ...predicate.DiscordMessage) *DiscordMessageQuery
Where adds a new predicate for the DiscordMessageQuery builder.
func (*DiscordMessageQuery) WithAuthor ¶
func (dmq *DiscordMessageQuery) WithAuthor(opts ...func(*DiscordUserQuery)) *DiscordMessageQuery
WithAuthor tells the query-builder to eager-load the nodes that are connected to the "author" edge. The optional arguments are used to configure the query builder of the edge.
func (*DiscordMessageQuery) WithNamedAuthor ¶
func (dmq *DiscordMessageQuery) WithNamedAuthor(name string, opts ...func(*DiscordUserQuery)) *DiscordMessageQuery
WithNamedAuthor tells the query-builder to eager-load the nodes that are connected to the "author" edge with the given name. The optional arguments are used to configure the query builder of the edge.
type DiscordMessageSelect ¶
type DiscordMessageSelect struct { *DiscordMessageQuery // contains filtered or unexported fields }
DiscordMessageSelect is the builder for selecting fields of DiscordMessage entities.
func (*DiscordMessageSelect) Aggregate ¶
func (dms *DiscordMessageSelect) Aggregate(fns ...AggregateFunc) *DiscordMessageSelect
Aggregate adds the given aggregation functions to the selector query.
func (*DiscordMessageSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*DiscordMessageSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*DiscordMessageSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*DiscordMessageSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*DiscordMessageSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*DiscordMessageSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*DiscordMessageSelect) Scan ¶
func (dms *DiscordMessageSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*DiscordMessageSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type DiscordMessageUpdate ¶
type DiscordMessageUpdate struct {
// contains filtered or unexported fields
}
DiscordMessageUpdate is the builder for updating DiscordMessage entities.
func (*DiscordMessageUpdate) AddAuthor ¶
func (dmu *DiscordMessageUpdate) AddAuthor(d ...*DiscordUser) *DiscordMessageUpdate
AddAuthor adds the "author" edges to the DiscordUser entity.
func (*DiscordMessageUpdate) AddAuthorIDs ¶
func (dmu *DiscordMessageUpdate) AddAuthorIDs(ids ...uuid.UUID) *DiscordMessageUpdate
AddAuthorIDs adds the "author" edge to the DiscordUser entity by IDs.
func (*DiscordMessageUpdate) ClearAuthor ¶
func (dmu *DiscordMessageUpdate) ClearAuthor() *DiscordMessageUpdate
ClearAuthor clears all "author" edges to the DiscordUser entity.
func (*DiscordMessageUpdate) Exec ¶
func (dmu *DiscordMessageUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*DiscordMessageUpdate) ExecX ¶
func (dmu *DiscordMessageUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*DiscordMessageUpdate) Mutation ¶
func (dmu *DiscordMessageUpdate) Mutation() *DiscordMessageMutation
Mutation returns the DiscordMessageMutation object of the builder.
func (*DiscordMessageUpdate) RemoveAuthor ¶
func (dmu *DiscordMessageUpdate) RemoveAuthor(d ...*DiscordUser) *DiscordMessageUpdate
RemoveAuthor removes "author" edges to DiscordUser entities.
func (*DiscordMessageUpdate) RemoveAuthorIDs ¶
func (dmu *DiscordMessageUpdate) RemoveAuthorIDs(ids ...uuid.UUID) *DiscordMessageUpdate
RemoveAuthorIDs removes the "author" edge to DiscordUser entities by IDs.
func (*DiscordMessageUpdate) Save ¶
func (dmu *DiscordMessageUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*DiscordMessageUpdate) SaveX ¶
func (dmu *DiscordMessageUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*DiscordMessageUpdate) SetRaw ¶
func (dmu *DiscordMessageUpdate) SetRaw(d discordgo.Message) *DiscordMessageUpdate
SetRaw sets the "raw" field.
func (*DiscordMessageUpdate) SetUpdateTime ¶
func (dmu *DiscordMessageUpdate) SetUpdateTime(t time.Time) *DiscordMessageUpdate
SetUpdateTime sets the "update_time" field.
func (*DiscordMessageUpdate) Where ¶
func (dmu *DiscordMessageUpdate) Where(ps ...predicate.DiscordMessage) *DiscordMessageUpdate
Where appends a list predicates to the DiscordMessageUpdate builder.
type DiscordMessageUpdateOne ¶
type DiscordMessageUpdateOne struct {
// contains filtered or unexported fields
}
DiscordMessageUpdateOne is the builder for updating a single DiscordMessage entity.
func (*DiscordMessageUpdateOne) AddAuthor ¶
func (dmuo *DiscordMessageUpdateOne) AddAuthor(d ...*DiscordUser) *DiscordMessageUpdateOne
AddAuthor adds the "author" edges to the DiscordUser entity.
func (*DiscordMessageUpdateOne) AddAuthorIDs ¶
func (dmuo *DiscordMessageUpdateOne) AddAuthorIDs(ids ...uuid.UUID) *DiscordMessageUpdateOne
AddAuthorIDs adds the "author" edge to the DiscordUser entity by IDs.
func (*DiscordMessageUpdateOne) ClearAuthor ¶
func (dmuo *DiscordMessageUpdateOne) ClearAuthor() *DiscordMessageUpdateOne
ClearAuthor clears all "author" edges to the DiscordUser entity.
func (*DiscordMessageUpdateOne) Exec ¶
func (dmuo *DiscordMessageUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*DiscordMessageUpdateOne) ExecX ¶
func (dmuo *DiscordMessageUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*DiscordMessageUpdateOne) Mutation ¶
func (dmuo *DiscordMessageUpdateOne) Mutation() *DiscordMessageMutation
Mutation returns the DiscordMessageMutation object of the builder.
func (*DiscordMessageUpdateOne) RemoveAuthor ¶
func (dmuo *DiscordMessageUpdateOne) RemoveAuthor(d ...*DiscordUser) *DiscordMessageUpdateOne
RemoveAuthor removes "author" edges to DiscordUser entities.
func (*DiscordMessageUpdateOne) RemoveAuthorIDs ¶
func (dmuo *DiscordMessageUpdateOne) RemoveAuthorIDs(ids ...uuid.UUID) *DiscordMessageUpdateOne
RemoveAuthorIDs removes the "author" edge to DiscordUser entities by IDs.
func (*DiscordMessageUpdateOne) Save ¶
func (dmuo *DiscordMessageUpdateOne) Save(ctx context.Context) (*DiscordMessage, error)
Save executes the query and returns the updated DiscordMessage entity.
func (*DiscordMessageUpdateOne) SaveX ¶
func (dmuo *DiscordMessageUpdateOne) SaveX(ctx context.Context) *DiscordMessage
SaveX is like Save, but panics if an error occurs.
func (*DiscordMessageUpdateOne) Select ¶
func (dmuo *DiscordMessageUpdateOne) Select(field string, fields ...string) *DiscordMessageUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*DiscordMessageUpdateOne) SetRaw ¶
func (dmuo *DiscordMessageUpdateOne) SetRaw(d discordgo.Message) *DiscordMessageUpdateOne
SetRaw sets the "raw" field.
func (*DiscordMessageUpdateOne) SetUpdateTime ¶
func (dmuo *DiscordMessageUpdateOne) SetUpdateTime(t time.Time) *DiscordMessageUpdateOne
SetUpdateTime sets the "update_time" field.
func (*DiscordMessageUpdateOne) Where ¶
func (dmuo *DiscordMessageUpdateOne) Where(ps ...predicate.DiscordMessage) *DiscordMessageUpdateOne
Where appends a list predicates to the DiscordMessageUpdate builder.
type DiscordMessageUpsert ¶
DiscordMessageUpsert is the "OnConflict" setter.
func (*DiscordMessageUpsert) SetRaw ¶
func (u *DiscordMessageUpsert) SetRaw(v discordgo.Message) *DiscordMessageUpsert
SetRaw sets the "raw" field.
func (*DiscordMessageUpsert) SetUpdateTime ¶
func (u *DiscordMessageUpsert) SetUpdateTime(v time.Time) *DiscordMessageUpsert
SetUpdateTime sets the "update_time" field.
func (*DiscordMessageUpsert) UpdateRaw ¶
func (u *DiscordMessageUpsert) UpdateRaw() *DiscordMessageUpsert
UpdateRaw sets the "raw" field to the value that was provided on create.
func (*DiscordMessageUpsert) UpdateUpdateTime ¶
func (u *DiscordMessageUpsert) UpdateUpdateTime() *DiscordMessageUpsert
UpdateUpdateTime sets the "update_time" field to the value that was provided on create.
type DiscordMessageUpsertBulk ¶
type DiscordMessageUpsertBulk struct {
// contains filtered or unexported fields
}
DiscordMessageUpsertBulk is the builder for "upsert"-ing a bulk of DiscordMessage nodes.
func (*DiscordMessageUpsertBulk) DoNothing ¶
func (u *DiscordMessageUpsertBulk) DoNothing() *DiscordMessageUpsertBulk
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*DiscordMessageUpsertBulk) Exec ¶
func (u *DiscordMessageUpsertBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*DiscordMessageUpsertBulk) ExecX ¶
func (u *DiscordMessageUpsertBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*DiscordMessageUpsertBulk) Ignore ¶
func (u *DiscordMessageUpsertBulk) Ignore() *DiscordMessageUpsertBulk
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.DiscordMessage.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*DiscordMessageUpsertBulk) SetRaw ¶
func (u *DiscordMessageUpsertBulk) SetRaw(v discordgo.Message) *DiscordMessageUpsertBulk
SetRaw sets the "raw" field.
func (*DiscordMessageUpsertBulk) SetUpdateTime ¶
func (u *DiscordMessageUpsertBulk) SetUpdateTime(v time.Time) *DiscordMessageUpsertBulk
SetUpdateTime sets the "update_time" field.
func (*DiscordMessageUpsertBulk) Update ¶
func (u *DiscordMessageUpsertBulk) Update(set func(*DiscordMessageUpsert)) *DiscordMessageUpsertBulk
Update allows overriding fields `UPDATE` values. See the DiscordMessageCreateBulk.OnConflict documentation for more info.
func (*DiscordMessageUpsertBulk) UpdateNewValues ¶
func (u *DiscordMessageUpsertBulk) UpdateNewValues() *DiscordMessageUpsertBulk
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.DiscordMessage.Create(). OnConflict( sql.ResolveWithNewValues(), sql.ResolveWith(func(u *sql.UpdateSet) { u.SetIgnore(discordmessage.FieldID) }), ). Exec(ctx)
func (*DiscordMessageUpsertBulk) UpdateRaw ¶
func (u *DiscordMessageUpsertBulk) UpdateRaw() *DiscordMessageUpsertBulk
UpdateRaw sets the "raw" field to the value that was provided on create.
func (*DiscordMessageUpsertBulk) UpdateUpdateTime ¶
func (u *DiscordMessageUpsertBulk) UpdateUpdateTime() *DiscordMessageUpsertBulk
UpdateUpdateTime sets the "update_time" field to the value that was provided on create.
type DiscordMessageUpsertOne ¶
type DiscordMessageUpsertOne struct {
// contains filtered or unexported fields
}
DiscordMessageUpsertOne is the builder for "upsert"-ing
one DiscordMessage node.
func (*DiscordMessageUpsertOne) DoNothing ¶
func (u *DiscordMessageUpsertOne) DoNothing() *DiscordMessageUpsertOne
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*DiscordMessageUpsertOne) Exec ¶
func (u *DiscordMessageUpsertOne) Exec(ctx context.Context) error
Exec executes the query.
func (*DiscordMessageUpsertOne) ExecX ¶
func (u *DiscordMessageUpsertOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*DiscordMessageUpsertOne) ID ¶
func (u *DiscordMessageUpsertOne) ID(ctx context.Context) (id string, err error)
Exec executes the UPSERT query and returns the inserted/updated ID.
func (*DiscordMessageUpsertOne) IDX ¶
func (u *DiscordMessageUpsertOne) IDX(ctx context.Context) string
IDX is like ID, but panics if an error occurs.
func (*DiscordMessageUpsertOne) Ignore ¶
func (u *DiscordMessageUpsertOne) Ignore() *DiscordMessageUpsertOne
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.DiscordMessage.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*DiscordMessageUpsertOne) SetRaw ¶
func (u *DiscordMessageUpsertOne) SetRaw(v discordgo.Message) *DiscordMessageUpsertOne
SetRaw sets the "raw" field.
func (*DiscordMessageUpsertOne) SetUpdateTime ¶
func (u *DiscordMessageUpsertOne) SetUpdateTime(v time.Time) *DiscordMessageUpsertOne
SetUpdateTime sets the "update_time" field.
func (*DiscordMessageUpsertOne) Update ¶
func (u *DiscordMessageUpsertOne) Update(set func(*DiscordMessageUpsert)) *DiscordMessageUpsertOne
Update allows overriding fields `UPDATE` values. See the DiscordMessageCreate.OnConflict documentation for more info.
func (*DiscordMessageUpsertOne) UpdateNewValues ¶
func (u *DiscordMessageUpsertOne) UpdateNewValues() *DiscordMessageUpsertOne
UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:
client.DiscordMessage.Create(). OnConflict( sql.ResolveWithNewValues(), sql.ResolveWith(func(u *sql.UpdateSet) { u.SetIgnore(discordmessage.FieldID) }), ). Exec(ctx)
func (*DiscordMessageUpsertOne) UpdateRaw ¶
func (u *DiscordMessageUpsertOne) UpdateRaw() *DiscordMessageUpsertOne
UpdateRaw sets the "raw" field to the value that was provided on create.
func (*DiscordMessageUpsertOne) UpdateUpdateTime ¶
func (u *DiscordMessageUpsertOne) UpdateUpdateTime() *DiscordMessageUpsertOne
UpdateUpdateTime sets the "update_time" field to the value that was provided on create.
type DiscordMessages ¶
type DiscordMessages []*DiscordMessage
DiscordMessages is a parsable slice of DiscordMessage.
type DiscordUser ¶
type DiscordUser struct { // ID of the ent. ID uuid.UUID `json:"id,omitempty"` // Discordid holds the value of the "discordid" field. Discordid string `json:"discordid,omitempty"` // Username holds the value of the "username" field. Username string `json:"username,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the DiscordUserQuery when eager-loading is set. Edges DiscordUserEdges `json:"edges"` // contains filtered or unexported fields }
DiscordUser is the model entity for the DiscordUser schema.
func (*DiscordUser) NamedDiscordMessages ¶
func (du *DiscordUser) NamedDiscordMessages(name string) ([]*DiscordMessage, error)
NamedDiscordMessages returns the DiscordMessages named value or an error if the edge was not loaded in eager-loading with this name.
func (*DiscordUser) QueryDiscordMessages ¶
func (du *DiscordUser) QueryDiscordMessages() *DiscordMessageQuery
QueryDiscordMessages queries the "discord_messages" edge of the DiscordUser entity.
func (*DiscordUser) String ¶
func (du *DiscordUser) String() string
String implements the fmt.Stringer.
func (*DiscordUser) Unwrap ¶
func (du *DiscordUser) Unwrap() *DiscordUser
Unwrap unwraps the DiscordUser entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.
func (*DiscordUser) Update ¶
func (du *DiscordUser) Update() *DiscordUserUpdateOne
Update returns a builder for updating this DiscordUser. Note that you need to call DiscordUser.Unwrap() before calling this method if this DiscordUser was returned from a transaction, and the transaction was committed or rolled back.
type DiscordUserClient ¶
type DiscordUserClient struct {
// contains filtered or unexported fields
}
DiscordUserClient is a client for the DiscordUser schema.
func NewDiscordUserClient ¶
func NewDiscordUserClient(c config) *DiscordUserClient
NewDiscordUserClient returns a client for the DiscordUser from the given config.
func (*DiscordUserClient) Create ¶
func (c *DiscordUserClient) Create() *DiscordUserCreate
Create returns a builder for creating a DiscordUser entity.
func (*DiscordUserClient) CreateBulk ¶
func (c *DiscordUserClient) CreateBulk(builders ...*DiscordUserCreate) *DiscordUserCreateBulk
CreateBulk returns a builder for creating a bulk of DiscordUser entities.
func (*DiscordUserClient) Delete ¶
func (c *DiscordUserClient) Delete() *DiscordUserDelete
Delete returns a delete builder for DiscordUser.
func (*DiscordUserClient) DeleteOne ¶
func (c *DiscordUserClient) DeleteOne(du *DiscordUser) *DiscordUserDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*DiscordUserClient) DeleteOneID ¶
func (c *DiscordUserClient) DeleteOneID(id uuid.UUID) *DiscordUserDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*DiscordUserClient) Get ¶
func (c *DiscordUserClient) Get(ctx context.Context, id uuid.UUID) (*DiscordUser, error)
Get returns a DiscordUser entity by its id.
func (*DiscordUserClient) GetX ¶
func (c *DiscordUserClient) GetX(ctx context.Context, id uuid.UUID) *DiscordUser
GetX is like Get, but panics if an error occurs.
func (*DiscordUserClient) Hooks ¶
func (c *DiscordUserClient) Hooks() []Hook
Hooks returns the client hooks.
func (*DiscordUserClient) Intercept ¶
func (c *DiscordUserClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `discorduser.Intercept(f(g(h())))`.
func (*DiscordUserClient) Interceptors ¶
func (c *DiscordUserClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*DiscordUserClient) Query ¶
func (c *DiscordUserClient) Query() *DiscordUserQuery
Query returns a query builder for DiscordUser.
func (*DiscordUserClient) QueryDiscordMessages ¶
func (c *DiscordUserClient) QueryDiscordMessages(du *DiscordUser) *DiscordMessageQuery
QueryDiscordMessages queries the discord_messages edge of a DiscordUser.
func (*DiscordUserClient) Update ¶
func (c *DiscordUserClient) Update() *DiscordUserUpdate
Update returns an update builder for DiscordUser.
func (*DiscordUserClient) UpdateOne ¶
func (c *DiscordUserClient) UpdateOne(du *DiscordUser) *DiscordUserUpdateOne
UpdateOne returns an update builder for the given entity.
func (*DiscordUserClient) UpdateOneID ¶
func (c *DiscordUserClient) UpdateOneID(id uuid.UUID) *DiscordUserUpdateOne
UpdateOneID returns an update builder for the given id.
func (*DiscordUserClient) Use ¶
func (c *DiscordUserClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `discorduser.Hooks(f(g(h())))`.
type DiscordUserCreate ¶
type DiscordUserCreate struct {
// contains filtered or unexported fields
}
DiscordUserCreate is the builder for creating a DiscordUser entity.
func (*DiscordUserCreate) AddDiscordMessageIDs ¶
func (duc *DiscordUserCreate) AddDiscordMessageIDs(ids ...string) *DiscordUserCreate
AddDiscordMessageIDs adds the "discord_messages" edge to the DiscordMessage entity by IDs.
func (*DiscordUserCreate) AddDiscordMessages ¶
func (duc *DiscordUserCreate) AddDiscordMessages(d ...*DiscordMessage) *DiscordUserCreate
AddDiscordMessages adds the "discord_messages" edges to the DiscordMessage entity.
func (*DiscordUserCreate) Exec ¶
func (duc *DiscordUserCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*DiscordUserCreate) ExecX ¶
func (duc *DiscordUserCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*DiscordUserCreate) Mutation ¶
func (duc *DiscordUserCreate) Mutation() *DiscordUserMutation
Mutation returns the DiscordUserMutation object of the builder.
func (*DiscordUserCreate) OnConflict ¶
func (duc *DiscordUserCreate) OnConflict(opts ...sql.ConflictOption) *DiscordUserUpsertOne
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.DiscordUser.Create(). SetDiscordid(v). OnConflict( // Update the row with the new values // the was proposed for insertion. sql.ResolveWithNewValues(), ). // Override some of the fields with custom // update values. Update(func(u *ent.DiscordUserUpsert) { SetDiscordid(v+v). }). Exec(ctx)
func (*DiscordUserCreate) OnConflictColumns ¶
func (duc *DiscordUserCreate) OnConflictColumns(columns ...string) *DiscordUserUpsertOne
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.DiscordUser.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*DiscordUserCreate) Save ¶
func (duc *DiscordUserCreate) Save(ctx context.Context) (*DiscordUser, error)
Save creates the DiscordUser in the database.
func (*DiscordUserCreate) SaveX ¶
func (duc *DiscordUserCreate) SaveX(ctx context.Context) *DiscordUser
SaveX calls Save and panics if Save returns an error.
func (*DiscordUserCreate) SetDiscordid ¶
func (duc *DiscordUserCreate) SetDiscordid(s string) *DiscordUserCreate
SetDiscordid sets the "discordid" field.
func (*DiscordUserCreate) SetID ¶
func (duc *DiscordUserCreate) SetID(u uuid.UUID) *DiscordUserCreate
SetID sets the "id" field.
func (*DiscordUserCreate) SetNillableDiscordid ¶
func (duc *DiscordUserCreate) SetNillableDiscordid(s *string) *DiscordUserCreate
SetNillableDiscordid sets the "discordid" field if the given value is not nil.
func (*DiscordUserCreate) SetUsername ¶
func (duc *DiscordUserCreate) SetUsername(s string) *DiscordUserCreate
SetUsername sets the "username" field.
type DiscordUserCreateBulk ¶
type DiscordUserCreateBulk struct {
// contains filtered or unexported fields
}
DiscordUserCreateBulk is the builder for creating many DiscordUser entities in bulk.
func (*DiscordUserCreateBulk) Exec ¶
func (ducb *DiscordUserCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*DiscordUserCreateBulk) ExecX ¶
func (ducb *DiscordUserCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*DiscordUserCreateBulk) OnConflict ¶
func (ducb *DiscordUserCreateBulk) OnConflict(opts ...sql.ConflictOption) *DiscordUserUpsertBulk
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.DiscordUser.CreateBulk(builders...). OnConflict( // Update the row with the new values // the was proposed for insertion. sql.ResolveWithNewValues(), ). // Override some of the fields with custom // update values. Update(func(u *ent.DiscordUserUpsert) { SetDiscordid(v+v). }). Exec(ctx)
func (*DiscordUserCreateBulk) OnConflictColumns ¶
func (ducb *DiscordUserCreateBulk) OnConflictColumns(columns ...string) *DiscordUserUpsertBulk
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.DiscordUser.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*DiscordUserCreateBulk) Save ¶
func (ducb *DiscordUserCreateBulk) Save(ctx context.Context) ([]*DiscordUser, error)
Save creates the DiscordUser entities in the database.
func (*DiscordUserCreateBulk) SaveX ¶
func (ducb *DiscordUserCreateBulk) SaveX(ctx context.Context) []*DiscordUser
SaveX is like Save, but panics if an error occurs.
type DiscordUserDelete ¶
type DiscordUserDelete struct {
// contains filtered or unexported fields
}
DiscordUserDelete is the builder for deleting a DiscordUser entity.
func (*DiscordUserDelete) Exec ¶
func (dud *DiscordUserDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*DiscordUserDelete) ExecX ¶
func (dud *DiscordUserDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*DiscordUserDelete) Where ¶
func (dud *DiscordUserDelete) Where(ps ...predicate.DiscordUser) *DiscordUserDelete
Where appends a list predicates to the DiscordUserDelete builder.
type DiscordUserDeleteOne ¶
type DiscordUserDeleteOne struct {
// contains filtered or unexported fields
}
DiscordUserDeleteOne is the builder for deleting a single DiscordUser entity.
func (*DiscordUserDeleteOne) Exec ¶
func (dudo *DiscordUserDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*DiscordUserDeleteOne) ExecX ¶
func (dudo *DiscordUserDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*DiscordUserDeleteOne) Where ¶
func (dudo *DiscordUserDeleteOne) Where(ps ...predicate.DiscordUser) *DiscordUserDeleteOne
Where appends a list predicates to the DiscordUserDelete builder.
type DiscordUserEdges ¶
type DiscordUserEdges struct { // DiscordMessages holds the value of the discord_messages edge. DiscordMessages []*DiscordMessage `json:"discord_messages,omitempty"` // contains filtered or unexported fields }
DiscordUserEdges holds the relations/edges for other nodes in the graph.
func (DiscordUserEdges) DiscordMessagesOrErr ¶
func (e DiscordUserEdges) DiscordMessagesOrErr() ([]*DiscordMessage, error)
DiscordMessagesOrErr returns the DiscordMessages value or an error if the edge was not loaded in eager-loading.
type DiscordUserGroupBy ¶
type DiscordUserGroupBy struct {
// contains filtered or unexported fields
}
DiscordUserGroupBy is the group-by builder for DiscordUser entities.
func (*DiscordUserGroupBy) Aggregate ¶
func (dugb *DiscordUserGroupBy) Aggregate(fns ...AggregateFunc) *DiscordUserGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*DiscordUserGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*DiscordUserGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*DiscordUserGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*DiscordUserGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*DiscordUserGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*DiscordUserGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*DiscordUserGroupBy) Scan ¶
func (dugb *DiscordUserGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*DiscordUserGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type DiscordUserMutation ¶
type DiscordUserMutation struct {
// contains filtered or unexported fields
}
DiscordUserMutation represents an operation that mutates the DiscordUser nodes in the graph.
func (*DiscordUserMutation) AddDiscordMessageIDs ¶
func (m *DiscordUserMutation) AddDiscordMessageIDs(ids ...string)
AddDiscordMessageIDs adds the "discord_messages" edge to the DiscordMessage entity by ids.
func (*DiscordUserMutation) AddField ¶
func (m *DiscordUserMutation) AddField(name string, value ent.Value) error
AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*DiscordUserMutation) AddedEdges ¶
func (m *DiscordUserMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*DiscordUserMutation) AddedField ¶
func (m *DiscordUserMutation) AddedField(name string) (ent.Value, bool)
AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*DiscordUserMutation) AddedFields ¶
func (m *DiscordUserMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*DiscordUserMutation) AddedIDs ¶
func (m *DiscordUserMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*DiscordUserMutation) ClearDiscordMessages ¶
func (m *DiscordUserMutation) ClearDiscordMessages()
ClearDiscordMessages clears the "discord_messages" edge to the DiscordMessage entity.
func (*DiscordUserMutation) ClearEdge ¶
func (m *DiscordUserMutation) ClearEdge(name string) error
ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.
func (*DiscordUserMutation) ClearField ¶
func (m *DiscordUserMutation) ClearField(name string) error
ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.
func (*DiscordUserMutation) ClearedEdges ¶
func (m *DiscordUserMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*DiscordUserMutation) ClearedFields ¶
func (m *DiscordUserMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (DiscordUserMutation) Client ¶
func (m DiscordUserMutation) Client() *Client
Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.
func (*DiscordUserMutation) DiscordMessagesCleared ¶
func (m *DiscordUserMutation) DiscordMessagesCleared() bool
DiscordMessagesCleared reports if the "discord_messages" edge to the DiscordMessage entity was cleared.
func (*DiscordUserMutation) DiscordMessagesIDs ¶
func (m *DiscordUserMutation) DiscordMessagesIDs() (ids []string)
DiscordMessagesIDs returns the "discord_messages" edge IDs in the mutation.
func (*DiscordUserMutation) Discordid ¶
func (m *DiscordUserMutation) Discordid() (r string, exists bool)
Discordid returns the value of the "discordid" field in the mutation.
func (*DiscordUserMutation) EdgeCleared ¶
func (m *DiscordUserMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*DiscordUserMutation) Field ¶
func (m *DiscordUserMutation) Field(name string) (ent.Value, bool)
Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*DiscordUserMutation) FieldCleared ¶
func (m *DiscordUserMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*DiscordUserMutation) Fields ¶
func (m *DiscordUserMutation) Fields() []string
Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().
func (*DiscordUserMutation) ID ¶
func (m *DiscordUserMutation) ID() (id uuid.UUID, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*DiscordUserMutation) IDs ¶
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*DiscordUserMutation) OldDiscordid ¶
func (m *DiscordUserMutation) OldDiscordid(ctx context.Context) (v string, err error)
OldDiscordid returns the old "discordid" field's value of the DiscordUser entity. If the DiscordUser object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*DiscordUserMutation) OldField ¶
OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.
func (*DiscordUserMutation) OldUsername ¶
func (m *DiscordUserMutation) OldUsername(ctx context.Context) (v string, err error)
OldUsername returns the old "username" field's value of the DiscordUser entity. If the DiscordUser object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*DiscordUserMutation) Op ¶
func (m *DiscordUserMutation) Op() Op
Op returns the operation name.
func (*DiscordUserMutation) RemoveDiscordMessageIDs ¶
func (m *DiscordUserMutation) RemoveDiscordMessageIDs(ids ...string)
RemoveDiscordMessageIDs removes the "discord_messages" edge to the DiscordMessage entity by IDs.
func (*DiscordUserMutation) RemovedDiscordMessagesIDs ¶
func (m *DiscordUserMutation) RemovedDiscordMessagesIDs() (ids []string)
RemovedDiscordMessages returns the removed IDs of the "discord_messages" edge to the DiscordMessage entity.
func (*DiscordUserMutation) RemovedEdges ¶
func (m *DiscordUserMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*DiscordUserMutation) RemovedIDs ¶
func (m *DiscordUserMutation) RemovedIDs(name string) []ent.Value
RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.
func (*DiscordUserMutation) ResetDiscordMessages ¶
func (m *DiscordUserMutation) ResetDiscordMessages()
ResetDiscordMessages resets all changes to the "discord_messages" edge.
func (*DiscordUserMutation) ResetDiscordid ¶
func (m *DiscordUserMutation) ResetDiscordid()
ResetDiscordid resets all changes to the "discordid" field.
func (*DiscordUserMutation) ResetEdge ¶
func (m *DiscordUserMutation) ResetEdge(name string) error
ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.
func (*DiscordUserMutation) ResetField ¶
func (m *DiscordUserMutation) ResetField(name string) error
ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.
func (*DiscordUserMutation) ResetUsername ¶
func (m *DiscordUserMutation) ResetUsername()
ResetUsername resets all changes to the "username" field.
func (*DiscordUserMutation) SetDiscordid ¶
func (m *DiscordUserMutation) SetDiscordid(s string)
SetDiscordid sets the "discordid" field.
func (*DiscordUserMutation) SetField ¶
func (m *DiscordUserMutation) SetField(name string, value ent.Value) error
SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*DiscordUserMutation) SetID ¶
func (m *DiscordUserMutation) SetID(id uuid.UUID)
SetID sets the value of the id field. Note that this operation is only accepted on creation of DiscordUser entities.
func (*DiscordUserMutation) SetOp ¶
func (m *DiscordUserMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*DiscordUserMutation) SetUsername ¶
func (m *DiscordUserMutation) SetUsername(s string)
SetUsername sets the "username" field.
func (DiscordUserMutation) Tx ¶
func (m DiscordUserMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*DiscordUserMutation) Type ¶
func (m *DiscordUserMutation) Type() string
Type returns the node type of this mutation (DiscordUser).
func (*DiscordUserMutation) Username ¶
func (m *DiscordUserMutation) Username() (r string, exists bool)
Username returns the value of the "username" field in the mutation.
func (*DiscordUserMutation) Where ¶
func (m *DiscordUserMutation) Where(ps ...predicate.DiscordUser)
Where appends a list predicates to the DiscordUserMutation builder.
func (*DiscordUserMutation) WhereP ¶
func (m *DiscordUserMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the DiscordUserMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type DiscordUserQuery ¶
type DiscordUserQuery struct {
// contains filtered or unexported fields
}
DiscordUserQuery is the builder for querying DiscordUser entities.
func (*DiscordUserQuery) Aggregate ¶
func (duq *DiscordUserQuery) Aggregate(fns ...AggregateFunc) *DiscordUserSelect
Aggregate returns a DiscordUserSelect configured with the given aggregations.
func (*DiscordUserQuery) All ¶
func (duq *DiscordUserQuery) All(ctx context.Context) ([]*DiscordUser, error)
All executes the query and returns a list of DiscordUsers.
func (*DiscordUserQuery) AllX ¶
func (duq *DiscordUserQuery) AllX(ctx context.Context) []*DiscordUser
AllX is like All, but panics if an error occurs.
func (*DiscordUserQuery) Clone ¶
func (duq *DiscordUserQuery) Clone() *DiscordUserQuery
Clone returns a duplicate of the DiscordUserQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*DiscordUserQuery) Count ¶
func (duq *DiscordUserQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*DiscordUserQuery) CountX ¶
func (duq *DiscordUserQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*DiscordUserQuery) Exist ¶
func (duq *DiscordUserQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*DiscordUserQuery) ExistX ¶
func (duq *DiscordUserQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*DiscordUserQuery) First ¶
func (duq *DiscordUserQuery) First(ctx context.Context) (*DiscordUser, error)
First returns the first DiscordUser entity from the query. Returns a *NotFoundError when no DiscordUser was found.
func (*DiscordUserQuery) FirstID ¶
FirstID returns the first DiscordUser ID from the query. Returns a *NotFoundError when no DiscordUser ID was found.
func (*DiscordUserQuery) FirstIDX ¶
func (duq *DiscordUserQuery) FirstIDX(ctx context.Context) uuid.UUID
FirstIDX is like FirstID, but panics if an error occurs.
func (*DiscordUserQuery) FirstX ¶
func (duq *DiscordUserQuery) FirstX(ctx context.Context) *DiscordUser
FirstX is like First, but panics if an error occurs.
func (*DiscordUserQuery) ForShare ¶
func (duq *DiscordUserQuery) ForShare(opts ...sql.LockOption) *DiscordUserQuery
ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.
func (*DiscordUserQuery) ForUpdate ¶
func (duq *DiscordUserQuery) ForUpdate(opts ...sql.LockOption) *DiscordUserQuery
ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.
func (*DiscordUserQuery) GroupBy ¶
func (duq *DiscordUserQuery) GroupBy(field string, fields ...string) *DiscordUserGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { Discordid string `json:"discordid,omitempty"` Count int `json:"count,omitempty"` } client.DiscordUser.Query(). GroupBy(discorduser.FieldDiscordid). Aggregate(ent.Count()). Scan(ctx, &v)
func (*DiscordUserQuery) IDsX ¶
func (duq *DiscordUserQuery) IDsX(ctx context.Context) []uuid.UUID
IDsX is like IDs, but panics if an error occurs.
func (*DiscordUserQuery) Limit ¶
func (duq *DiscordUserQuery) Limit(limit int) *DiscordUserQuery
Limit the number of records to be returned by this query.
func (*DiscordUserQuery) Offset ¶
func (duq *DiscordUserQuery) Offset(offset int) *DiscordUserQuery
Offset to start from.
func (*DiscordUserQuery) Only ¶
func (duq *DiscordUserQuery) Only(ctx context.Context) (*DiscordUser, error)
Only returns a single DiscordUser entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one DiscordUser entity is found. Returns a *NotFoundError when no DiscordUser entities are found.
func (*DiscordUserQuery) OnlyID ¶
OnlyID is like Only, but returns the only DiscordUser ID in the query. Returns a *NotSingularError when more than one DiscordUser ID is found. Returns a *NotFoundError when no entities are found.
func (*DiscordUserQuery) OnlyIDX ¶
func (duq *DiscordUserQuery) OnlyIDX(ctx context.Context) uuid.UUID
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*DiscordUserQuery) OnlyX ¶
func (duq *DiscordUserQuery) OnlyX(ctx context.Context) *DiscordUser
OnlyX is like Only, but panics if an error occurs.
func (*DiscordUserQuery) Order ¶
func (duq *DiscordUserQuery) Order(o ...discorduser.OrderOption) *DiscordUserQuery
Order specifies how the records should be ordered.
func (*DiscordUserQuery) QueryDiscordMessages ¶
func (duq *DiscordUserQuery) QueryDiscordMessages() *DiscordMessageQuery
QueryDiscordMessages chains the current query on the "discord_messages" edge.
func (*DiscordUserQuery) Select ¶
func (duq *DiscordUserQuery) Select(fields ...string) *DiscordUserSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { Discordid string `json:"discordid,omitempty"` } client.DiscordUser.Query(). Select(discorduser.FieldDiscordid). Scan(ctx, &v)
func (*DiscordUserQuery) Unique ¶
func (duq *DiscordUserQuery) Unique(unique bool) *DiscordUserQuery
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
func (*DiscordUserQuery) Where ¶
func (duq *DiscordUserQuery) Where(ps ...predicate.DiscordUser) *DiscordUserQuery
Where adds a new predicate for the DiscordUserQuery builder.
func (*DiscordUserQuery) WithDiscordMessages ¶
func (duq *DiscordUserQuery) WithDiscordMessages(opts ...func(*DiscordMessageQuery)) *DiscordUserQuery
WithDiscordMessages tells the query-builder to eager-load the nodes that are connected to the "discord_messages" edge. The optional arguments are used to configure the query builder of the edge.
func (*DiscordUserQuery) WithNamedDiscordMessages ¶
func (duq *DiscordUserQuery) WithNamedDiscordMessages(name string, opts ...func(*DiscordMessageQuery)) *DiscordUserQuery
WithNamedDiscordMessages tells the query-builder to eager-load the nodes that are connected to the "discord_messages" edge with the given name. The optional arguments are used to configure the query builder of the edge.
type DiscordUserSelect ¶
type DiscordUserSelect struct { *DiscordUserQuery // contains filtered or unexported fields }
DiscordUserSelect is the builder for selecting fields of DiscordUser entities.
func (*DiscordUserSelect) Aggregate ¶
func (dus *DiscordUserSelect) Aggregate(fns ...AggregateFunc) *DiscordUserSelect
Aggregate adds the given aggregation functions to the selector query.
func (*DiscordUserSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*DiscordUserSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*DiscordUserSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*DiscordUserSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*DiscordUserSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*DiscordUserSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*DiscordUserSelect) Scan ¶
func (dus *DiscordUserSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*DiscordUserSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type DiscordUserUpdate ¶
type DiscordUserUpdate struct {
// contains filtered or unexported fields
}
DiscordUserUpdate is the builder for updating DiscordUser entities.
func (*DiscordUserUpdate) AddDiscordMessageIDs ¶
func (duu *DiscordUserUpdate) AddDiscordMessageIDs(ids ...string) *DiscordUserUpdate
AddDiscordMessageIDs adds the "discord_messages" edge to the DiscordMessage entity by IDs.
func (*DiscordUserUpdate) AddDiscordMessages ¶
func (duu *DiscordUserUpdate) AddDiscordMessages(d ...*DiscordMessage) *DiscordUserUpdate
AddDiscordMessages adds the "discord_messages" edges to the DiscordMessage entity.
func (*DiscordUserUpdate) ClearDiscordMessages ¶
func (duu *DiscordUserUpdate) ClearDiscordMessages() *DiscordUserUpdate
ClearDiscordMessages clears all "discord_messages" edges to the DiscordMessage entity.
func (*DiscordUserUpdate) Exec ¶
func (duu *DiscordUserUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*DiscordUserUpdate) ExecX ¶
func (duu *DiscordUserUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*DiscordUserUpdate) Mutation ¶
func (duu *DiscordUserUpdate) Mutation() *DiscordUserMutation
Mutation returns the DiscordUserMutation object of the builder.
func (*DiscordUserUpdate) RemoveDiscordMessageIDs ¶
func (duu *DiscordUserUpdate) RemoveDiscordMessageIDs(ids ...string) *DiscordUserUpdate
RemoveDiscordMessageIDs removes the "discord_messages" edge to DiscordMessage entities by IDs.
func (*DiscordUserUpdate) RemoveDiscordMessages ¶
func (duu *DiscordUserUpdate) RemoveDiscordMessages(d ...*DiscordMessage) *DiscordUserUpdate
RemoveDiscordMessages removes "discord_messages" edges to DiscordMessage entities.
func (*DiscordUserUpdate) Save ¶
func (duu *DiscordUserUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*DiscordUserUpdate) SaveX ¶
func (duu *DiscordUserUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*DiscordUserUpdate) SetDiscordid ¶
func (duu *DiscordUserUpdate) SetDiscordid(s string) *DiscordUserUpdate
SetDiscordid sets the "discordid" field.
func (*DiscordUserUpdate) SetNillableDiscordid ¶
func (duu *DiscordUserUpdate) SetNillableDiscordid(s *string) *DiscordUserUpdate
SetNillableDiscordid sets the "discordid" field if the given value is not nil.
func (*DiscordUserUpdate) SetUsername ¶
func (duu *DiscordUserUpdate) SetUsername(s string) *DiscordUserUpdate
SetUsername sets the "username" field.
func (*DiscordUserUpdate) Where ¶
func (duu *DiscordUserUpdate) Where(ps ...predicate.DiscordUser) *DiscordUserUpdate
Where appends a list predicates to the DiscordUserUpdate builder.
type DiscordUserUpdateOne ¶
type DiscordUserUpdateOne struct {
// contains filtered or unexported fields
}
DiscordUserUpdateOne is the builder for updating a single DiscordUser entity.
func (*DiscordUserUpdateOne) AddDiscordMessageIDs ¶
func (duuo *DiscordUserUpdateOne) AddDiscordMessageIDs(ids ...string) *DiscordUserUpdateOne
AddDiscordMessageIDs adds the "discord_messages" edge to the DiscordMessage entity by IDs.
func (*DiscordUserUpdateOne) AddDiscordMessages ¶
func (duuo *DiscordUserUpdateOne) AddDiscordMessages(d ...*DiscordMessage) *DiscordUserUpdateOne
AddDiscordMessages adds the "discord_messages" edges to the DiscordMessage entity.
func (*DiscordUserUpdateOne) ClearDiscordMessages ¶
func (duuo *DiscordUserUpdateOne) ClearDiscordMessages() *DiscordUserUpdateOne
ClearDiscordMessages clears all "discord_messages" edges to the DiscordMessage entity.
func (*DiscordUserUpdateOne) Exec ¶
func (duuo *DiscordUserUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*DiscordUserUpdateOne) ExecX ¶
func (duuo *DiscordUserUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*DiscordUserUpdateOne) Mutation ¶
func (duuo *DiscordUserUpdateOne) Mutation() *DiscordUserMutation
Mutation returns the DiscordUserMutation object of the builder.
func (*DiscordUserUpdateOne) RemoveDiscordMessageIDs ¶
func (duuo *DiscordUserUpdateOne) RemoveDiscordMessageIDs(ids ...string) *DiscordUserUpdateOne
RemoveDiscordMessageIDs removes the "discord_messages" edge to DiscordMessage entities by IDs.
func (*DiscordUserUpdateOne) RemoveDiscordMessages ¶
func (duuo *DiscordUserUpdateOne) RemoveDiscordMessages(d ...*DiscordMessage) *DiscordUserUpdateOne
RemoveDiscordMessages removes "discord_messages" edges to DiscordMessage entities.
func (*DiscordUserUpdateOne) Save ¶
func (duuo *DiscordUserUpdateOne) Save(ctx context.Context) (*DiscordUser, error)
Save executes the query and returns the updated DiscordUser entity.
func (*DiscordUserUpdateOne) SaveX ¶
func (duuo *DiscordUserUpdateOne) SaveX(ctx context.Context) *DiscordUser
SaveX is like Save, but panics if an error occurs.
func (*DiscordUserUpdateOne) Select ¶
func (duuo *DiscordUserUpdateOne) Select(field string, fields ...string) *DiscordUserUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*DiscordUserUpdateOne) SetDiscordid ¶
func (duuo *DiscordUserUpdateOne) SetDiscordid(s string) *DiscordUserUpdateOne
SetDiscordid sets the "discordid" field.
func (*DiscordUserUpdateOne) SetNillableDiscordid ¶
func (duuo *DiscordUserUpdateOne) SetNillableDiscordid(s *string) *DiscordUserUpdateOne
SetNillableDiscordid sets the "discordid" field if the given value is not nil.
func (*DiscordUserUpdateOne) SetUsername ¶
func (duuo *DiscordUserUpdateOne) SetUsername(s string) *DiscordUserUpdateOne
SetUsername sets the "username" field.
func (*DiscordUserUpdateOne) Where ¶
func (duuo *DiscordUserUpdateOne) Where(ps ...predicate.DiscordUser) *DiscordUserUpdateOne
Where appends a list predicates to the DiscordUserUpdate builder.
type DiscordUserUpsert ¶
DiscordUserUpsert is the "OnConflict" setter.
func (*DiscordUserUpsert) SetDiscordid ¶
func (u *DiscordUserUpsert) SetDiscordid(v string) *DiscordUserUpsert
SetDiscordid sets the "discordid" field.
func (*DiscordUserUpsert) SetUsername ¶
func (u *DiscordUserUpsert) SetUsername(v string) *DiscordUserUpsert
SetUsername sets the "username" field.
func (*DiscordUserUpsert) UpdateDiscordid ¶
func (u *DiscordUserUpsert) UpdateDiscordid() *DiscordUserUpsert
UpdateDiscordid sets the "discordid" field to the value that was provided on create.
func (*DiscordUserUpsert) UpdateUsername ¶
func (u *DiscordUserUpsert) UpdateUsername() *DiscordUserUpsert
UpdateUsername sets the "username" field to the value that was provided on create.
type DiscordUserUpsertBulk ¶
type DiscordUserUpsertBulk struct {
// contains filtered or unexported fields
}
DiscordUserUpsertBulk is the builder for "upsert"-ing a bulk of DiscordUser nodes.
func (*DiscordUserUpsertBulk) DoNothing ¶
func (u *DiscordUserUpsertBulk) DoNothing() *DiscordUserUpsertBulk
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*DiscordUserUpsertBulk) Exec ¶
func (u *DiscordUserUpsertBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*DiscordUserUpsertBulk) ExecX ¶
func (u *DiscordUserUpsertBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*DiscordUserUpsertBulk) Ignore ¶
func (u *DiscordUserUpsertBulk) Ignore() *DiscordUserUpsertBulk
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.DiscordUser.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*DiscordUserUpsertBulk) SetDiscordid ¶
func (u *DiscordUserUpsertBulk) SetDiscordid(v string) *DiscordUserUpsertBulk
SetDiscordid sets the "discordid" field.
func (*DiscordUserUpsertBulk) SetUsername ¶
func (u *DiscordUserUpsertBulk) SetUsername(v string) *DiscordUserUpsertBulk
SetUsername sets the "username" field.
func (*DiscordUserUpsertBulk) Update ¶
func (u *DiscordUserUpsertBulk) Update(set func(*DiscordUserUpsert)) *DiscordUserUpsertBulk
Update allows overriding fields `UPDATE` values. See the DiscordUserCreateBulk.OnConflict documentation for more info.
func (*DiscordUserUpsertBulk) UpdateDiscordid ¶
func (u *DiscordUserUpsertBulk) UpdateDiscordid() *DiscordUserUpsertBulk
UpdateDiscordid sets the "discordid" field to the value that was provided on create.
func (*DiscordUserUpsertBulk) UpdateNewValues ¶
func (u *DiscordUserUpsertBulk) UpdateNewValues() *DiscordUserUpsertBulk
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.DiscordUser.Create(). OnConflict( sql.ResolveWithNewValues(), sql.ResolveWith(func(u *sql.UpdateSet) { u.SetIgnore(discorduser.FieldID) }), ). Exec(ctx)
func (*DiscordUserUpsertBulk) UpdateUsername ¶
func (u *DiscordUserUpsertBulk) UpdateUsername() *DiscordUserUpsertBulk
UpdateUsername sets the "username" field to the value that was provided on create.
type DiscordUserUpsertOne ¶
type DiscordUserUpsertOne struct {
// contains filtered or unexported fields
}
DiscordUserUpsertOne is the builder for "upsert"-ing
one DiscordUser node.
func (*DiscordUserUpsertOne) DoNothing ¶
func (u *DiscordUserUpsertOne) DoNothing() *DiscordUserUpsertOne
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*DiscordUserUpsertOne) Exec ¶
func (u *DiscordUserUpsertOne) Exec(ctx context.Context) error
Exec executes the query.
func (*DiscordUserUpsertOne) ExecX ¶
func (u *DiscordUserUpsertOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*DiscordUserUpsertOne) ID ¶
Exec executes the UPSERT query and returns the inserted/updated ID.
func (*DiscordUserUpsertOne) IDX ¶
func (u *DiscordUserUpsertOne) IDX(ctx context.Context) uuid.UUID
IDX is like ID, but panics if an error occurs.
func (*DiscordUserUpsertOne) Ignore ¶
func (u *DiscordUserUpsertOne) Ignore() *DiscordUserUpsertOne
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.DiscordUser.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*DiscordUserUpsertOne) SetDiscordid ¶
func (u *DiscordUserUpsertOne) SetDiscordid(v string) *DiscordUserUpsertOne
SetDiscordid sets the "discordid" field.
func (*DiscordUserUpsertOne) SetUsername ¶
func (u *DiscordUserUpsertOne) SetUsername(v string) *DiscordUserUpsertOne
SetUsername sets the "username" field.
func (*DiscordUserUpsertOne) Update ¶
func (u *DiscordUserUpsertOne) Update(set func(*DiscordUserUpsert)) *DiscordUserUpsertOne
Update allows overriding fields `UPDATE` values. See the DiscordUserCreate.OnConflict documentation for more info.
func (*DiscordUserUpsertOne) UpdateDiscordid ¶
func (u *DiscordUserUpsertOne) UpdateDiscordid() *DiscordUserUpsertOne
UpdateDiscordid sets the "discordid" field to the value that was provided on create.
func (*DiscordUserUpsertOne) UpdateNewValues ¶
func (u *DiscordUserUpsertOne) UpdateNewValues() *DiscordUserUpsertOne
UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:
client.DiscordUser.Create(). OnConflict( sql.ResolveWithNewValues(), sql.ResolveWith(func(u *sql.UpdateSet) { u.SetIgnore(discorduser.FieldID) }), ). Exec(ctx)
func (*DiscordUserUpsertOne) UpdateUsername ¶
func (u *DiscordUserUpsertOne) UpdateUsername() *DiscordUserUpsertOne
UpdateUsername sets the "username" field to the value that was provided on create.
type DiscordUsers ¶
type DiscordUsers []*DiscordUser
DiscordUsers is a parsable slice of DiscordUser.
type InterceptFunc ¶
type InterceptFunc = ent.InterceptFunc
ent aliases to avoid import conflicts in user's code.
type Interceptor ¶
type Interceptor = ent.Interceptor
ent aliases to avoid import conflicts in user's code.
type MutateFunc ¶
type MutateFunc = ent.MutateFunc
ent aliases to avoid import conflicts in user's code.
type NotFoundError ¶
type NotFoundError struct {
// contains filtered or unexported fields
}
NotFoundError returns when trying to fetch a specific entity and it was not found in the database.
func (*NotFoundError) Error ¶
func (e *NotFoundError) Error() string
Error implements the error interface.
type NotLoadedError ¶
type NotLoadedError struct {
// contains filtered or unexported fields
}
NotLoadedError returns when trying to get a node that was not loaded by the query.
func (*NotLoadedError) Error ¶
func (e *NotLoadedError) Error() string
Error implements the error interface.
type NotSingularError ¶
type NotSingularError struct {
// contains filtered or unexported fields
}
NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.
func (*NotSingularError) Error ¶
func (e *NotSingularError) Error() string
Error implements the error interface.
type OrderFunc ¶
OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.
type QuerierFunc ¶
type QuerierFunc = ent.QuerierFunc
ent aliases to avoid import conflicts in user's code.
type QueryContext ¶
type QueryContext = ent.QueryContext
ent aliases to avoid import conflicts in user's code.
type RollbackFunc ¶
The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.
type RollbackHook ¶
type RollbackHook func(Rollbacker) Rollbacker
RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:
hook := func(next ent.Rollbacker) ent.Rollbacker { return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error { // Do some stuff before. if err := next.Rollback(ctx, tx); err != nil { return err } // Do some stuff after. return nil }) }
type Rollbacker ¶
Rollbacker is the interface that wraps the Rollback method.
type TraverseFunc ¶
type TraverseFunc = ent.TraverseFunc
ent aliases to avoid import conflicts in user's code.
type Tx ¶
type Tx struct { // Book is the client for interacting with the Book builders. Book *BookClient // BookAuthor is the client for interacting with the BookAuthor builders. BookAuthor *BookAuthorClient // DiscordMessage is the client for interacting with the DiscordMessage builders. DiscordMessage *DiscordMessageClient // DiscordUser is the client for interacting with the DiscordUser builders. DiscordUser *DiscordUserClient // contains filtered or unexported fields }
Tx is a transactional client that is created by calling Client.Tx().
func TxFromContext ¶
TxFromContext returns a Tx stored inside a context, or nil if there isn't one.
func (*Tx) OnRollback ¶
func (tx *Tx) OnRollback(f RollbackHook)
OnRollback adds a hook to call on rollback.
type ValidationError ¶
type ValidationError struct { Name string // Field or edge name. // contains filtered or unexported fields }
ValidationError returns when validating a field or edge fails.
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
Error implements the error interface.
func (*ValidationError) Unwrap ¶
func (e *ValidationError) Unwrap() error
Unwrap implements the errors.Wrapper interface.
Source Files ¶
- book.go
- book_create.go
- book_delete.go
- book_query.go
- book_update.go
- bookauthor.go
- bookauthor_create.go
- bookauthor_delete.go
- bookauthor_query.go
- bookauthor_update.go
- client.go
- discordmessage.go
- discordmessage_create.go
- discordmessage_delete.go
- discordmessage_query.go
- discordmessage_update.go
- discorduser.go
- discorduser_create.go
- discorduser_delete.go
- discorduser_query.go
- discorduser_update.go
- ent.go
- generate.go
- mutation.go
- runtime.go
- tx.go