DBI
view release on metacpan or search on metacpan
#define MSG_event "MESSAGE"
#define DBEVENT_event "DBEVENT"
#define UNKNOWN_event "UNKNOWN"
#define DBIh_SET_ERR_SV(h,i, err, errstr, state, method) \
(DBIc_DBISTATE(i)->set_err_sv(h,i, err, errstr, state, method))
#define DBIh_SET_ERR_CHAR(h,i, err_c, err_i, errstr, state, method) \
(DBIc_DBISTATE(i)->set_err_char(h,i, err_c, err_i, errstr, state, method))
/* --- Handy Macros --- */
#define DBIh_CLEAR_ERROR(imp_xxh) (void)( \
(void)SvOK_off(DBIc_ERR(imp_xxh)), \
(void)SvOK_off(DBIc_ERRSTR(imp_xxh)), \
(void)SvOK_off(DBIc_STATE(imp_xxh)) \
)
/* --- DBI State Structure --- */
# define DBISTATE_INIT { /* typically use in BOOT: of XS file */ \
_DBISTATE_INIT_DBIS \
if (DBIS == NULL) \
croak("Unable to get DBI state. DBI not loaded."); \
DBIS->check_version(__FILE__, DBISTATE_VERSION, sizeof(*DBIS), NEED_DBIXS_VERSION, \
sizeof(dbih_drc_t), sizeof(dbih_dbc_t), sizeof(dbih_stc_t), sizeof(dbih_fdc_t) \
); \
}
/* --- Assorted Utility Macros --- */
#define DBD_ATTRIB_OK(attribs) /* is this a usable attrib value */ \
(attribs && SvROK(attribs) && SvTYPE(SvRV(attribs))==SVt_PVHV)
/* If attribs value supplied then croak if it's not a hash ref. */
/* Also map undef to Null. Should always be called to pre-process the */
/* attribs value. One day we may add some extra magic in here. */
#define DBD_ATTRIBS_CHECK(func, h, attribs) \
if ((attribs) && SvOK(attribs)) { \
if (!SvROK(attribs) || SvTYPE(SvRV(attribs))!=SVt_PVHV) \
lib/DBI/DBD.pm view on Meta::CPAN
If you've defined a parse_trace_flag() method in ::db you'll also want
it in ::st, so just alias it in:
*parse_trace_flag = \&DBD::foo:db::parse_trace_flag;
You may want to act on the current 'SQL' trace flag that DBI defines
to output SQL prepared/executed as DBI currently does not do SQL
tracing.
=head2 Trace Macros
Access to the trace level and trace flags is via a set of macros.
DBIc_TRACE_SETTINGS(imp) returns the trace settings
DBIc_TRACE_LEVEL(imp) returns the trace level
DBIc_TRACE_FLAGS(imp) returns the trace flags
DBIc_TRACE(imp, flags, flaglevel, level)
e.g.,
( run in 0.519 second using v1.01-cache-2.11-cpan-49f99fa48dc )