Source
char *db_dyn_escape_string(const char *src, size_t max_bytes, size_t max_chars, zbx_escape_sequence_t flag);
/*
** Copyright (C) 2001-2025 Zabbix SIA
**
** This program is free software: you can redistribute it and/or modify it under the terms of
** the GNU Affero General Public License as published by the Free Software Foundation, version 3.
**
** This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
** without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
** See the GNU Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License along with this program.
** If not, see <https://www.gnu.org/licenses/>.
**/
typedef enum
{
DBCONN_TYPE_UNMANAGED,
DBCONN_TYPE_MANAGED
}
zbx_dbconn_type_t;
struct zbx_dbconn
{
int txn_level; /* transaction level, nested transactions are not supported */
int txn_error; /* failed transaction */
int txn_end_error; /* transaction result */
int connection_failure;
char *last_db_strerror; /* last database error message */
zbx_err_codes_t last_db_errcode;
int autoincrement;
int connect_options;
zbx_dbconn_type_t managed; /* managed by connection pool */
const zbx_db_config_t *config;