Skip to content

Commit

Permalink
Merge pull request #127 from burner/row_columnExists
Browse files Browse the repository at this point in the history
columnExists for Row struct
  • Loading branch information
denizzzka authored Dec 2, 2018
2 parents 439d148 + 2d72cfb commit 8d35925
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/dpq2/result.d
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,12 @@ immutable struct Row
return PQgetisnull(answer.result, to!int(row), to!int(col)) != 0;
}

/// Checks if column with name exists
bool columnExists(in string column)
{
return answer.columnExists(column);
}

/// Returns cell value by column number
immutable (Value) opIndex(in size_t col)
{
Expand Down Expand Up @@ -739,6 +745,7 @@ void _integration_test( string connParam )
assert( r.OID(3) == OidType.Int4Array );
assert( r.isSupportedArray(3) );
assert( !r.isSupportedArray(2) );
assert( r[0].columnExists("test_array") );
auto v = r[0]["test_array"];
assert( v.isSupportedArray );
assert( !r[0][2].isSupportedArray );
Expand Down

0 comments on commit 8d35925

Please sign in to comment.