Skip to content

Commit

Permalink
Add new methods to Orm
Browse files Browse the repository at this point in the history
  • Loading branch information
hwbrzzl committed Apr 8, 2023
1 parent 152557a commit 375552c
Show file tree
Hide file tree
Showing 3 changed files with 327 additions and 87 deletions.
3 changes: 3 additions & 0 deletions contracts/database/orm/orm.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ type Query interface {
Distinct(args ...any) Query
Exec(sql string, values ...any) (*Result, error)
Find(dest any, conds ...any) error
FindOrFail(dest any, conds ...any) error
First(dest any) error
FirstOrCreate(dest any, conds ...any) error
FirstOr(dest any, callback func() error) error
Expand All @@ -54,6 +55,7 @@ type Query interface {
Pluck(column string, dest any) error
Raw(sql string, values ...any) Query
Save(value any) error
SaveQuietly(value any) error
Scan(dest any) error
Scopes(funcs ...func(Query) Query) Query
Select(query any, args ...any) Query
Expand All @@ -62,6 +64,7 @@ type Query interface {
Updates(values any) (*Result, error)
UpdateOrCreate(dest any, attributes any, values any) error
Where(query any, args ...any) Query
WithoutEvents() Query
WithTrashed() Query
With(query string, args ...any) Query
}
Expand Down
Loading

0 comments on commit 375552c

Please sign in to comment.