Documentation ¶
Index ¶
- Variables
- func AddTodoHook(hookPoint boil.HookPoint, todoHook TodoHook)
- func AddUserHook(hookPoint boil.HookPoint, userHook UserHook)
- func NewQuery(mods ...qm.QueryMod) *queries.Query
- func TodoExists(ctx context.Context, exec boil.ContextExecutor, iD uuid.UUID) (bool, error)
- func Todos(mods ...qm.QueryMod) todoQuery
- func UserExists(ctx context.Context, exec boil.ContextExecutor, iD uuid.UUID) (bool, error)
- func Users(mods ...qm.QueryMod) userQuery
- type M
- type Todo
- func (o *Todo) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error)
- func (o *Todo) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error)
- func (o *Todo) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error
- func (o *Todo) Reload(ctx context.Context, exec boil.ContextExecutor) error
- func (o *Todo) SetUser(ctx context.Context, exec boil.ContextExecutor, insert bool, related *User) error
- func (o *Todo) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)
- func (o *Todo) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, ...) error
- func (o *Todo) User(mods ...qm.QueryMod) userQuery
- type TodoHook
- type TodoSlice
- type UpsertOptionFunc
- type UpsertOptions
- type User
- func (o *User) AddTodos(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Todo) error
- func (o *User) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error)
- func (o *User) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error)
- func (o *User) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error
- func (o *User) Reload(ctx context.Context, exec boil.ContextExecutor) error
- func (o *User) Todos(mods ...qm.QueryMod) todoQuery
- func (o *User) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)
- func (o *User) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, ...) error
- type UserHook
- type UserSlice
Constants ¶
This section is empty.
Variables ¶
var ErrSyncFail = errors.New("sqlb: failed to synchronize data after insert")
ErrSyncFail occurs during insert when the record could not be retrieved in order to populate default value information. This usually happens when LastInsertId fails or there was a primary key configuration that was not resolvable.
var TableNames = struct { Todos string Users string }{ Todos: "todos", Users: "users", }
var TodoColumns = struct { ID string CreatedAt string UpdatedAt string Title string Completed string UserID string }{ ID: "id", CreatedAt: "created_at", UpdatedAt: "updated_at", Title: "title", Completed: "completed", UserID: "user_id", }
var TodoRels = struct { User string }{ User: "User", }
TodoRels is where relationship names are stored.
var TodoTableColumns = struct { ID string CreatedAt string UpdatedAt string Title string Completed string UserID string }{ ID: "todos.id", CreatedAt: "todos.created_at", UpdatedAt: "todos.updated_at", Title: "todos.title", Completed: "todos.completed", UserID: "todos.user_id", }
var TodoWhere = struct { ID whereHelperuuid_UUID CreatedAt whereHelpertime_Time UpdatedAt whereHelpertime_Time Title whereHelperstring Completed whereHelperbool UserID whereHelperuuid_UUID }{ ID: whereHelperuuid_UUID{/* contains filtered or unexported fields */}, CreatedAt: whereHelpertime_Time{/* contains filtered or unexported fields */}, UpdatedAt: whereHelpertime_Time{/* contains filtered or unexported fields */}, Title: whereHelperstring{/* contains filtered or unexported fields */}, Completed: whereHelperbool{/* contains filtered or unexported fields */}, UserID: whereHelperuuid_UUID{/* contains filtered or unexported fields */}, }
var UserColumns = struct { ID string Name string CreatedAt string UpdatedAt string }{ ID: "id", Name: "name", CreatedAt: "created_at", UpdatedAt: "updated_at", }
var UserRels = struct { Todos string }{ Todos: "Todos", }
UserRels is where relationship names are stored.
var UserTableColumns = struct { ID string Name string CreatedAt string UpdatedAt string }{ ID: "users.id", Name: "users.name", CreatedAt: "users.created_at", UpdatedAt: "users.updated_at", }
var UserWhere = struct { ID whereHelperuuid_UUID Name whereHelperstring CreatedAt whereHelpertime_Time UpdatedAt whereHelpertime_Time }{ ID: whereHelperuuid_UUID{/* contains filtered or unexported fields */}, Name: whereHelperstring{/* contains filtered or unexported fields */}, CreatedAt: whereHelpertime_Time{/* contains filtered or unexported fields */}, UpdatedAt: whereHelpertime_Time{/* contains filtered or unexported fields */}, }
var ViewNames = struct {
}{}
Functions ¶
func AddTodoHook ¶
AddTodoHook registers your hook function for all future operations.
func AddUserHook ¶
AddUserHook registers your hook function for all future operations.
func TodoExists ¶
TodoExists checks if the Todo row exists.
func UserExists ¶
UserExists checks if the User row exists.
Types ¶
type M ¶
type M map[string]interface{}
M type is for providing columns and column values to UpdateAll.
type Todo ¶
type Todo struct { ID uuid.UUID `boil:"id" json:"id" toml:"id" yaml:"id"` CreatedAt time.Time `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"` UpdatedAt time.Time `boil:"updated_at" json:"updated_at" toml:"updated_at" yaml:"updated_at"` Title string `boil:"title" json:"title" toml:"title" yaml:"title"` Completed bool `boil:"completed" json:"completed" toml:"completed" yaml:"completed"` UserID uuid.UUID `boil:"user_id" json:"user_id" toml:"user_id" yaml:"user_id"` R *todoR `boil:"-" json:"-" toml:"-" yaml:"-"` L todoL `boil:"-" json:"-" toml:"-" yaml:"-"` }
Todo is an object representing the database table.
func FindTodo ¶
func FindTodo(ctx context.Context, exec boil.ContextExecutor, iD uuid.UUID, selectCols ...string) (*Todo, error)
FindTodo retrieves a single record by ID with an executor. If selectCols is empty Find will return all columns.
func (*Todo) Delete ¶
Delete deletes a single Todo record with an executor. Delete will match against the primary key column to find the record to delete.
func (*Todo) Insert ¶
Insert a single record using an executor. See boil.Columns.InsertColumnSet documentation to understand column list inference for inserts.
func (*Todo) Reload ¶
Reload refetches the object from the database using the primary keys with an executor.
func (*Todo) SetUser ¶
func (o *Todo) SetUser(ctx context.Context, exec boil.ContextExecutor, insert bool, related *User) error
SetUser of the todo to the related item. Sets o.R.User to related. Adds o to related.R.Todos.
func (*Todo) Update ¶
func (o *Todo) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)
Update uses an executor to update the Todo. See boil.Columns.UpdateColumnSet documentation to understand column list inference for updates. Update does not automatically update the record in case of default values. Use .Reload() to refresh the records.
func (*Todo) Upsert ¶
func (o *Todo) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, conflictColumns []string, updateColumns, insertColumns boil.Columns, opts ...UpsertOptionFunc) error
Upsert attempts an insert using an executor, and does an update or ignore on conflict. See boil.Columns documentation for how to properly use updateColumns and insertColumns.
type TodoSlice ¶
type TodoSlice []*Todo
TodoSlice is an alias for a slice of pointers to Todo. This should almost always be used instead of []Todo.
type UpsertOptionFunc ¶
type UpsertOptionFunc func(o *UpsertOptions)
func UpsertConflictTarget ¶
func UpsertConflictTarget(conflictTarget string) UpsertOptionFunc
func UpsertUpdateSet ¶
func UpsertUpdateSet(updateSet string) UpsertOptionFunc
type UpsertOptions ¶
type UpsertOptions struct {
// contains filtered or unexported fields
}
type User ¶
type User struct { ID uuid.UUID `boil:"id" json:"id" toml:"id" yaml:"id"` Name string `boil:"name" json:"name" toml:"name" yaml:"name"` CreatedAt time.Time `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"` UpdatedAt time.Time `boil:"updated_at" json:"updated_at" toml:"updated_at" yaml:"updated_at"` R *userR `boil:"-" json:"-" toml:"-" yaml:"-"` L userL `boil:"-" json:"-" toml:"-" yaml:"-"` }
User is an object representing the database table.
func FindUser ¶
func FindUser(ctx context.Context, exec boil.ContextExecutor, iD uuid.UUID, selectCols ...string) (*User, error)
FindUser retrieves a single record by ID with an executor. If selectCols is empty Find will return all columns.
func (*User) AddTodos ¶
func (o *User) AddTodos(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Todo) error
AddTodos adds the given related objects to the existing relationships of the user, optionally inserting them as new records. Appends related to o.R.Todos. Sets related.R.User appropriately.
func (*User) Delete ¶
Delete deletes a single User record with an executor. Delete will match against the primary key column to find the record to delete.
func (*User) Insert ¶
Insert a single record using an executor. See boil.Columns.InsertColumnSet documentation to understand column list inference for inserts.
func (*User) Reload ¶
Reload refetches the object from the database using the primary keys with an executor.
func (*User) Update ¶
func (o *User) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)
Update uses an executor to update the User. See boil.Columns.UpdateColumnSet documentation to understand column list inference for updates. Update does not automatically update the record in case of default values. Use .Reload() to refresh the records.
func (*User) Upsert ¶
func (o *User) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, conflictColumns []string, updateColumns, insertColumns boil.Columns, opts ...UpsertOptionFunc) error
Upsert attempts an insert using an executor, and does an update or ignore on conflict. See boil.Columns documentation for how to properly use updateColumns and insertColumns.
type UserSlice ¶
type UserSlice []*User
UserSlice is an alias for a slice of pointers to User. This should almost always be used instead of []User.