Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
beego
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
beego
Commits
3e2ffa54
Commit
3e2ffa54
authored
Mar 24, 2016
by
miraclesu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
orm: fix postgres returning id error
parent
eaf38bb0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
db_postgres.go
orm/db_postgres.go
+9
-7
No files found.
orm/db_postgres.go
View file @
3e2ffa54
...
...
@@ -123,14 +123,16 @@ func (d *dbBasePostgres) ReplaceMarks(query *string) {
}
// make returning sql support for postgresql.
func
(
d
*
dbBasePostgres
)
HasReturningID
(
mi
*
modelInfo
,
query
*
string
)
(
has
bool
)
{
if
mi
.
fields
.
pk
.
auto
{
if
query
!=
nil
{
*
query
=
fmt
.
Sprintf
(
`%s RETURNING "%s"`
,
*
query
,
mi
.
fields
.
pk
.
column
)
}
has
=
true
func
(
d
*
dbBasePostgres
)
HasReturningID
(
mi
*
modelInfo
,
query
*
string
)
bool
{
fi
:=
mi
.
fields
.
pk
if
fi
.
fieldType
&
IsPositiveIntegerField
==
0
&&
fi
.
fieldType
&
IsIntegerField
==
0
{
return
false
}
if
query
!=
nil
{
*
query
=
fmt
.
Sprintf
(
`%s RETURNING "%s"`
,
*
query
,
fi
.
column
)
}
return
return
true
}
// show table sql for postgresql.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment