소스 검색

sqlops: Fixing typo in documentation, minor edits

Olle E. Johansson 12 년 전
부모
커밋
10de949af0
2개의 변경된 파일59개의 추가작업 그리고 58개의 파일을 삭제
  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
 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:
    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
        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
        is accessible via pseudo-variables. Please note that only integer
        and string variables are supported at the moment because of the
        and string variables are supported at the moment because of the
        internal usage of "AVPs" to hold the values. So it is not possible
        internal usage of "AVPs" to hold the values. So it is not possible
        for example to return floating point or big integer values this
        for example to return floating point or big integer values this
        way.
        way.
-     * array indexes - fast access to result values via array position:
+     * Array indexes - fast access to result values via array position:
        [row,column].
        [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.
        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
 2. Dependencies
 
 
@@ -134,27 +134,27 @@ Chapter 1. Admin Guide
 
 
    This parameter may be set multiple times to get many DB connections in
    This parameter may be set multiple times to get many DB connections in
    the same configuration file.
    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.
    Default value is NULL.
 
 
    Example 1.1. Set sqlcon parameter
    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")
 modparam("sqlops","sqlcon","ca=>dbdriver://username:password@dbhost/dbname")
 ...
 ...
 
 
 3.2. sqlres (str)
 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.
    Default value is NULL.
 
 
@@ -170,10 +170,10 @@ modparam("sqlops", "sqlres", "ra")
    4.3. sql_pvquery(connection, query, result)
    4.3. sql_pvquery(connection, query, result)
    4.4. sql_result_free(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'.
    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).
        (defined via the "sqlcon" parameter).
      * query - SQL query string or pseudo-variables containing SQL query.
      * query - SQL query string or pseudo-variables containing SQL query.
      * result - string name to identify the result. Will be used by
      * 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");
 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.
    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).
        (defined via the "sqlcon" parameter).
      * query - SQL query string or pseudo-variables containing SQL query.
      * query - SQL query string or pseudo-variables containing SQL query.
      * result - string name to identify the result xavp. Each row will be
      * 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");
   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
      * connection - the name of the connection to be used for query
        (defined via the "sqlcon" parameter).
        (defined via the "sqlcon" parameter).
      * query - SQL query string or pseudo-variables containing SQL query.
      * 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")
 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");
         "$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'.
    Free data in SQL 'result'.
 
 
@@ -334,10 +334,10 @@ if (sql_xquery("ca", "select * from domain", "ra") == 1)
 5.2. $sqlrows(con)
 5.2. $sqlrows(con)
 
 
    Number of affected rows of the previous query on the specified
    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.
    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
    Example 1.8. $sqlrows(con) usage
 ...
 ...

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

@@ -16,7 +16,7 @@
 	<section>
 	<section>
 	<title>Overview</title>
 	<title>Overview</title>
 	<para>
 	<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>
 	<para>
 	<para>
 		Among the features:
 		Among the features:
@@ -24,22 +24,22 @@
 	<itemizedlist>
 	<itemizedlist>
 		<listitem>
 		<listitem>
 		<para>
 		<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.
 			driver modules at the same time.
 		</para>
 		</para>
 		</listitem>
 		</listitem>
 		<listitem>
 		<listitem>
 		<para>
 		<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
 			many results of different SQL queries in separate structures at
 			the same time. Thus it is possible to work in parallel with several
 			the same time. Thus it is possible to work in parallel with several
-			DB results.
+			queries and results.
 		</para>
 		</para>
 		</listitem>
 		</listitem>
 		<listitem>
 		<listitem>
 		<para>
 		<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
 			of the SQL query result is accessible via pseudo-variables. Please
 			note that only integer and string variables are supported at the
 			note that only integer and string variables are supported at the
 			moment because of the internal usage of <quote>AVPs</quote> to hold
 			moment because of the internal usage of <quote>AVPs</quote> to hold
@@ -49,20 +49,20 @@
 		</listitem>
 		</listitem>
 		<listitem>
 		<listitem>
 		<para>
 		<para>
-			<emphasis>array indexes</emphasis> - fast access to result values
+			<emphasis>Array indexes</emphasis> - fast access to result values
 			via array position: [row,column].
 			via array position: [row,column].
 		</para>
 		</para>
 		</listitem>
 		</listitem>
 		<listitem>
 		<listitem>
 		<para>
 		<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
 			be used many times in the same worker process. Query once, use many
 			times.
 			times.
 		</para>
 		</para>
 		</listitem>
 		</listitem>
 		<listitem>
 		<listitem>
 		<para>
 		<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
 			- columns are accessed by their names, rows by xavp index. Xavp's
 			are available during the transactions lifetime and don't need to
 			are available during the transactions lifetime and don't need to
 			be destroyed manually.
 			be destroyed manually.
@@ -126,13 +126,14 @@
 		<listitem>
 		<listitem>
 		<para>
 		<para>
 			<emphasis>connection_name</emphasis> - string specifying the name
 			<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>
 		</para>
 		</listitem>
 		</listitem>
 		<listitem>
 		<listitem>
 		<para>
 		<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>
 		</para>
 		</listitem>
 		</listitem>
 		</itemizedlist>
 		</itemizedlist>
@@ -145,7 +146,7 @@
 		<title>Set <varname>sqlcon</varname> parameter</title>
 		<title>Set <varname>sqlcon</varname> parameter</title>
 		<programlisting format="linespecific">
 		<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;")
 modparam("sqlops","sqlcon","ca=&gt;&exampledb;")
 ...
 ...
 </programlisting>
 </programlisting>
@@ -154,9 +155,9 @@ modparam("sqlops","sqlcon","ca=&gt;&exampledb;")
 	<section>
 	<section>
 		<title><varname>sqlres</varname> (str)</title>
 		<title><varname>sqlres</varname> (str)</title>
 		<para>
 		<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()
 		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
 		parameter unless you want to use them from within other modules and be
 		available in all application processes.
 		available in all application processes.
 		</para>
 		</para>
@@ -188,7 +189,7 @@ modparam("sqlops", "sqlres", "ra")
 		<listitem>
 		<listitem>
 			<para>
 			<para>
 				<emphasis>connection</emphasis> - the name of the connection
 				<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>
 			</para>
 		</listitem>
 		</listitem>
 		<listitem>
 		<listitem>
@@ -233,7 +234,7 @@ sql_result_free("ra");
 		<listitem>
 		<listitem>
 			<para>
 			<para>
 				<emphasis>connection</emphasis> - the name of the connection
 				<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>
 			</para>
 		</listitem>
 		</listitem>
 		<listitem>
 		<listitem>
@@ -270,7 +271,7 @@ sql_xquery("ca", "select * from domain", "ra");
 		</title>
 		</title>
 		<para>
 		<para>
 			Make an SQL query using 'connection' and store data in arbitrary
 			Make an SQL query using 'connection' and store data in arbitrary
-			PV's specified by 'result' parameter.
+			pseudo variables specified by 'result' parameter.
 		</para>
 		</para>
 		<itemizedlist>
 		<itemizedlist>
 		<listitem>
 		<listitem>
@@ -320,7 +321,7 @@ sql_xquery("ca", "select * from domain", "ra");
 ...
 ...
 modparam("sqlops","sqlcon","ca=&gt;&exampledb;")
 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");
 	"$var(a), $avp(col2), $xavp(item[0]=>s), $ru");
 ...
 ...
 </programlisting>
 </programlisting>
@@ -379,12 +380,12 @@ sql_result_free("ra");
 				</listitem>	  
 				</listitem>	  
 				<listitem>
 				<listitem>
 					<para><emphasis>[row,col]</emphasis> - return the value
 					<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>
 					be integer or pseudo-variable holding an integer.</para>
 				</listitem>
 				</listitem>
 				<listitem>
 				<listitem>
 					<para><emphasis>colname[N]</emphasis> - return the name
 					<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>	  
 				</listitem>	  
 			</itemizedlist>
 			</itemizedlist>
 
 
@@ -446,11 +447,11 @@ if (sql_xquery("ca", "select * from domain", "ra") == 1)
 			<title><varname>$sqlrows(con)</varname></title>
 			<title><varname>$sqlrows(con)</varname></title>
 			<para>
 			<para>
 				Number of affected rows of the previous query on the
 				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.
 				of rows affected by UPDATE, INSERT and DELETE queries.
 			</para>
 			</para>
 			<para>
 			<para>
-				<quote>con</quote> must be the name identifying an SQL
+				<quote>con</quote> must be the name identifying a DB
 				connection.
 				connection.
 			</para>
 			</para>
 			<example>
 			<example>