\doxysection{DBI Functions}
\hypertarget{group__dbi__functions}{}\label{group__dbi__functions}\index{DBI Functions@{DBI Functions}}
\doxysubsubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{group__dbi__functions_ga40597983f24f3b0edc06149246d1cbe2}{Qore\+::\+SQL\+::dbi\+\_\+get\+\_\+driver\+\_\+capabilities}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{driver}})
\begin{DoxyCompactList}\small\item\em Returns an integer representing the capabilities of a DBI driver binary-\/\+OR\textquotesingle{}ed together (see \doxylink{group__dbi__capabilities}{DBI Capability Constants}) or 0 if the driver is not already loaded. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{list}}$<$ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} $>$ \mbox{\hyperlink{group__dbi__functions_gafc25fc4c8fd5f41b9637cb6a925697f7}{Qore\+::\+SQL\+::dbi\+\_\+get\+\_\+driver\+\_\+capability\+\_\+list}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{driver}})
\begin{DoxyCompactList}\small\item\em Returns a list of each capability supported by the given DBI driver (see \doxylink{group__dbi__capabilities}{DBI Capability Constants}) or \doxysectlink{basic_data_types_nothing}{NOTHING}{1} if the driver cannot be found. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{list}}$<$ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} $>$ \mbox{\hyperlink{group__dbi__functions_ga21d1d28f19884121c569a99394ec901a}{Qore\+::\+SQL\+::dbi\+\_\+get\+\_\+driver\+\_\+list}} ()
\begin{DoxyCompactList}\small\item\em Returns a list of strings of DBI drivers currently loaded or \doxysectlink{basic_data_types_nothing}{NOTHING}{1} if no drivers are loaded. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} $>$ \mbox{\hyperlink{group__dbi__functions_ga3e473d5b62aa2bf1fbd9fdde1cd4cba3}{Qore\+::\+SQL\+::dbi\+\_\+get\+\_\+driver\+\_\+options}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{driver}})
\begin{DoxyCompactList}\small\item\em returns a hash of driver options \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} $>$ \mbox{\hyperlink{group__dbi__functions_ga5bc0c2cfb4f1bfbf73c527f9441a6dbe}{Qore\+::\+SQL\+::parse\+\_\+datasource}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{ds}})
\begin{DoxyCompactList}\small\item\em Returns a \doxysectlink{group__dbi__functions_datasource_hash}{datasource hash}{1} of the components of a datasource string. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
These DBI functions were added in Qore 0.\+8.\+6; the original functions used camel case names and had \doxysectlink{code_flags_NOOP}{NOOP}{1} variants (see \doxylink{group__old__dbi__functions}{Old DBI Functions})\hypertarget{group__dbi__functions_datasource_hash}{}\doxysubsection{\texorpdfstring{Datasource Hash}{Datasource Hash}}\label{group__dbi__functions_datasource_hash}
 \tabulinesep=1mm
\begin{longtabu}spread 0pt [c]{*{2}{|X[-1]}|}
\hline
{\bfseries{Key}} &{\bfseries{Description}}  \\\cline{1-2}
{\ttfamily type}  &the name of the driver, if present  \\\cline{1-2}
{\ttfamily user}  &the username given in the string  \\\cline{1-2}
{\ttfamily pass}  &the password for the connection  \\\cline{1-2}
{\ttfamily db}  &the database name for the connection  \\\cline{1-2}
{\ttfamily charset}  &The name of the DB-\/specific character encoding to use for the connection, if present in the string  \\\cline{1-2}
{\ttfamily host}  &the hostname for the connection, if present in the string  \\\cline{1-2}
{\ttfamily port}  &the port number to use for the connection, if present in the string  \\\cline{1-2}
{\ttfamily options}  &A hash of options given in the string, if present. Special options are {\ttfamily "{}min"{}} and {\ttfamily "{}max"{}}, which are respected by the Datasource\+Pool\+::constructor(hash) variant for setting the minimum and maximum connections in the pool, respectively; other options are passed to the DBI driver  \\\cline{1-2}
\end{longtabu}


\doxysubsection{Function Documentation}
\Hypertarget{group__dbi__functions_ga40597983f24f3b0edc06149246d1cbe2}\label{group__dbi__functions_ga40597983f24f3b0edc06149246d1cbe2} 
\index{DBI Functions@{DBI Functions}!dbi\_get\_driver\_capabilities@{dbi\_get\_driver\_capabilities}}
\index{dbi\_get\_driver\_capabilities@{dbi\_get\_driver\_capabilities}!DBI Functions@{DBI Functions}}
\doxysubsubsection{\texorpdfstring{dbi\_get\_driver\_capabilities()}{dbi\_get\_driver\_capabilities()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+SQL\+::dbi\+\_\+get\+\_\+driver\+\_\+capabilities (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{driver }\end{DoxyParamCaption})}



Returns an integer representing the capabilities of a DBI driver binary-\/\+OR\textquotesingle{}ed together (see \doxylink{group__dbi__capabilities}{DBI Capability Constants}) or 0 if the driver is not already loaded. 

\begin{DoxyParagraph}{Code Flags\+:}
\doxysectlink{code_flags_CONSTANT}{CONSTANT}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em driver} & the name of the driver; if the given driver is not already loaded then this function returns \doxysectlink{basic_data_types_nothing}{NOTHING}{1}\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
an integer representing the capabilities of a DBI driver binary-\/\+OR\textquotesingle{}ed together (see \doxylink{group__dbi__capabilities}{DBI Capability Constants}) or 0 if the driver is not already loaded
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{int\ caps\ =\ dbi\_get\_driver\_capabilities(\textcolor{stringliteral}{"{}pgsql"{}});}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyNote}{Note}
similar to \doxylink{group__old__dbi__functions_gaec342f12d867758d49be57c1bf2a39cf}{get\+DBIDriver\+Capabilities()} except uses the standard function naming scheme (i.\+e. {\ttfamily "{}names\+\_\+like\+\_\+this()"{}} instead of {\ttfamily "{}camel\+Case()"{}}), always returns an \doxysectlink{data_type_declarations_int_type}{int}{1}, and does not have a \doxysectlink{code_flags_NOOP}{NOOP}{1} variant
\end{DoxyNote}
\begin{DoxySince}{Since}
Qore 0.\+8.\+6 
\end{DoxySince}
\Hypertarget{group__dbi__functions_gafc25fc4c8fd5f41b9637cb6a925697f7}\label{group__dbi__functions_gafc25fc4c8fd5f41b9637cb6a925697f7} 
\index{DBI Functions@{DBI Functions}!dbi\_get\_driver\_capability\_list@{dbi\_get\_driver\_capability\_list}}
\index{dbi\_get\_driver\_capability\_list@{dbi\_get\_driver\_capability\_list}!DBI Functions@{DBI Functions}}
\doxysubsubsection{\texorpdfstring{dbi\_get\_driver\_capability\_list()}{dbi\_get\_driver\_capability\_list()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{list}}$<$ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} $>$ Qore\+::\+SQL\+::dbi\+\_\+get\+\_\+driver\+\_\+capability\+\_\+list (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{driver }\end{DoxyParamCaption})}



Returns a list of each capability supported by the given DBI driver (see \doxylink{group__dbi__capabilities}{DBI Capability Constants}) or \doxysectlink{basic_data_types_nothing}{NOTHING}{1} if the driver cannot be found. 

\begin{DoxyParagraph}{Code Flags\+:}
\doxysectlink{code_flags_CONSTANT}{CONSTANT}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em driver} & the name of the driver; if the given driver is not loaded then the function returns \doxysectlink{basic_data_types_nothing}{NOTHING}{1}\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a list of each capability supported by the given DBI driver (see \doxylink{group__dbi__capabilities}{DBI Capability Constants}) or \doxysectlink{basic_data_types_nothing}{NOTHING}{1} if the driver cannot be found
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{*list<string>\ l\ =\ dbi\_get\_driver\_capability\_list(\textcolor{stringliteral}{"{}pgsql"{}});}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyNote}{Note}
similar to \doxylink{group__old__dbi__functions_ga9cbf88f872bbaebcd1d228efef180117}{get\+DBIDriver\+Capability\+List()} except uses the standard function naming scheme (i.\+e. {\ttfamily "{}names\+\_\+like\+\_\+this()"{}} instead of {\ttfamily "{}camel\+Case()"{}}) and does not have a \doxysectlink{code_flags_NOOP}{NOOP}{1} variant
\end{DoxyNote}
\begin{DoxySince}{Since}
Qore 0.\+8.\+6 
\end{DoxySince}
\Hypertarget{group__dbi__functions_ga21d1d28f19884121c569a99394ec901a}\label{group__dbi__functions_ga21d1d28f19884121c569a99394ec901a} 
\index{DBI Functions@{DBI Functions}!dbi\_get\_driver\_list@{dbi\_get\_driver\_list}}
\index{dbi\_get\_driver\_list@{dbi\_get\_driver\_list}!DBI Functions@{DBI Functions}}
\doxysubsubsection{\texorpdfstring{dbi\_get\_driver\_list()}{dbi\_get\_driver\_list()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{list}}$<$ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} $>$ Qore\+::\+SQL\+::dbi\+\_\+get\+\_\+driver\+\_\+list (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Returns a list of strings of DBI drivers currently loaded or \doxysectlink{basic_data_types_nothing}{NOTHING}{1} if no drivers are loaded. 

\begin{DoxyReturn}{Returns}
a list of strings of DBI drivers currently loaded or \doxysectlink{basic_data_types_nothing}{NOTHING}{1} if no drivers are loaded
\end{DoxyReturn}
\begin{DoxyParagraph}{Code Flags\+:}
\doxysectlink{code_flags_CONSTANT}{CONSTANT}{1}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{*list<string>\ l\ =\ dbi\_get\_driver\_list();}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyNote}{Note}
similar to \doxylink{group__old__dbi__functions_ga8d4cb418f509b5dab2d2e7fc422b5bb8}{get\+DBIDriver\+List()} except uses the standard function naming scheme (i.\+e. {\ttfamily "{}names\+\_\+like\+\_\+this()"{}} instead of {\ttfamily "{}camel\+Case()"{}})
\end{DoxyNote}
\begin{DoxySince}{Since}
Qore 0.\+8.\+6 
\end{DoxySince}
\Hypertarget{group__dbi__functions_ga3e473d5b62aa2bf1fbd9fdde1cd4cba3}\label{group__dbi__functions_ga3e473d5b62aa2bf1fbd9fdde1cd4cba3} 
\index{DBI Functions@{DBI Functions}!dbi\_get\_driver\_options@{dbi\_get\_driver\_options}}
\index{dbi\_get\_driver\_options@{dbi\_get\_driver\_options}!DBI Functions@{DBI Functions}}
\doxysubsubsection{\texorpdfstring{dbi\_get\_driver\_options()}{dbi\_get\_driver\_options()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} $>$ Qore\+::\+SQL\+::dbi\+\_\+get\+\_\+driver\+\_\+options (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{driver }\end{DoxyParamCaption})}



returns a hash of driver options 

\begin{DoxyParagraph}{Code Flags\+:}
\doxysectlink{code_flags_CONSTANT}{CONSTANT}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em driver} & the name of the driver; if the given driver is not already loaded then this function returns \doxysectlink{basic_data_types_nothing}{NOTHING}{1}\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
if the given driver is not already loaded then the function returns \doxysectlink{basic_data_types_nothing}{NOTHING}{1}; if the driver does not support any options then an empty hash is returned, otherwise a hash is returned where the keys are valid option names, and the values are hashes with the following keys\+:
\begin{DoxyItemize}
\item {\ttfamily "{}desc"{}}\+: a string description of the option
\item {\ttfamily "{}type"{}}\+: a string giving the data type restriction for the option
\end{DoxyItemize}
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{*hash<auto>\ h\ =\ dbi\_get\_driver\_options(\textcolor{stringliteral}{"{}pgsql"{}});}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxySince}{Since}
Qore 0.\+8.\+6 
\end{DoxySince}
\Hypertarget{group__dbi__functions_ga5bc0c2cfb4f1bfbf73c527f9441a6dbe}\label{group__dbi__functions_ga5bc0c2cfb4f1bfbf73c527f9441a6dbe} 
\index{DBI Functions@{DBI Functions}!parse\_datasource@{parse\_datasource}}
\index{parse\_datasource@{parse\_datasource}!DBI Functions@{DBI Functions}}
\doxysubsubsection{\texorpdfstring{parse\_datasource()}{parse\_datasource()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{auto}} $>$ Qore\+::\+SQL\+::parse\+\_\+datasource (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{ds }\end{DoxyParamCaption})}



Returns a \doxysectlink{group__dbi__functions_datasource_hash}{datasource hash}{1} of the components of a datasource string. 

\begin{DoxyParagraph}{Code Flags\+:}
\doxysectlink{code_flags_RET_VALUE_ONLY}{RET\+\_\+\+VALUE\+\_\+\+ONLY}{1}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em ds} & a string describing the datasource with the following syntax\+:~\newline
 {\ttfamily \mbox{[}}{\itshape driver}{\ttfamily \+:\mbox{]}\mbox{[}}{\itshape user}{\ttfamily /}{\itshape pass}{\ttfamily \mbox{]}@}{\itshape db}{\ttfamily \mbox{[}(}{\itshape charset}{\ttfamily )\mbox{]}\mbox{[}\%}{\itshape host}{\ttfamily \mbox{[}\+:}{\itshape port}{\ttfamily \mbox{]}\mbox{[}\{}{\itshape option}{\ttfamily =}{\itshape val}{\ttfamily \mbox{[},...\mbox{]}\}\mbox{]}} ~\newline
 where all elements except {\ttfamily @}{\itshape db} are optional\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a \doxysectlink{group__dbi__functions_datasource_hash}{datasource hash}{1} of the components of a datasource string
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{hash<auto>\ h\ =\ parse\_datasource(\textcolor{stringliteral}{"{}pgsql:user/pass@dbname(utf8)\%dbhost.internal:1521\{min=4,max=10\}"{}});}

\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em DATASOURCE-\/\+PARSE-\/\+ERROR} & a syntax error occurred parsing the datasource string (missing field, unexpected character, etc)\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
similar to \doxylink{group__old__dbi__functions_gaba3a2421c3d2b492c9494f346c13da1c}{parse\+Datasource()} except uses the standard function naming scheme (i.\+e. {\ttfamily "{}names\+\_\+like\+\_\+this()"{}} instead of {\ttfamily "{}camel\+Case()"{}}) and does not have a \doxysectlink{code_flags_NOOP}{NOOP}{1} variant
\end{DoxyNote}
\begin{DoxySince}{Since}
Qore 0.\+8.\+6 
\end{DoxySince}
