-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(orm)!: tweak API to allow pagination in generated code (#11079)
* WIP on fixing issues and expanding tests with codegen * fixes * fix tests * feat(orm)!: pagination codegen and API cleanup * WIP on refactoring list/paginate * fixes * fixes * tests pass * codegen * codegen * Update orm/model/ormtable/index.go Co-authored-by: Marko <[email protected]> * codegen * Update orm/model/ormtable/filter.go Co-authored-by: Tyler <[email protected]> * revert Co-authored-by: Marko <[email protected]> Co-authored-by: Tyler <[email protected]>
- Loading branch information
1 parent
894969b
commit 5126ec3
Showing
20 changed files
with
483 additions
and
470 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package ormtable | ||
|
||
import "google.golang.org/protobuf/proto" | ||
|
||
type filterIterator struct { | ||
Iterator | ||
filter func(proto.Message) bool | ||
msg proto.Message | ||
} | ||
|
||
func (f *filterIterator) Next() bool { | ||
for f.Iterator.Next() { | ||
msg, err := f.Iterator.GetMessage() | ||
if err != nil { | ||
return false | ||
} | ||
|
||
if f.filter(msg) { | ||
f.msg = msg | ||
return true | ||
} | ||
} | ||
return false | ||
} | ||
|
||
func (f filterIterator) GetMessage() (proto.Message, error) { | ||
return f.msg, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.