Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
U
ulfssar-go
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Faizal Aziz
ulfssar-go
Commits
7ba12b34
Commit
7ba12b34
authored
Jan 05, 2024
by
Faizal Aziz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixing query
parent
b70fbfb9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
postgresql.go
dbcon/postgresql.go
+3
-3
No files found.
dbcon/postgresql.go
View file @
7ba12b34
...
...
@@ -319,7 +319,7 @@ func NewPostgreSql(option *PostgreSqlOption) (ORM, error) {
func
generateSQLFromStorage
(
tableName
string
,
columnAndValues
interface
{})
string
{
st
:=
reflect
.
TypeOf
(
columnAndValues
)
var
columnNames
string
s
.
Builder
var
columnNames
string
for
i
:=
0
;
i
<
st
.
NumField
();
i
++
{
field
:=
st
.
Field
(
i
)
...
...
@@ -347,10 +347,10 @@ func generateSQLFromStorage(tableName string, columnAndValues interface{}) strin
}
}
columnNames
.
WriteString
(
fmt
.
Sprintf
(
"%s %s %s %s ,"
,
columnNames
,
typeName
,
argName
,
keysName
)
)
columnNames
+=
fmt
.
Sprintf
(
"%s %s %s %s ,"
,
columnNames
,
typeName
,
argName
,
keysName
)
}
columnNamesStr
:=
strings
.
TrimRight
(
columnNames
.
String
()
,
","
)
columnNamesStr
:=
strings
.
TrimRight
(
columnNames
,
","
)
return
fmt
.
Sprintf
(
"CREATE TABLE %s '(%s)'"
,
tableName
,
columnNamesStr
)
}
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