update dependencies

This commit is contained in:
Niko Storni 2023-05-30 18:17:46 +02:00
parent 4632fdd52b
commit cfefe99de1
16 changed files with 828 additions and 382 deletions

View file

@ -1,12 +1,14 @@
// Code generated by SQLBoiler 3.7.1 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT.
// Code generated by SQLBoiler 4.14.2 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT.
// This file is meant to be re-generated in place and/or deleted at any time.
package model
import (
"github.com/volatiletech/sqlboiler/drivers"
"github.com/volatiletech/sqlboiler/queries"
"github.com/volatiletech/sqlboiler/queries/qm"
"regexp"
"github.com/volatiletech/sqlboiler/v4/drivers"
"github.com/volatiletech/sqlboiler/v4/queries"
"github.com/volatiletech/sqlboiler/v4/queries/qm"
)
var dialect = drivers.Dialect{
@ -23,6 +25,9 @@ var dialect = drivers.Dialect{
UseCaseWhenExistsClause: false,
}
// This is a dummy variable to prevent unused regexp import error
var _ = &regexp.Regexp{}
// NewQuery initializes a new Query using the passed in QueryMods
func NewQuery(mods ...qm.QueryMod) *queries.Query {
q := &queries.Query{}

View file

@ -1,4 +1,4 @@
// Code generated by SQLBoiler 3.7.1 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT.
// Code generated by SQLBoiler 4.14.2 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT.
// This file is meant to be re-generated in place and/or deleted at any time.
package model

View file

@ -1,4 +1,4 @@
// Code generated by SQLBoiler 3.7.1 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT.
// Code generated by SQLBoiler 4.14.2 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT.
// This file is meant to be re-generated in place and/or deleted at any time.
package model
@ -7,8 +7,8 @@ import (
"strconv"
"github.com/friendsofgo/errors"
"github.com/volatiletech/sqlboiler/boil"
"github.com/volatiletech/sqlboiler/strmangle"
"github.com/volatiletech/sqlboiler/v4/boil"
"github.com/volatiletech/strmangle"
)
// M type is for providing columns and column values to UpdateAll.

7
model/boil_view_names.go Normal file
View file

@ -0,0 +1,7 @@
// Code generated by SQLBoiler 4.14.2 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT.
// This file is meant to be re-generated in place and/or deleted at any time.
package model
var ViewNames = struct {
}{}

View file

@ -1,4 +1,4 @@
// Code generated by SQLBoiler 3.7.1 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT.
// Code generated by SQLBoiler 4.14.2 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT.
// This file is meant to be re-generated in place and/or deleted at any time.
package model
@ -7,8 +7,8 @@ import (
"fmt"
"strings"
"github.com/volatiletech/sqlboiler/drivers"
"github.com/volatiletech/sqlboiler/strmangle"
"github.com/volatiletech/sqlboiler/v4/drivers"
"github.com/volatiletech/strmangle"
)
// buildUpsertQueryMySQL builds a SQL statement string using the upsertData provided.

View file

@ -1,4 +1,4 @@
// Code generated by SQLBoiler 3.7.1 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT.
// Code generated by SQLBoiler 4.14.2 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT.
// This file is meant to be re-generated in place and/or deleted at any time.
package model
@ -13,12 +13,12 @@ import (
"time"
"github.com/friendsofgo/errors"
"github.com/volatiletech/null"
"github.com/volatiletech/sqlboiler/boil"
"github.com/volatiletech/sqlboiler/queries"
"github.com/volatiletech/sqlboiler/queries/qm"
"github.com/volatiletech/sqlboiler/queries/qmhelper"
"github.com/volatiletech/sqlboiler/strmangle"
"github.com/volatiletech/null/v8"
"github.com/volatiletech/sqlboiler/v4/boil"
"github.com/volatiletech/sqlboiler/v4/queries"
"github.com/volatiletech/sqlboiler/v4/queries/qm"
"github.com/volatiletech/sqlboiler/v4/queries/qmhelper"
"github.com/volatiletech/strmangle"
)
// Thumbnail is an object representing the database table.
@ -53,6 +53,24 @@ var ThumbnailColumns = struct {
UpdatedAt: "updated_at",
}
var ThumbnailTableColumns = struct {
ID string
Name string
CompressedName string
CompressedMimeType string
Compressed string
CreatedAt string
UpdatedAt string
}{
ID: "thumbnail.id",
Name: "thumbnail.name",
CompressedName: "thumbnail.compressed_name",
CompressedMimeType: "thumbnail.compressed_mime_type",
Compressed: "thumbnail.compressed",
CreatedAt: "thumbnail.created_at",
UpdatedAt: "thumbnail.updated_at",
}
// Generated where
type whereHelperuint64 struct{ field string }
@ -70,6 +88,13 @@ func (w whereHelperuint64) IN(slice []uint64) qm.QueryMod {
}
return qm.WhereIn(fmt.Sprintf("%s IN ?", w.field), values...)
}
func (w whereHelperuint64) NIN(slice []uint64) qm.QueryMod {
values := make([]interface{}, 0, len(slice))
for _, value := range slice {
values = append(values, value)
}
return qm.WhereNotIn(fmt.Sprintf("%s NOT IN ?", w.field), values...)
}
type whereHelperstring struct{ field string }
@ -86,6 +111,13 @@ func (w whereHelperstring) IN(slice []string) qm.QueryMod {
}
return qm.WhereIn(fmt.Sprintf("%s IN ?", w.field), values...)
}
func (w whereHelperstring) NIN(slice []string) qm.QueryMod {
values := make([]interface{}, 0, len(slice))
for _, value := range slice {
values = append(values, value)
}
return qm.WhereNotIn(fmt.Sprintf("%s NOT IN ?", w.field), values...)
}
type whereHelpernull_String struct{ field string }
@ -95,8 +127,6 @@ func (w whereHelpernull_String) EQ(x null.String) qm.QueryMod {
func (w whereHelpernull_String) NEQ(x null.String) qm.QueryMod {
return qmhelper.WhereNullEQ(w.field, true, x)
}
func (w whereHelpernull_String) IsNull() qm.QueryMod { return qmhelper.WhereIsNull(w.field) }
func (w whereHelpernull_String) IsNotNull() qm.QueryMod { return qmhelper.WhereIsNotNull(w.field) }
func (w whereHelpernull_String) LT(x null.String) qm.QueryMod {
return qmhelper.Where(w.field, qmhelper.LT, x)
}
@ -109,6 +139,23 @@ func (w whereHelpernull_String) GT(x null.String) qm.QueryMod {
func (w whereHelpernull_String) GTE(x null.String) qm.QueryMod {
return qmhelper.Where(w.field, qmhelper.GTE, x)
}
func (w whereHelpernull_String) IN(slice []string) qm.QueryMod {
values := make([]interface{}, 0, len(slice))
for _, value := range slice {
values = append(values, value)
}
return qm.WhereIn(fmt.Sprintf("%s IN ?", w.field), values...)
}
func (w whereHelpernull_String) NIN(slice []string) qm.QueryMod {
values := make([]interface{}, 0, len(slice))
for _, value := range slice {
values = append(values, value)
}
return qm.WhereNotIn(fmt.Sprintf("%s NOT IN ?", w.field), values...)
}
func (w whereHelpernull_String) IsNull() qm.QueryMod { return qmhelper.WhereIsNull(w.field) }
func (w whereHelpernull_String) IsNotNull() qm.QueryMod { return qmhelper.WhereIsNotNull(w.field) }
type whereHelperbool struct{ field string }
@ -179,11 +226,12 @@ var (
thumbnailColumnsWithoutDefault = []string{"name", "compressed_name", "compressed_mime_type", "compressed"}
thumbnailColumnsWithDefault = []string{"id", "created_at", "updated_at"}
thumbnailPrimaryKeyColumns = []string{"id"}
thumbnailGeneratedColumns = []string{}
)
type (
// ThumbnailSlice is an alias for a slice of pointers to Thumbnail.
// This should generally be used opposed to []Thumbnail.
// This should almost always be used instead of []Thumbnail.
ThumbnailSlice []*Thumbnail
thumbnailQuery struct {
@ -245,7 +293,7 @@ func (q thumbnailQuery) One(exec boil.Executor) (*Thumbnail, error) {
err := q.Bind(nil, exec, o)
if err != nil {
if errors.Cause(err) == sql.ErrNoRows {
if errors.Is(err, sql.ErrNoRows) {
return nil, sql.ErrNoRows
}
return nil, errors.Wrap(err, "model: failed to execute a one query for thumbnail")
@ -291,7 +339,7 @@ func (q thumbnailQuery) All(exec boil.Executor) (ThumbnailSlice, error) {
return o, nil
}
// CountG returns the count of all Thumbnail records in the query, and panics on error.
// CountG returns the count of all Thumbnail records in the query using the global executor
func (q thumbnailQuery) CountG() (int64, error) {
return q.Count(boil.GetDB())
}
@ -331,7 +379,7 @@ func (q thumbnailQuery) Count(exec boil.Executor) (int64, error) {
return count, nil
}
// ExistsG checks if the row exists in the table, and panics on error.
// ExistsG checks if the row exists in the table using the global executor.
func (q thumbnailQuery) ExistsG() (bool, error) {
return q.Exists(boil.GetDB())
}
@ -375,7 +423,12 @@ func (q thumbnailQuery) Exists(exec boil.Executor) (bool, error) {
// Thumbnails retrieves all the records using an executor.
func Thumbnails(mods ...qm.QueryMod) thumbnailQuery {
mods = append(mods, qm.From("`thumbnail`"))
return thumbnailQuery{NewQuery(mods...)}
q := NewQuery(mods...)
if len(queries.GetSelect(q)) == 0 {
queries.SetSelect(q, []string{"`thumbnail`.*"})
}
return thumbnailQuery{q}
}
// FindThumbnailG retrieves a single record by ID.
@ -420,7 +473,7 @@ func FindThumbnail(exec boil.Executor, iD uint64, selectCols ...string) (*Thumbn
err := q.Bind(nil, exec, thumbnailObj)
if err != nil {
if errors.Cause(err) == sql.ErrNoRows {
if errors.Is(err, sql.ErrNoRows) {
return nil, sql.ErrNoRows
}
return nil, errors.Wrap(err, "model: unable to select from thumbnail")
@ -589,7 +642,6 @@ func (o *Thumbnail) Update(exec boil.Executor, columns boil.Columns) error {
thumbnailAllColumns,
thumbnailPrimaryKeyColumns,
)
if len(wl) == 0 {
return errors.New("model: unable to update thumbnail, could not build whitelist")
}
@ -637,6 +689,14 @@ func (q thumbnailQuery) UpdateAllG(cols M) error {
return q.UpdateAll(boil.GetDB(), cols)
}
// UpdateAllGP updates all rows with the specified column values, and panics on error.
func (q thumbnailQuery) UpdateAllGP(cols M) {
err := q.UpdateAll(boil.GetDB(), cols)
if err != nil {
panic(boil.WrapErr(err))
}
}
// UpdateAll updates all rows with the specified column values.
func (q thumbnailQuery) UpdateAll(exec boil.Executor, cols M) error {
queries.SetUpdate(q.Query, cols)
@ -788,17 +848,18 @@ func (o *Thumbnail) Upsert(exec boil.Executor, updateColumns, insertColumns boil
thumbnailColumnsWithoutDefault,
nzDefaults,
)
update := updateColumns.UpdateColumnSet(
thumbnailAllColumns,
thumbnailPrimaryKeyColumns,
)
if len(update) == 0 {
if !updateColumns.IsNone() && len(update) == 0 {
return errors.New("model: unable to upsert thumbnail, could not build update column list")
}
ret = strmangle.SetComplement(ret, nzUniques)
cache.query = buildUpsertQueryMySQL(dialect, "thumbnail", update, insert)
cache.query = buildUpsertQueryMySQL(dialect, "`thumbnail`", update, insert)
cache.retQuery = fmt.Sprintf(
"SELECT %s FROM `thumbnail` WHERE %s",
strings.Join(strmangle.IdentQuoteSlice(dialect.LQ, dialect.RQ, ret), ","),
@ -925,6 +986,10 @@ func (o *Thumbnail) Delete(exec boil.Executor) error {
return nil
}
func (q thumbnailQuery) DeleteAllG() error {
return q.DeleteAll(boil.GetDB())
}
// DeleteAllP deletes all rows, and panics on error.
func (q thumbnailQuery) DeleteAllP(exec boil.Executor) {
err := q.DeleteAll(exec)
@ -933,6 +998,14 @@ func (q thumbnailQuery) DeleteAllP(exec boil.Executor) {
}
}
// DeleteAllGP deletes all rows, and panics on error.
func (q thumbnailQuery) DeleteAllGP() {
err := q.DeleteAll(boil.GetDB())
if err != nil {
panic(boil.WrapErr(err))
}
}
// DeleteAll deletes all matching rows.
func (q thumbnailQuery) DeleteAll(exec boil.Executor) error {
if q.Query == nil {
@ -1132,3 +1205,8 @@ func ThumbnailExists(exec boil.Executor, iD uint64) (bool, error) {
return exists, nil
}
// Exists checks if the Thumbnail row exists.
func (o *Thumbnail) Exists(exec boil.Executor) (bool, error) {
return ThumbnailExists(exec, o.ID)
}