mirror of
https://github.com/logos-messaging/nim-chat-sdk.git
synced 2026-05-20 08:59:32 +00:00
chore: use defer for db close
This commit is contained in:
parent
3fe8fb2a03
commit
a0bdb421ff
@ -3,10 +3,10 @@ import chat_sdk/migration
|
|||||||
|
|
||||||
proc main() =
|
proc main() =
|
||||||
let db = open("test.db", "", "", "")
|
let db = open("test.db", "", "", "")
|
||||||
try:
|
defer:
|
||||||
runMigrations(db)
|
|
||||||
finally:
|
|
||||||
db.close()
|
db.close()
|
||||||
|
|
||||||
|
runMigrations(db)
|
||||||
|
|
||||||
when isMainModule:
|
when isMainModule:
|
||||||
main()
|
main()
|
||||||
Loading…
x
Reference in New Issue
Block a user