\hypertarget{group__dbi__functions}{}\doxysection{DBI Functions}
\label{group__dbi__functions}\index{DBI Functions@{DBI Functions}}
\doxysubsection*{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}} driver)
\begin{DoxyCompactList}\small\item\em Returns an integer representing the capabilities of a DBI driver binary-\/\+OR\textquotesingle{}ed together (see \mbox{\hyperlink{group__dbi__capabilities}{DBI Capability Constants}}) or 0 if the driver is not already loaded. \end{DoxyCompactList}\item 
\+\_\+\+\_\+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}} driver)
\begin{DoxyCompactList}\small\item\em Returns a list of each capability supported by the given DBI driver (see \mbox{\hyperlink{group__dbi__capabilities}{DBI Capability Constants}}) or \mbox{\hyperlink{basic_data_types_nothing}{NOTHING}} if the driver cannot be found. \end{DoxyCompactList}\item 
\+\_\+\+\_\+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 \mbox{\hyperlink{basic_data_types_nothing}{NOTHING}} if no drivers are loaded. \end{DoxyCompactList}\item 
\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ auto $>$ \mbox{\hyperlink{group__dbi__functions_ga3e473d5b62aa2bf1fbd9fdde1cd4cba3}{Qore\+::\+SQL\+::dbi\+\_\+get\+\_\+driver\+\_\+options}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} driver)
\begin{DoxyCompactList}\small\item\em returns a hash of driver options \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ auto $>$ \mbox{\hyperlink{group__dbi__functions_ga5bc0c2cfb4f1bfbf73c527f9441a6dbe}{Qore\+::\+SQL\+::parse\+\_\+datasource}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} ds)
\begin{DoxyCompactList}\small\item\em Returns a \mbox{\hyperlink{group__dbi__functions_datasource_hash}{datasource hash}} 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 \mbox{\hyperlink{code_flags_NOOP}{NOOP}} variants (see \mbox{\hyperlink{group__old__dbi__functions}{Old DBI Functions}})\hypertarget{group__dbi__functions_datasource_hash}{}\doxysubsection{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 \char`\"{}min\char`\"{}} and {\ttfamily \char`\"{}max\char`\"{}}, 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}
\mbox{\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 \mbox{\hyperlink{group__dbi__capabilities}{DBI Capability Constants}}) or 0 if the driver is not already loaded. 

\begin{DoxyParagraph}{Code Flags\+:}
\mbox{\hyperlink{code_flags_CONSTANT}{CONSTANT}}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em driver} & the name of the driver; if the given driver is not already loaded then this function returns \mbox{\hyperlink{basic_data_types_nothing}{NOTHING}}\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
an integer representing the capabilities of a DBI driver binary-\/\+OR\textquotesingle{}ed together (see \mbox{\hyperlink{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 \mbox{\hyperlink{group__old__dbi__functions_gaec342f12d867758d49be57c1bf2a39cf}{get\+DBIDriver\+Capabilities()}} except uses the standard function naming scheme (i.\+e. {\ttfamily \char`\"{}names\+\_\+like\+\_\+this()\char`\"{}} instead of {\ttfamily \char`\"{}camel\+Case()\char`\"{}}), always returns an \mbox{\hyperlink{data_type_declarations_int_type}{int}}, and does not have a \mbox{\hyperlink{code_flags_NOOP}{NOOP}} variant
\end{DoxyNote}
\begin{DoxySince}{Since}
Qore 0.\+8.\+6 
\end{DoxySince}
\mbox{\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 \+\_\+\+\_\+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 \mbox{\hyperlink{group__dbi__capabilities}{DBI Capability Constants}}) or \mbox{\hyperlink{basic_data_types_nothing}{NOTHING}} if the driver cannot be found. 

\begin{DoxyParagraph}{Code Flags\+:}
\mbox{\hyperlink{code_flags_CONSTANT}{CONSTANT}}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em driver} & the name of the driver; if the given driver is not loaded then the function returns \mbox{\hyperlink{basic_data_types_nothing}{NOTHING}}\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a list of each capability supported by the given DBI driver (see \mbox{\hyperlink{group__dbi__capabilities}{DBI Capability Constants}}) or \mbox{\hyperlink{basic_data_types_nothing}{NOTHING}} 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 \mbox{\hyperlink{group__old__dbi__functions_ga9cbf88f872bbaebcd1d228efef180117}{get\+DBIDriver\+Capability\+List()}} except uses the standard function naming scheme (i.\+e. {\ttfamily \char`\"{}names\+\_\+like\+\_\+this()\char`\"{}} instead of {\ttfamily \char`\"{}camel\+Case()\char`\"{}}) and does not have a \mbox{\hyperlink{code_flags_NOOP}{NOOP}} variant
\end{DoxyNote}
\begin{DoxySince}{Since}
Qore 0.\+8.\+6 
\end{DoxySince}
\mbox{\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 \+\_\+\+\_\+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 \mbox{\hyperlink{basic_data_types_nothing}{NOTHING}} if no drivers are loaded. 

\begin{DoxyReturn}{Returns}
a list of strings of DBI drivers currently loaded or \mbox{\hyperlink{basic_data_types_nothing}{NOTHING}} if no drivers are loaded
\end{DoxyReturn}
\begin{DoxyParagraph}{Code Flags\+:}
\mbox{\hyperlink{code_flags_CONSTANT}{CONSTANT}}
\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 \mbox{\hyperlink{group__old__dbi__functions_ga8d4cb418f509b5dab2d2e7fc422b5bb8}{get\+DBIDriver\+List()}} except uses the standard function naming scheme (i.\+e. {\ttfamily \char`\"{}names\+\_\+like\+\_\+this()\char`\"{}} instead of {\ttfamily \char`\"{}camel\+Case()\char`\"{}})
\end{DoxyNote}
\begin{DoxySince}{Since}
Qore 0.\+8.\+6 
\end{DoxySince}
\mbox{\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 \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ 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\+:}
\mbox{\hyperlink{code_flags_CONSTANT}{CONSTANT}}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em driver} & the name of the driver; if the given driver is not already loaded then this function returns \mbox{\hyperlink{basic_data_types_nothing}{NOTHING}}\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
if the given driver is not already loaded then the function returns \mbox{\hyperlink{basic_data_types_nothing}{NOTHING}}; 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 \char`\"{}desc\char`\"{}}\+: a string description of the option
\item {\ttfamily \char`\"{}type\char`\"{}}\+: 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}
\mbox{\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}}$<$ auto $>$ Qore\+::\+SQL\+::parse\+\_\+datasource (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{ds }\end{DoxyParamCaption})}



Returns a \mbox{\hyperlink{group__dbi__functions_datasource_hash}{datasource hash}} of the components of a datasource string. 

\begin{DoxyParagraph}{Code Flags\+:}
\mbox{\hyperlink{code_flags_RET_VALUE_ONLY}{RET\+\_\+\+VALUE\+\_\+\+ONLY}}
\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 \mbox{\hyperlink{group__dbi__functions_datasource_hash}{datasource hash}} 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 \mbox{\hyperlink{group__old__dbi__functions_gaba3a2421c3d2b492c9494f346c13da1c}{parse\+Datasource()}} except uses the standard function naming scheme (i.\+e. {\ttfamily \char`\"{}names\+\_\+like\+\_\+this()\char`\"{}} instead of {\ttfamily \char`\"{}camel\+Case()\char`\"{}}) and does not have a \mbox{\hyperlink{code_flags_NOOP}{NOOP}} variant
\end{DoxyNote}
\begin{DoxySince}{Since}
Qore 0.\+8.\+6 
\end{DoxySince}
