Differences From Artifact [4e80eb06d8]:
- File src/PGConnection.h — part of check-in [e4c8de38e0] at 2024-08-11 17:45:27 on branch trunk — Add documentation (user: js, size: 2428) [annotate] [blame] [check-ins using]
To Artifact [a79bf6e7f3]:
- File
src/PGSQLConnection.h
— part of check-in
[77c26b4fce]
at
2024-08-11 18:00:52
on branch trunk
— Change prefix to PGSQL
Two letter prefixes are too risky to cause collisions. (user: js, size: 2461) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
16 17 18 19 20 21 22 | * PERFORMANCE OF THIS SOFTWARE. */ #include <libpq-fe.h> #import <ObjFW/ObjFW.h> | | | | | | | | | | | | 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | * PERFORMANCE OF THIS SOFTWARE. */ #include <libpq-fe.h> #import <ObjFW/ObjFW.h> #import "PGSQLResult.h" OF_ASSUME_NONNULL_BEGIN /** @file */ /** * @brief A result row. */ typedef OFDictionary OF_GENERIC(OFString *, id) *PGSQLRow; /** * @class PGSQLConnection PGSQLConnection.h ObjPgSQL/ObjPgSQL.h * * @brief A connection to a database. */ @interface PGSQLConnection: OFObject { PGconn *_connection; OFDictionary OF_GENERIC(OFString *, OFString *) *_parameters; } /** * @brief The parameters for the database connection. See `PQconnectdb` in the * PostgreSQL documentation. */ @property (nonatomic, copy) OFDictionary OF_GENERIC(OFString *, OFString *) *parameters; /** * @brief Connects to the database. * * @throw PGSQLConnectionFailedException The connection failed */ - (void)connect; /** * @brief Resets the connection to the database. */ - (void)reset; /** * @brief Closes the connection to the database. */ - (void)close; /** * @brief Executes the specified command. * * @param command The command to execute * @return The result of the command, if any * @throw PGSQLCommandFailedException Executing the command failed. */ - (nullable PGSQLResult *)executeCommand: (OFConstantString *)command; /** * @brief Executes the specified command. * * @param command The command to execute * @param firstParameter First parameter for the command * @return The result of the command, if any * @throw PGSQLCommandFailedException Executing the command failed. */ - (nullable PGSQLResult *)executeCommand: (OFConstantString *)command parameters: (id)firstParameter, ... OF_SENTINEL; @end OF_ASSUME_NONNULL_END |