@@ -432,7 +432,7 @@ version(USE_PGSQL) {
432
432
433
433
public :
434
434
void checkClosed () {
435
- enforceEx ! SQLException(! closed, " Statement is already closed" );
435
+ enforce ! SQLException(! closed, " Statement is already closed" );
436
436
}
437
437
438
438
void lock () {
@@ -589,9 +589,9 @@ version(USE_PGSQL) {
589
589
scope (exit) unlock ();
590
590
591
591
PGresult * res = PQexec(conn.getConnection(), std.string.toStringz (query));
592
- enforceEx ! SQLException(res ! is null , " Failed to execute statement " ~ query);
592
+ enforce ! SQLException(res ! is null , " Failed to execute statement " ~ query);
593
593
auto status = PQresultStatus(res);
594
- enforceEx ! SQLException(status == PGRES_TUPLES_OK , getError());
594
+ enforce ! SQLException(status == PGRES_TUPLES_OK , getError());
595
595
scope (exit) PQclear (res);
596
596
597
597
// cmd = new Command(conn.getConnection(), query);
@@ -631,9 +631,9 @@ version(USE_PGSQL) {
631
631
lock();
632
632
scope (exit) unlock ();
633
633
PGresult * res = PQexec(conn.getConnection(), std.string.toStringz (query));
634
- enforceEx ! SQLException(res ! is null , " Failed to execute statement " ~ query);
634
+ enforce ! SQLException(res ! is null , " Failed to execute statement " ~ query);
635
635
auto status = PQresultStatus(res);
636
- enforceEx ! SQLException(status == PGRES_COMMAND_OK || status == PGRES_TUPLES_OK , getError());
636
+ enforce ! SQLException(status == PGRES_COMMAND_OK || status == PGRES_TUPLES_OK , getError());
637
637
scope (exit) PQclear (res);
638
638
639
639
string rowsAffected = copyCString(PQcmdTuples(res));
@@ -741,7 +741,7 @@ version(USE_PGSQL) {
741
741
}
742
742
void checkParams () {
743
743
foreach (i, b; paramIsSet)
744
- enforceEx ! SQLException(b, " Parameter " ~ to! string (i) ~ " is not set" );
744
+ enforce ! SQLException(b, " Parameter " ~ to! string (i) ~ " is not set" );
745
745
}
746
746
void setParam (int index, string value) {
747
747
checkIndex(index);
@@ -776,7 +776,7 @@ version(USE_PGSQL) {
776
776
cast (const int * )lengths.ptr,
777
777
cast (const int * )formats.ptr,
778
778
0 );
779
- enforceEx ! SQLException(res ! is null , " Error while executing prepared statement " ~ query);
779
+ enforce ! SQLException(res ! is null , " Error while executing prepared statement " ~ query);
780
780
metadata = createMetadata(res);
781
781
return res;
782
782
}
@@ -821,7 +821,7 @@ version(USE_PGSQL) {
821
821
PGresult * res = exec();
822
822
scope (exit) PQclear (res);
823
823
auto status = PQresultStatus(res);
824
- enforceEx ! SQLException(status == PGRES_COMMAND_OK || status == PGRES_TUPLES_OK , getError(res));
824
+ enforce ! SQLException(status == PGRES_COMMAND_OK || status == PGRES_TUPLES_OK , getError(res));
825
825
826
826
string rowsAffected = copyCString(PQcmdTuples(res));
827
827
// auto lastid = PQoidValue(res);
@@ -998,8 +998,8 @@ version(USE_PGSQL) {
998
998
999
999
Variant getValue (int columnIndex) {
1000
1000
checkClosed();
1001
- enforceEx ! SQLException(columnIndex >= 1 && columnIndex <= columnCount, " Column index out of bounds: " ~ to! string (columnIndex));
1002
- enforceEx ! SQLException(currentRowIndex >= 0 && currentRowIndex < rowCount, " No current row in result set" );
1001
+ enforce ! SQLException(columnIndex >= 1 && columnIndex <= columnCount, " Column index out of bounds: " ~ to! string (columnIndex));
1002
+ enforce ! SQLException(currentRowIndex >= 0 && currentRowIndex < rowCount, " No current row in result set" );
1003
1003
Variant res = data[currentRowIndex][columnIndex - 1 ];
1004
1004
lastIsNull = (res == null );
1005
1005
return res;
@@ -1327,8 +1327,8 @@ version(USE_PGSQL) {
1327
1327
checkClosed();
1328
1328
lock();
1329
1329
scope (exit) unlock ();
1330
- enforceEx ! SQLException(columnIndex >= 1 && columnIndex <= columnCount, " Column index out of bounds: " ~ to! string (columnIndex));
1331
- enforceEx ! SQLException(currentRowIndex >= 0 && currentRowIndex < rowCount, " No current row in result set" );
1330
+ enforce ! SQLException(columnIndex >= 1 && columnIndex <= columnCount, " Column index out of bounds: " ~ to! string (columnIndex));
1331
+ enforce ! SQLException(currentRowIndex >= 0 && currentRowIndex < rowCount, " No current row in result set" );
1332
1332
return data[currentRowIndex][columnIndex - 1 ] == null ;
1333
1333
}
1334
1334
0 commit comments