Browse Source

sqlops: Fixing typo in documentation, minor edits

Olle E. Johansson 12 years ago
parent
commit
10de949af0
2 changed files with 59 additions and 58 deletions
  1. 35 35
      modules_k/sqlops/README
  2. 24 23
      modules_k/sqlops/doc/sqlops_admin.xml

+ 35 - 35
modules_k/sqlops/README

@@ -81,29 +81,29 @@ Chapter 1. Admin Guide
 
 1. Overview
 
-   The module adds support for raw SQL queries in the configuration file.
+   The SQLOPS module adds support for raw SQL queries in the configuration
+   file.
 
    Among the features:
-     * Multiple DB connections - the module can connect to many databases
-       on different servers using different DB driver modules at the same
-       time.
-     * many DB results - the module can store many results of different
+     * Multiple database connections - the sqlops module can connect to
+       many databases on different servers using different DB driver
+       modules at the same time.
+     * Many query results - the module can store many results of different
        SQL queries in separate structures at the same time. Thus it is
-       possible to work in parallel with several DB results.
-     * access via pseudo-variables - the content of the SQL query result
+       possible to work in parallel with several queries and results.
+     * Access via pseudo-variables - the content of the SQL query result
        is accessible via pseudo-variables. Please note that only integer
        and string variables are supported at the moment because of the
        internal usage of "AVPs" to hold the values. So it is not possible
        for example to return floating point or big integer values this
        way.
-     * array indexes - fast access to result values via array position:
+     * Array indexes - fast access to result values via array position:
        [row,column].
-     * persistence in process space - a result can be used many times in
+     * Persistence in process space - a result can be used many times in
        the same worker process. Query once, use many times.
-     * alternatively, results can be stored in xavps - columns are
-       accessed by their names, rows by xavp index. Xavp's are available
-       during the transactions lifetime and don't need to be destroyed
-       manually.
+     * Results can be stored in xavps - columns are accessed by their
+       names, rows by xavp index. Xavp's are available during the
+       transactions lifetime and don't need to be destroyed manually.
 
 2. Dependencies
 
@@ -134,27 +134,27 @@ Chapter 1. Admin Guide
 
    This parameter may be set multiple times to get many DB connections in
    the same configuration file.
-     * connection_name - string specifying the name of a DB connection.
-       This string is used by the "sql_query()" function to refer to the
-       DB connection.
-     * database_url - Standardized database URL used to connect to
-       database.
+     * connection_name - string specifying the name of a database
+       connection. This string is used by the "sql_query()" function to
+       refer to the DB connection.
+     * database_url - Standardized Kamailio database URL used to connect
+       to database.
 
    Default value is NULL.
 
    Example 1.1. Set sqlcon parameter
 ...
-modparam("sqlops","sqlcon","cb=>mysql://openser:[email protected]/testdb")
+modparam("sqlops","sqlcon","cb=>mysql://kamailio:[email protected]/testdb")
 modparam("sqlops","sqlcon","ca=>dbdriver://username:password@dbhost/dbname")
 ...
 
 3.2. sqlres (str)
 
-   The definition of a DB result ID. The value of the parameter can be any
-   string. Results IDs are also added at fixup time when sql_query()
-   parameters are parsed, there is no need to decalare them via module
-   parameter unless you want to use them from within other modules and be
-   available in all application processes.
+   The definition of a database result ID. The value of the parameter can
+   be any string. Results IDs are also added at fixup time when
+   sql_query() parameters are parsed, so there is no need to decalare them
+   via module parameter unless you want to use them from within other
+   modules and be available in all application processes.
 
    Default value is NULL.
 
@@ -170,10 +170,10 @@ modparam("sqlops", "sqlres", "ra")
    4.3. sql_pvquery(connection, query, result)
    4.4. sql_result_free(result)
 
-4.1. sql_query(connection, query[, result])
+4.1.  sql_query(connection, query[, result])
 
    Make an SQL query using 'connection' and store data in 'result'.
-     * connection - the name of the connection to be used for query
+     * connection - the name of the connection to be used for the query
        (defined via the "sqlcon" parameter).
      * query - SQL query string or pseudo-variables containing SQL query.
      * result - string name to identify the result. Will be used by
@@ -193,10 +193,10 @@ xlog("number of rows in table domain: $dbr(ra=>rows)\n");
 sql_result_free("ra");
 ...
 
-4.2. sql_xquery(connection, query, result)
+4.2.  sql_xquery(connection, query, result)
 
    Make an SQL query using 'connection' and store data in 'result' xavp.
-     * connection - the name of the connection to be used for query
+     * connection - the name of the connection to be used for the query
        (defined via the "sqlcon" parameter).
      * query - SQL query string or pseudo-variables containing SQL query.
      * result - string name to identify the result xavp. Each row will be
@@ -212,10 +212,10 @@ sql_xquery("ca", "select * from domain", "ra");
   xlog("first domain: $xavp(ra=>domain) with id: $xavp(ra=>domain_id)\n");
 ...
 
-4.3. sql_pvquery(connection, query, result)
+4.3.  sql_pvquery(connection, query, result)
 
-   Make an SQL query using 'connection' and store data in arbitrary PV's
-   specified by 'result' parameter.
+   Make an SQL query using 'connection' and store data in arbitrary pseudo
+   variables specified by 'result' parameter.
      * connection - the name of the connection to be used for query
        (defined via the "sqlcon" parameter).
      * query - SQL query string or pseudo-variables containing SQL query.
@@ -240,11 +240,11 @@ sql_xquery("ca", "select * from domain", "ra");
 ...
 modparam("sqlops","sqlcon","ca=>dbdriver://username:password@dbhost/dbname")
 ...
-sql_xquery("ca", "select 'col1', 2, NULL, 'sip:[email protected]'",
+sql_pvquery("ca", "select 'col1', 2, NULL, 'sip:[email protected]'",
         "$var(a), $avp(col2), $xavp(item[0]=>s), $ru");
 ...
 
-4.4. sql_result_free(result)
+4.4.  sql_result_free(result)
 
    Free data in SQL 'result'.
 
@@ -334,10 +334,10 @@ if (sql_xquery("ca", "select * from domain", "ra") == 1)
 5.2. $sqlrows(con)
 
    Number of affected rows of the previous query on the specified
-   connection. Its primary use is to get the number of rows affected by
+   connection. It's primary use is to get the number of rows affected by
    UPDATE, INSERT and DELETE queries.
 
-   "con" must be the name identifying an SQL connection.
+   "con" must be the name identifying a DB connection.
 
    Example 1.8. $sqlrows(con) usage
 ...

+ 24 - 23
modules_k/sqlops/doc/sqlops_admin.xml

@@ -16,7 +16,7 @@
 	<section>
 	<title>Overview</title>
 	<para>
-		The module adds support for raw SQL queries in the configuration file.
+		The SQLOPS module adds support for raw SQL queries in the configuration file.
 	</para>
 	<para>
 		Among the features:
@@ -24,22 +24,22 @@
 	<itemizedlist>
 		<listitem>
 		<para>
-			<emphasis>Multiple DB connections</emphasis> - the module can connect
-			to many databases on different servers using different DB
+			<emphasis>Multiple database connections</emphasis> - the sqlops module
+			can connect to many databases on different servers using different DB
 			driver modules at the same time.
 		</para>
 		</listitem>
 		<listitem>
 		<para>
-			<emphasis>many DB results</emphasis> - the module can store
+			<emphasis>Many query results</emphasis> - the module can store
 			many results of different SQL queries in separate structures at
 			the same time. Thus it is possible to work in parallel with several
-			DB results.
+			queries and results.
 		</para>
 		</listitem>
 		<listitem>
 		<para>
-			<emphasis>access via pseudo-variables</emphasis> - the content
+			<emphasis>Access via pseudo-variables</emphasis> - the content
 			of the SQL query result is accessible via pseudo-variables. Please
 			note that only integer and string variables are supported at the
 			moment because of the internal usage of <quote>AVPs</quote> to hold
@@ -49,20 +49,20 @@
 		</listitem>
 		<listitem>
 		<para>
-			<emphasis>array indexes</emphasis> - fast access to result values
+			<emphasis>Array indexes</emphasis> - fast access to result values
 			via array position: [row,column].
 		</para>
 		</listitem>
 		<listitem>
 		<para>
-			<emphasis>persistence in process space</emphasis> - a result can
+			<emphasis>Persistence in process space</emphasis> - a result can
 			be used many times in the same worker process. Query once, use many
 			times.
 		</para>
 		</listitem>
 		<listitem>
 		<para>
-			<emphasis>alternatively, results can be stored in xavps</emphasis>
+			<emphasis>Results can be stored in xavps</emphasis>
 			- columns are accessed by their names, rows by xavp index. Xavp's
 			are available during the transactions lifetime and don't need to
 			be destroyed manually.
@@ -126,13 +126,14 @@
 		<listitem>
 		<para>
 			<emphasis>connection_name</emphasis> - string specifying the name
-			of a DB connection. This string is used by the <quote>sql_query()</quote> function to
-			refer to the DB connection.
+			of a database connection. This string is used by the <quote>sql_query()</quote>
+			function to refer to the DB connection.
 		</para>
 		</listitem>
 		<listitem>
 		<para>
-			<emphasis>database_url</emphasis> - Standardized database URL used to connect to database.
+			<emphasis>database_url</emphasis> - Standardized &kamailio; database URL
+			used to connect to database.
 		</para>
 		</listitem>
 		</itemizedlist>
@@ -145,7 +146,7 @@
 		<title>Set <varname>sqlcon</varname> parameter</title>
 		<programlisting format="linespecific">
 ...
-modparam("sqlops","sqlcon","cb=&gt;mysql://openser:[email protected]/testdb")
+modparam("sqlops","sqlcon","cb=&gt;mysql://kamailio:[email protected]/testdb")
 modparam("sqlops","sqlcon","ca=&gt;&exampledb;")
 ...
 </programlisting>
@@ -154,9 +155,9 @@ modparam("sqlops","sqlcon","ca=&gt;&exampledb;")
 	<section>
 		<title><varname>sqlres</varname> (str)</title>
 		<para>
-		The definition of a DB result ID. The value of the parameter can be
+		The definition of a database result ID. The value of the parameter can be
 		any string. Results IDs are also added at fixup time when sql_query()
-		parameters are parsed, there is no need to decalare them via module
+		parameters are parsed, so there is no need to decalare them via module
 		parameter unless you want to use them from within other modules and be
 		available in all application processes.
 		</para>
@@ -188,7 +189,7 @@ modparam("sqlops", "sqlres", "ra")
 		<listitem>
 			<para>
 				<emphasis>connection</emphasis> - the name of the connection
-				to be used for query (defined via the <quote>sqlcon</quote> parameter).
+				to be used for the query (defined via the <quote>sqlcon</quote> parameter).
 			</para>
 		</listitem>
 		<listitem>
@@ -233,7 +234,7 @@ sql_result_free("ra");
 		<listitem>
 			<para>
 				<emphasis>connection</emphasis> - the name of the connection
-				to be used for query (defined via the <quote>sqlcon</quote> parameter).
+				to be used for the query (defined via the <quote>sqlcon</quote> parameter).
 			</para>
 		</listitem>
 		<listitem>
@@ -270,7 +271,7 @@ sql_xquery("ca", "select * from domain", "ra");
 		</title>
 		<para>
 			Make an SQL query using 'connection' and store data in arbitrary
-			PV's specified by 'result' parameter.
+			pseudo variables specified by 'result' parameter.
 		</para>
 		<itemizedlist>
 		<listitem>
@@ -320,7 +321,7 @@ sql_xquery("ca", "select * from domain", "ra");
 ...
 modparam("sqlops","sqlcon","ca=&gt;&exampledb;")
 ...
-sql_xquery("ca", "select 'col1', 2, NULL, 'sip:[email protected]'",
+sql_pvquery("ca", "select 'col1', 2, NULL, 'sip:[email protected]'",
 	"$var(a), $avp(col2), $xavp(item[0]=>s), $ru");
 ...
 </programlisting>
@@ -379,12 +380,12 @@ sql_result_free("ra");
 				</listitem>	  
 				<listitem>
 					<para><emphasis>[row,col]</emphasis> - return the value
-						at position (row,col) in the result set. 'row' and 'col' must
+					at position (row,col) in the result set. 'row' and 'col' must
 					be integer or pseudo-variable holding an integer.</para>
 				</listitem>
 				<listitem>
 					<para><emphasis>colname[N]</emphasis> - return the name
-						of the N-th column in the result set.</para>
+					of the N-th column in the result set.</para>
 				</listitem>	  
 			</itemizedlist>
 
@@ -446,11 +447,11 @@ if (sql_xquery("ca", "select * from domain", "ra") == 1)
 			<title><varname>$sqlrows(con)</varname></title>
 			<para>
 				Number of affected rows of the previous query on the
-				specified connection. Its primary use is to get the number
+				specified connection. It's primary use is to get the number
 				of rows affected by UPDATE, INSERT and DELETE queries.
 			</para>
 			<para>
-				<quote>con</quote> must be the name identifying an SQL
+				<quote>con</quote> must be the name identifying a DB
 				connection.
 			</para>
 			<example>