From 69f8dc2c6f4bfd9970c793da43934d2ff56633d2 Mon Sep 17 00:00:00 2001 From: Philip Wernersbach Date: Fri, 2 Jun 2017 17:45:11 -0400 Subject: [PATCH] Add qsqldatabase.getQSqlDatabase, which is bound to QSqlDatabase::database. --- qt5_qtsql.nimble | 2 +- qt5_qtsql/src/qsqldatabase.nim | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/qt5_qtsql.nimble b/qt5_qtsql.nimble index 5424862..6c8730a 100644 --- a/qt5_qtsql.nimble +++ b/qt5_qtsql.nimble @@ -1,6 +1,6 @@ [Package] name = "qt5_qtsql" -version = "1.0.1" +version = "1.0.2" author = "Philip Wernersbach " description = "Binding for Qt 5's Qt SQL library. Provides a single API for multiple database engines." license = "MIT" diff --git a/qt5_qtsql/src/qsqldatabase.nim b/qt5_qtsql/src/qsqldatabase.nim index 2309b9c..d798ba7 100644 --- a/qt5_qtsql/src/qsqldatabase.nim +++ b/qt5_qtsql/src/qsqldatabase.nim @@ -76,6 +76,8 @@ template newQSqlDatabase*(typ: cstring, connectionName: cstring): expr = # self.up.cppDelete() # self.up = nil +proc getQSqlDatabase*(connectionName: cstring, open = true): QSqlDatabaseObj {.header: QSQLDATABASE_H, importcpp: "QSqlDatabase::database(@)".} + proc internalOpen(self: QSqlDatabaseObj): bool {.header: QSQLDATABASE_H, importcpp: "open".} proc internalOpen(self: QSqlDatabaseObj, user: cstring, password: cstring): bool {.header: QSQLDATABASE_H, importcpp: "open".} proc lastError*(self: QSqlDatabaseObj): QSqlErrorObj {.header: QSQLDATABASE_H, importcpp: "lastError".}