From 8ce203abe04b7a100948aef32a15c2eb7ebaef0a Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Wed, 24 Feb 2010 01:04:39 +0100 Subject: [PATCH] SQLite wrapper --- src/db_postgres.nim | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/db_postgres.nim b/src/db_postgres.nim index 3296e688a7..131609a648 100644 --- a/src/db_postgres.nim +++ b/src/db_postgres.nim @@ -59,15 +59,15 @@ proc dbFormat(formatstr: TSqlQuery, args: openarray[string]): string = else: add(result, c) -proc TryQuery*(db: TDbConn, query: TSqlQuery, - args: openarray[string]): bool = +proc TryExec*(db: TDbConn, query: TSqlQuery, + args: openarray[string]): bool = ## tries to execute the query and returns true if successful, false otherwise. var q = dbFormat(query, args) var res = PQExec(db, q) result = PQresultStatus(res) == PGRES_COMMAND_OK PQclear(res) -proc Query*(db: TDbConn, query: TSqlQuery, args: openarray[string]) = +proc Exec*(db: TDbConn, query: TSqlQuery, args: openarray[string]) = ## executes the query and raises EDB if not successful. var q = dbFormat(query, args) var res = PQExec(db, q) @@ -143,8 +143,8 @@ proc InsertID*(db: TDbConn, query: TSqlQuery, result = TryInsertID(db, query, args) if result < 0: dbError(db) -proc QueryAffectedRows*(db: TDbConn, query: TSqlQuery, - args: openArray[string]): int64 = +proc ExecAffectedRows*(db: TDbConn, query: TSqlQuery, + args: openArray[string]): int64 = ## executes the query (typically "UPDATE") and returns the ## number of affected rows. var q = dbFormat(query, args)