changed formating
This commit is contained in:
parent
cd03f59432
commit
994f7c1f0b
1 changed files with 3 additions and 4 deletions
|
|
@ -220,13 +220,12 @@ proc open*(connection, user, password, database: string): TDbConn {.
|
||||||
if result == nil: dbError("could not open database connection")
|
if result == nil: dbError("could not open database connection")
|
||||||
let
|
let
|
||||||
colonPos = connection.find(':')
|
colonPos = connection.find(':')
|
||||||
host = if colonPos < 0: connection
|
host = if colonPos < 0: connection
|
||||||
else: substr(connection, 0, colonPos-1)
|
else: substr(connection, 0, colonPos-1)
|
||||||
port: int32 = if colonPos < 0: 0'i32
|
port: int32 = if colonPos < 0: 0'i32
|
||||||
else: substr(connection, colonPos+1).parseInt.int32
|
else: substr(connection, colonPos+1).parseInt.int32
|
||||||
if mysql.realConnect(result, host, user, password, database,
|
if mysql.realConnect(result, host, user, password, database,
|
||||||
port, nil, 0) == nil:
|
port, nil, 0) == nil:
|
||||||
var errmsg = $mysql.error(result)
|
var errmsg = $mysql.error(result)
|
||||||
db_mysql.close(result)
|
db_mysql.close(result)
|
||||||
dbError(errmsg)
|
dbError(errmsg)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue