good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
4
4byte
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open
4byte
Commits
0301567f
Commit
0301567f
authored
Jun 29, 2023
by
Garet Halliday
Browse files
Options
Downloads
Patches
Plain Diff
fix
parent
40a61db1
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#30334
passed
Nov 2, 2023
Stage: build
Stage: test
Stage: deploy
Changes
1
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
common/store/stores/upper/store.go
+6
-2
6 additions, 2 deletions
common/store/stores/upper/store.go
with
6 additions
and
2 deletions
common/store/stores/upper/store.go
+
6
−
2
View file @
0301567f
...
...
@@ -89,7 +89,7 @@ func (T *Store) GetByID(ctx context.Context, id int) (*sig.Entry, error) {
}
func
(
T
*
Store
)
Search
(
ctx
context
.
Context
,
page
int
,
pageSize
int
,
ordering
store
.
Ordering
,
condition
store
.
SearchCondition
)
(
results
[]
*
sig
.
Entry
,
count
int
,
err
error
)
{
q
:=
T
.
db
.
SQL
()
q
:=
T
.
db
.
WithContext
(
ctx
)
.
SQL
()
sel
:=
q
.
Select
(
"*"
,
db
.
Raw
(
`count(*) OVER() AS "count"`
))
.
From
(
`4byte.entry`
)
// by default we do exact signature comparison
...
...
@@ -118,11 +118,13 @@ func (T *Store) Search(ctx context.Context, page int, pageSize int, ordering sto
op
=
"LIKE"
right
=
`'%' || ? || '%'`
condition
.
CaseSensitive
=
false
arg
=
strings
.
TrimPrefix
(
arg
,
"0x"
)
case
store
.
SearchConditionEventHashContains
:
left
=
"encode(event_hash, 'hex')"
op
=
"LIKE"
right
=
`'%' || ? || '%'`
condition
.
CaseSensitive
=
false
arg
=
strings
.
TrimPrefix
(
arg
,
"0x"
)
}
if
!
condition
.
CaseSensitive
{
...
...
@@ -130,7 +132,9 @@ func (T *Store) Search(ctx context.Context, page int, pageSize int, ordering sto
right
=
strings
.
ReplaceAll
(
right
,
"?"
,
"LOWER(?)"
)
}
if
condition
.
Type
!=
store
.
SearchConditionNone
{
sel
=
sel
.
Where
(
comparator
(),
arg
)
}
switch
ordering
{
case
store
.
OrderingCreatedAtAsc
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment