good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
U
upper
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
open
upper
Commits
f3cfd909
Commit
f3cfd909
authored
Aug 23, 2016
by
José Carlos Nieto
Browse files
Options
Downloads
Patches
Plain Diff
Fix sqlbuilder's One().
parent
3c6c2d29
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
internal/sqladapter/testing/adapter.go.tpl
+8
-0
8 additions, 0 deletions
internal/sqladapter/testing/adapter.go.tpl
lib/sqlbuilder/select.go
+1
-1
1 addition, 1 deletion
lib/sqlbuilder/select.go
with
9 additions
and
1 deletion
internal/sqladapter/testing/adapter.go.tpl
+
8
−
0
View file @
f3cfd909
...
@@ -1099,6 +1099,14 @@ func TestBuilder(t *testing.T) {
...
@@ -1099,6 +1099,14 @@ func TestBuilder(t *testing.T) {
assert.NoError
(
t
,
err
)
assert.NoError
(
t
,
err
)
assert.NotZero
(
t
,
all
)
assert.NotZero
(
t
,
all
)
//
Using
explicit
iterator
to
fetch
one
item.
var
item
map
[
string
]
interface
{}
iter =
sess.SelectFrom("artist").Iterator()
err =
iter.One(&item)
assert.NoError
(
t
,
err
)
assert.NotZero
(
t
,
item
)
//
Using
explicit
iterator
and
NextScan.
//
Using
explicit
iterator
and
NextScan.
iter =
sess.SelectFrom("artist").Iterator()
iter =
sess.SelectFrom("artist").Iterator()
var
id
int
var
id
int
...
...
This diff is collapsed.
Click to expand it.
lib/sqlbuilder/select.go
+
1
−
1
View file @
f3cfd909
...
@@ -234,5 +234,5 @@ func (qs *selector) All(destSlice interface{}) error {
...
@@ -234,5 +234,5 @@ func (qs *selector) All(destSlice interface{}) error {
}
}
func
(
qs
*
selector
)
One
(
dest
interface
{})
error
{
func
(
qs
*
selector
)
One
(
dest
interface
{})
error
{
return
qs
.
Iterator
()
.
All
(
dest
)
return
qs
.
Iterator
()
.
One
(
dest
)
}
}
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