cp_db_connection_unescape_binary(3) - Linux man page

Name

cp_db_connection_escape_string, cp_db_connection_escape_binary, cp_db_connection_unescape_binary - string conversions for SQL queries

Synopsis

#include <cprops/db.h>

char *cp_db_connection_escape_string(cp_db_connection *connection,

char *src, int len);
char *cp_db_connection_escape_binary(cp_db_connection *
connection, char *src, int src_len, int *res_len);
cp_string *

cp_db_connection_unescape_binary(cp_db_connection *connection,

char *src);

Description

cp_db_connection_escape_string prepares a string for inclusion in an SQL query. This may entail escaping quote marks etc.
cp_db_connection_escape_binary
prepares a binary string for inclusion in an SQL query, for instance when performing an insert into a binary large object type column.
cp_db_connection_unescape_binary
converts a text string representing binary data returned by a query to actual binary data.

Driver implementations are not strictly required to implement these functions, but may be expected to implement at least cp_db_connection_escape_binary.

Return Value

On success, cp_db_connection_escape_string and cp_db_connection_escape_binary return a null terminated string representing the escaped data. cp_db_connection_unescape_binary returns a cp_string(3) representing the binary data.

NULL is returned if the driver for the database in use does not implement these methods.