IPostgresDBConnection Class
(PostgresDB::IPostgresDBConnection)Implements PostgresDB support for CDP2SQL. More...
| Header: | #include <IPostgresDBConnection> |
| Inherits: | CDP2SQL::IDatabaseConnection |
Public Functions
| virtual bool | IsNativeParameterBindingEnabled() const = 0 |
| virtual void | SetNativeParameterBindingEnabled(bool useNative) = 0 |
- 14 public functions inherited from CDP2SQL::IDatabaseConnection
Detailed Description
Implements PostgresDB support for CDP2SQL.
Member Function Documentation
[pure virtual] bool IPostgresDBConnection::IsNativeParameterBindingEnabled() const
Returns whether native PostgreSQL parameter placeholders are expected.
If this returns true, SQL passed to statements is expected to use PostgreSQL native placeholders ($1, $2, ...).
If this returns false (default), the library accepts ? placeholders and converts them to $1, $2, ... when a statement is compiled. In this mode one has to use ?? to escape a literal question mark in the SQL (for example, when using the ? operator in JSONB queries).
[pure virtual] void IPostgresDBConnection::SetNativeParameterBindingEnabled(bool useNative)
Sets whether SQL statements should use native PostgreSQL parameter placeholders.
When enabled, SQL passed to statements must use $1, $2, ... placeholders.
When disabled, SQL may use ? placeholders and the library will convert them on compile. In this mode one has to use ?? to escape a literal question mark in the SQL (for example, when using the ? operator in JSONB queries).
Note: This setting must be changed before creating a prepared statement object on the connection.
Get started with CDP Studio today
Let us help you take your great ideas and turn them into the products your customer will love.