Skip to content

Commit

Permalink
fix db value return type
Browse files Browse the repository at this point in the history
  • Loading branch information
ubaldus committed Apr 1, 2024
1 parent 83843b0 commit 2e38fb9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
5 changes: 3 additions & 2 deletions db/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@ func mysqlRun(query string, args ...interface{}) (TypeRun, error) {

// mysqlValue executes a SQL query on the MySQL database and returns a single result as a string.
func mysqlValue(query string, args ...interface{}) (result string, err error) {
var res interface{}
row := DbHandler.QueryRow(query, args...)
err = row.Scan(&result)
err = row.Scan(&res)
if err != nil {
return
}
return
return String(res), nil
}

// mysqlRow executes a SQL query on the MySQL database and returns a single row of results as a TypeRow.
Expand Down
5 changes: 3 additions & 2 deletions db/sqlite3.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,12 @@ func sqliteRun(query string, args ...interface{}) (TypeRun, error) {

// sqliteValue executes a SQL query with optional arguments and returns a single string result.
func sqliteValue(query string, args ...interface{}) (result string, err error) {
err = DbHandler.QueryRow(query, args...).Scan(&result)
var res interface{}
err = DbHandler.QueryRow(query, args...).Scan(&res)
if err != nil {
return
}
return
return String(res), nil
}

// sqliteRow executes a SQL query with optional arguments and returns a single row of results.
Expand Down
2 changes: 1 addition & 1 deletion sys/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
package sys

const Name = "Tibula"
const Version = "17.3.7"
const Version = "17.4.1"

var Options TypeConfig
var Commands TypeCommand

0 comments on commit 2e38fb9

Please sign in to comment.