LCOV - code coverage report
Current view: top level - ogr/ogrsf_frmts/pg - ogrpgutility.h (source / functions) Hit Total Coverage
Test: gdal_filtered.info Lines: 5 5 100.0 %
Date: 2024-11-21 22:18:42 Functions: 1 1 100.0 %

          Line data    Source code
       1             : /******************************************************************************
       2             :  * $Id$
       3             :  *
       4             :  * Project:  OpenGIS Simple Features Reference Implementation
       5             :  * Purpose:  Private utilities for OGR/PostgreSQL driver.
       6             :  * Author:   Mateusz Loskot, mateusz@loskot.net
       7             :  *
       8             :  ******************************************************************************
       9             :  * Copyright (c) 2007, Mateusz Loskot
      10             :  *
      11             :  * SPDX-License-Identifier: MIT
      12             :  ****************************************************************************/
      13             : 
      14             : #ifndef OGRPGUTILITY_H_INCLUDED
      15             : #define OGRPGUTILITY_H_INCLUDED
      16             : 
      17             : #include "libpq-fe.h"
      18             : 
      19             : PGresult *OGRPG_PQexec(PGconn *conn, const char *query,
      20             :                        int bMultipleCommandAllowed = FALSE,
      21             :                        int bErrorAsDebug = FALSE);
      22             : 
      23             : /************************************************************************/
      24             : /*                            OGRPGClearResult                          */
      25             : /*                                                                      */
      26             : /*      Safe wrapper for PQclear() function.                            */
      27             : /*      Releases given result and resets handle to NULL.                */
      28             : /*      Parameter hResult is input/output - a reference to pointer      */
      29             : /************************************************************************/
      30             : 
      31       15668 : inline void OGRPGClearResult(PGresult *&hResult)
      32             : {
      33       15668 :     if (nullptr != hResult)
      34             :     {
      35       15661 :         PQclear(hResult);
      36       15661 :         hResult = nullptr;
      37             :     }
      38       15668 : }
      39             : 
      40             : bool OGRPG_Check_Table_Exists(PGconn *hPGConn, const char *pszTableName);
      41             : 
      42             : #endif /* ndef OGRPGUTILITY_H_INCLUDED */

Generated by: LCOV version 1.14