\hypertarget{group__dbi__functions}{}\section{D\+BI Functions}
\label{group__dbi__functions}\index{D\+B\+I Functions@{D\+B\+I Functions}}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{group__dbi__functions_ga40597983f24f3b0edc06149246d1cbe2}{Qore\+::\+S\+Q\+L\+::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 D\+BI driver binary-\/\+OR\textquotesingle{}ed together (see \mbox{\hyperlink{group__dbi__capabilities}{D\+BI Capability Constants}}) or 0 if the driver is not already loaded. \end{DoxyCompactList}\item 
\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_ga4b52a1cbee7a3aed46c32cb0a938629c}{list}}$<$ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} $>$ \mbox{\hyperlink{group__dbi__functions_ga2c836575bb7327e5ef81df5dff4799ff}{Qore\+::\+S\+Q\+L\+::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 D\+BI driver (see \mbox{\hyperlink{group__dbi__capabilities}{D\+BI Capability Constants}}) or \mbox{\hyperlink{basic_data_types_nothing}{N\+O\+T\+H\+I\+NG}} if the driver cannot be found. \end{DoxyCompactList}\item 
\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_ga4b52a1cbee7a3aed46c32cb0a938629c}{list}}$<$ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} $>$ \mbox{\hyperlink{group__dbi__functions_gae91b14606e0b3d0ca9155a911ec06a5c}{Qore\+::\+S\+Q\+L\+::dbi\+\_\+get\+\_\+driver\+\_\+list}} ()
\begin{DoxyCompactList}\small\item\em Returns a list of strings of D\+BI drivers currently loaded or \mbox{\hyperlink{basic_data_types_nothing}{N\+O\+T\+H\+I\+NG}} if no drivers are loaded. \end{DoxyCompactList}\item 
\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}}$<$ auto $>$ \mbox{\hyperlink{group__dbi__functions_gafc8e6e00000f5c1a029f69d43dc66f82}{Qore\+::\+S\+Q\+L\+::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_ga0231dbb472dd230310af7c7c34f56e92}{hash}}$<$ auto $>$ \mbox{\hyperlink{group__dbi__functions_ga6c3dab42570887656fc05f5a22eb370a}{Qore\+::\+S\+Q\+L\+::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}


\subsection{Detailed Description}
These D\+BI functions were added in Qore 0.\+8.\+6; the original functions used camel case names and had \mbox{\hyperlink{code_flags_NOOP}{N\+O\+OP}} variants (see \mbox{\hyperlink{group__old__dbi__functions}{Old D\+BI Functions}})\hypertarget{group__dbi__functions_datasource_hash}{}\subsection{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 D\+B-\/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 D\+BI driver  \\\cline{1-2}
\end{longtabu}


\subsection{Function Documentation}
\mbox{\Hypertarget{group__dbi__functions_ga40597983f24f3b0edc06149246d1cbe2}\label{group__dbi__functions_ga40597983f24f3b0edc06149246d1cbe2}} 
\index{D\+B\+I Functions@{D\+B\+I Functions}!dbi\+\_\+get\+\_\+driver\+\_\+capabilities@{dbi\+\_\+get\+\_\+driver\+\_\+capabilities}}
\index{dbi\+\_\+get\+\_\+driver\+\_\+capabilities@{dbi\+\_\+get\+\_\+driver\+\_\+capabilities}!D\+B\+I Functions@{D\+B\+I Functions}}
\subsubsection{\texorpdfstring{dbi\+\_\+get\+\_\+driver\+\_\+capabilities()}{dbi\_get\_driver\_capabilities()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+S\+Q\+L\+::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 D\+BI driver binary-\/\+OR\textquotesingle{}ed together (see \mbox{\hyperlink{group__dbi__capabilities}{D\+BI Capability Constants}}) or 0 if the driver is not already loaded. 

\begin{DoxyParagraph}{Code Flags\+:}
\mbox{\hyperlink{code_flags_CONSTANT}{C\+O\+N\+S\+T\+A\+NT}}
\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}{N\+O\+T\+H\+I\+NG}}\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
an integer representing the capabilities of a D\+BI driver binary-\/\+OR\textquotesingle{}ed together (see \mbox{\hyperlink{group__dbi__capabilities}{D\+BI Capability Constants}}) or 0 if the driver is not already loaded
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
int caps = \mbox{\hyperlink{group__dbi__functions_ga40597983f24f3b0edc06149246d1cbe2}{dbi\_get\_driver\_capabilities}}(\textcolor{stringliteral}{"pgsql"});
\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyNote}{Note}
similar to \mbox{\hyperlink{group__old__dbi__functions_ga330acb764484b16529d4f25960c45fa8}{get\+D\+B\+I\+Driver\+Capabilities()}} except uses the standard function naming scheme (ie {\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}{N\+O\+OP}} variant
\end{DoxyNote}
\begin{DoxySince}{Since}
Qore 0.\+8.\+6 
\end{DoxySince}
\mbox{\Hypertarget{group__dbi__functions_ga2c836575bb7327e5ef81df5dff4799ff}\label{group__dbi__functions_ga2c836575bb7327e5ef81df5dff4799ff}} 
\index{D\+B\+I Functions@{D\+B\+I Functions}!dbi\+\_\+get\+\_\+driver\+\_\+capability\+\_\+list@{dbi\+\_\+get\+\_\+driver\+\_\+capability\+\_\+list}}
\index{dbi\+\_\+get\+\_\+driver\+\_\+capability\+\_\+list@{dbi\+\_\+get\+\_\+driver\+\_\+capability\+\_\+list}!D\+B\+I Functions@{D\+B\+I Functions}}
\subsubsection{\texorpdfstring{dbi\+\_\+get\+\_\+driver\+\_\+capability\+\_\+list()}{dbi\_get\_driver\_capability\_list()}}
{\footnotesize\ttfamily \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_ga4b52a1cbee7a3aed46c32cb0a938629c}{list}}$<$\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}$>$ Qore\+::\+S\+Q\+L\+::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 D\+BI driver (see \mbox{\hyperlink{group__dbi__capabilities}{D\+BI Capability Constants}}) or \mbox{\hyperlink{basic_data_types_nothing}{N\+O\+T\+H\+I\+NG}} if the driver cannot be found. 

\begin{DoxyParagraph}{Code Flags\+:}
\mbox{\hyperlink{code_flags_CONSTANT}{C\+O\+N\+S\+T\+A\+NT}}
\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}{N\+O\+T\+H\+I\+NG}}\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a list of each capability supported by the given D\+BI driver (see \mbox{\hyperlink{group__dbi__capabilities}{D\+BI Capability Constants}}) or \mbox{\hyperlink{basic_data_types_nothing}{N\+O\+T\+H\+I\+NG}} if the driver cannot be found
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

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

\end{DoxyParagraph}
\begin{DoxyNote}{Note}
similar to \mbox{\hyperlink{group__old__dbi__functions_ga7854c258d52bc1aa47faad90ac5b8e6b}{get\+D\+B\+I\+Driver\+Capability\+List()}} except uses the standard function naming scheme (ie {\ttfamily \char`\"{}names\+\_\+like\+\_\+this()\char`\"{}} instead of {\ttfamily \char`\"{}camel\+Case()\char`\"{}}) and does not have a \mbox{\hyperlink{code_flags_NOOP}{N\+O\+OP}} variant
\end{DoxyNote}
\begin{DoxySince}{Since}
Qore 0.\+8.\+6 
\end{DoxySince}
\mbox{\Hypertarget{group__dbi__functions_gae91b14606e0b3d0ca9155a911ec06a5c}\label{group__dbi__functions_gae91b14606e0b3d0ca9155a911ec06a5c}} 
\index{D\+B\+I Functions@{D\+B\+I Functions}!dbi\+\_\+get\+\_\+driver\+\_\+list@{dbi\+\_\+get\+\_\+driver\+\_\+list}}
\index{dbi\+\_\+get\+\_\+driver\+\_\+list@{dbi\+\_\+get\+\_\+driver\+\_\+list}!D\+B\+I Functions@{D\+B\+I Functions}}
\subsubsection{\texorpdfstring{dbi\+\_\+get\+\_\+driver\+\_\+list()}{dbi\_get\_driver\_list()}}
{\footnotesize\ttfamily \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_ga4b52a1cbee7a3aed46c32cb0a938629c}{list}}$<$\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}$>$ Qore\+::\+S\+Q\+L\+::dbi\+\_\+get\+\_\+driver\+\_\+list (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Returns a list of strings of D\+BI drivers currently loaded or \mbox{\hyperlink{basic_data_types_nothing}{N\+O\+T\+H\+I\+NG}} if no drivers are loaded. 

\begin{DoxyReturn}{Returns}
a list of strings of D\+BI drivers currently loaded or \mbox{\hyperlink{basic_data_types_nothing}{N\+O\+T\+H\+I\+NG}} if no drivers are loaded
\end{DoxyReturn}
\begin{DoxyParagraph}{Code Flags\+:}
\mbox{\hyperlink{code_flags_CONSTANT}{C\+O\+N\+S\+T\+A\+NT}}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
*list<string> l = \mbox{\hyperlink{group__dbi__functions_gae91b14606e0b3d0ca9155a911ec06a5c}{dbi\_get\_driver\_list}}();
\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyNote}{Note}
similar to \mbox{\hyperlink{group__old__dbi__functions_ga20fdc611dd5a56fce211b3106578840c}{get\+D\+B\+I\+Driver\+List()}} except uses the standard function naming scheme (ie {\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_gafc8e6e00000f5c1a029f69d43dc66f82}\label{group__dbi__functions_gafc8e6e00000f5c1a029f69d43dc66f82}} 
\index{D\+B\+I Functions@{D\+B\+I Functions}!dbi\+\_\+get\+\_\+driver\+\_\+options@{dbi\+\_\+get\+\_\+driver\+\_\+options}}
\index{dbi\+\_\+get\+\_\+driver\+\_\+options@{dbi\+\_\+get\+\_\+driver\+\_\+options}!D\+B\+I Functions@{D\+B\+I Functions}}
\subsubsection{\texorpdfstring{dbi\+\_\+get\+\_\+driver\+\_\+options()}{dbi\_get\_driver\_options()}}
{\footnotesize\ttfamily \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}}$<$auto$>$ Qore\+::\+S\+Q\+L\+::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}{C\+O\+N\+S\+T\+A\+NT}}
\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}{N\+O\+T\+H\+I\+NG}}\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
if the given driver is not already loaded then the function returns \mbox{\hyperlink{basic_data_types_nothing}{N\+O\+T\+H\+I\+NG}}; 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}
*hash<auto> h = \mbox{\hyperlink{group__dbi__functions_gafc8e6e00000f5c1a029f69d43dc66f82}{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_ga6c3dab42570887656fc05f5a22eb370a}\label{group__dbi__functions_ga6c3dab42570887656fc05f5a22eb370a}} 
\index{D\+B\+I Functions@{D\+B\+I Functions}!parse\+\_\+datasource@{parse\+\_\+datasource}}
\index{parse\+\_\+datasource@{parse\+\_\+datasource}!D\+B\+I Functions@{D\+B\+I Functions}}
\subsubsection{\texorpdfstring{parse\+\_\+datasource()}{parse\_datasource()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}}$<$auto$>$ Qore\+::\+S\+Q\+L\+::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}{R\+E\+T\+\_\+\+V\+A\+L\+U\+E\+\_\+\+O\+N\+LY}}
\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 \mbox{]}\+:\mbox{[}/}{\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}
hash<auto> h = \mbox{\hyperlink{group__dbi__functions_ga6c3dab42570887656fc05f5a22eb370a}{parse\_datasource}}(\textcolor{stringliteral}{"
      pgsql:user/pass@dbname(utf8)%dbhost.internal:1521\{min=4,max=10\}"});
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em D\+A\+T\+A\+S\+O\+U\+R\+C\+E-\/\+P\+A\+R\+S\+E-\/\+E\+R\+R\+OR} & 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_gab8f5a597374024a8c78e767dbfcafc15}{parse\+Datasource()}} except uses the standard function naming scheme (ie {\ttfamily \char`\"{}names\+\_\+like\+\_\+this()\char`\"{}} instead of {\ttfamily \char`\"{}camel\+Case()\char`\"{}}) and does not have a \mbox{\hyperlink{code_flags_NOOP}{N\+O\+OP}} variant
\end{DoxyNote}
\begin{DoxySince}{Since}
Qore 0.\+8.\+6 
\end{DoxySince}
