extern class `{PGresult *`}
# Frees the memory block associated with the result
fun clear `{PQclear(self); `}
# Returns the number of rows in the query result
fun ntuples:Int `{ return PQntuples(self); `}
# Returns the number of columns in each row of the query result
fun nfields:Int `{return PQnfields(self); `}
# Returns the ExecStatusType of a result
fun status: ExecStatusType `{ return PQresultStatus(self); `}
# Returns the field name of a given column_number
fun fname(column_number:Int):String import CString.to_s `{
return CString_to_s( PQfname(self, column_number));
`}
# Returns the column number associated with the column name
fun fnumber(column_name:String):Int import String.to_cstring `{
return PQfnumber(self, String_to_cstring(column_name));
`}
# Returns a single field value of one row of the result at row_number, column_number
fun value(row_number:Int, column_number:Int):String import CString.to_s `{
return CString_to_s(PQgetvalue(self, row_number, column_number));
`}
# Tests wether a field is a null value
fun is_null(row_number:Int, column_number: Int): Bool `{
return PQgetisnull(self, row_number, column_number);
`}
end
lib/postgresql/native_postgres.nit:52,1--85,3