Skip to content

Commit

Permalink
close query after create table
Browse files Browse the repository at this point in the history
  • Loading branch information
kstan79 committed Feb 28, 2023
1 parent d760edf commit 750168e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,11 +206,11 @@ func GenerateTables(dbsetting Model_DBSetting) (tables []string) {
// sqlcreate = sqlcreate + ", PRIMARY KEY (" + primarykey + ")) ENGINE=InnoDB"
sqlcreate = sqlcreate + ") ENGINE=InnoDB"
logrus.Info("Created table ", tablename)
_, errcreate := localdb.Exec(sqlcreate)
res, errcreate := localdb.Query(sqlcreate)
if errcreate != nil {
logrus.Fatal(errcreate)
}

res.Close()
} else {
logrus.Fatal(err2)
}
Expand Down

0 comments on commit 750168e

Please sign in to comment.