1999-10-20 22:41:42 +00:00
|
|
|
<reference>
|
1999-06-20 03:04:56 +00:00
|
|
|
<title>Database (dbm-style) abstraction layer functions</title>
|
1999-06-06 18:51:02 +00:00
|
|
|
<titleabbrev>dba</titleabbrev>
|
|
|
|
|
|
|
|
<partintro>
|
|
|
|
<para>
|
|
|
|
These functions build the foundation for accessing Berkeley DB style
|
1999-10-20 22:41:42 +00:00
|
|
|
databases.</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
<para>
|
|
|
|
This is a general abstraction layer for several file-based databases. As
|
|
|
|
such, functionality is limited to a subset of features modern databases
|
1999-10-20 22:41:42 +00:00
|
|
|
such as <ulink url="">Sleepycat Software's DB2</ulink>
|
1999-06-20 03:04:56 +00:00
|
|
|
support. (This is not to be confused with IBM's DB2 software, which is
|
1999-10-20 22:41:42 +00:00
|
|
|
supported through the <link linkend="ref.odbc">ODBC functions</link>.)</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
<para>
|
|
|
|
The behaviour of various aspects depend on the implementation of the
|
|
|
|
underlying database. Functions such as <function>dba_optimize</function>
|
|
|
|
and <function>dba_sync</function> will do what they promise for one
|
1999-10-20 22:41:42 +00:00
|
|
|
database and will do nothing for others.</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
<para>
|
|
|
|
The following handlers are supported:
|
|
|
|
|
|
|
|
<itemizedlist>
|
|
|
|
<listitem><simpara>
|
|
|
|
dbm is the oldest (original) type of Berkeley DB style databases. You
|
|
|
|
should avoid it, if possible. We do not support the compatibility
|
1999-06-20 15:20:41 +00:00
|
|
|
functions built into DB2 and gdbm, because they are only compatible on
|
1999-10-20 22:41:42 +00:00
|
|
|
the source code level, but cannot handle the original dbm format.</simpara></listitem>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
<listitem><simpara>
|
|
|
|
ndbm is a newer type and more flexible than dbm. It still has most of the
|
1999-10-20 22:41:42 +00:00
|
|
|
arbitrary limits of dbm (therefore it is deprecated).</simpara></listitem>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
<listitem><simpara>
|
1999-10-20 22:41:42 +00:00
|
|
|
gdbm is the <ulink url="">GNU database manager</ulink>.</simpara></listitem>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
<listitem><simpara>
|
1999-10-20 22:41:42 +00:00
|
|
|
db2 is <ulink url="">Sleepycat Software's DB2</ulink>. It
|
1999-06-06 18:51:02 +00:00
|
|
|
is described as "a programmatic toolkit that provides high-performance
|
|
|
|
built-in database support for both standalone and client/server
|
1999-10-20 22:41:42 +00:00
|
|
|
applications."</simpara></listitem>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
<listitem><simpara>
|
|
|
|
cdb is "a fast, reliable, lightweight package for creating and reading
|
|
|
|
constant databases." It is from the author of qmail and can be found
|
1999-10-20 22:41:42 +00:00
|
|
|
<ulink url="">here</ulink>. Since it is constant, we support
|
|
|
|
only reading operations.</simpara></listitem>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
1999-10-20 22:41:42 +00:00
|
|
|
</itemizedlist></para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
<para>
|
|
|
|
<example>
|
|
|
|
<title>DBA example</title>
|
|
|
|
<programlisting>
|
|
|
|
<?php
|
|
|
|
|
|
|
|
$id = dba_open("/tmp/test.db", "n", "db2");
|
|
|
|
|
|
|
|
if(!$id) {
|
|
|
|
echo "dba_open failed\n";
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
|
|
|
dba_replace("key", "This is an example!", $id);
|
|
|
|
|
|
|
|
if(dba_exists("key", $id)) {
|
|
|
|
echo dba_fetch("key", $id);
|
|
|
|
dba_delete("key", $id);
|
|
|
|
}
|
|
|
|
|
|
|
|
dba_close($id);
|
|
|
|
?>
|
1999-10-20 22:41:42 +00:00
|
|
|
</programlisting></example></para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
<para>
|
|
|
|
DBA is binary safe and does not have any arbitrary limits. It inherits all
|
1999-10-20 22:41:42 +00:00
|
|
|
limits set by the underlying database implementation.</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
<para>
|
|
|
|
All file-based databases must provide a way of setting the file mode of a
|
|
|
|
new created database, if that is possible at all. The file mode is commonly
|
|
|
|
passed as the fourth argument to <function>dba_open</function> or
|
1999-10-20 22:41:42 +00:00
|
|
|
<function>dba_popen</function>.</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
<para>
|
|
|
|
You can access all entries of a database in a linear way by using the
|
|
|
|
<function>dba_firstkey</function> and <function>dba_nextkey</function>
|
1999-10-20 22:41:42 +00:00
|
|
|
functions. You may not change the database while traversing it.</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
<para>
|
|
|
|
<example>
|
|
|
|
<title>Traversing a database</title>
|
|
|
|
<programlisting>
|
|
|
|
<?php
|
|
|
|
|
|
|
|
# ...open database...
|
|
|
|
|
|
|
|
$key = dba_firstkey($id);
|
|
|
|
|
|
|
|
while($key != false) {
|
|
|
|
if(...) { # remember the key to perform some action later
|
|
|
|
$handle_later[] = $key;
|
|
|
|
}
|
|
|
|
$key = dba_nextkey($id);
|
|
|
|
}
|
1999-06-20 15:20:41 +00:00
|
|
|
|
|
|
|
for($i = 0; $i < count($handle_later); $i++)
|
|
|
|
dba_delete($handle_later[$i], $id);
|
|
|
|
|
1999-06-06 18:51:02 +00:00
|
|
|
?>
|
1999-10-20 22:41:42 +00:00
|
|
|
</programlisting>
|
|
|
|
</example>
|
|
|
|
</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
</partintro>
|
|
|
|
|
1999-10-20 22:41:42 +00:00
|
|
|
<refentry>
|
1999-06-06 18:51:02 +00:00
|
|
|
<refnamediv>
|
|
|
|
<refname>dba_close</refname>
|
|
|
|
<refpurpose>Close database</refpurpose>
|
|
|
|
</refnamediv>
|
|
|
|
<refsect1>
|
|
|
|
<title>Description</title>
|
|
|
|
<funcsynopsis>
|
|
|
|
<funcdef>void <function>dba_close</function></funcdef>
|
|
|
|
<paramdef>int <parameter>handle</parameter></paramdef>
|
|
|
|
</funcsynopsis>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
<function>dba_close</function> closes the established database and frees
|
1999-10-20 22:41:42 +00:00
|
|
|
all resources specified by <parameter>handle</parameter>.</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
<para>
|
|
|
|
<parameter>handle</parameter> is a database handle returned by
|
1999-10-20 22:41:42 +00:00
|
|
|
<function>dba_open</function>.</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
<para>
|
1999-10-20 22:41:42 +00:00
|
|
|
<function>dba_close</function> does not return any value.</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
<para>
|
|
|
|
See also:
|
|
|
|
<function>dba_open</function>
|
|
|
|
<function>dba_popen</function>
|
1999-10-20 22:41:42 +00:00
|
|
|
</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
</refsect1>
|
|
|
|
</refentry>
|
|
|
|
|
1999-10-20 22:41:42 +00:00
|
|
|
<refentry>
|
1999-06-06 18:51:02 +00:00
|
|
|
<refnamediv>
|
|
|
|
<refname>dba_delete</refname>
|
|
|
|
<refpurpose>Delete entry specified by key</refpurpose>
|
|
|
|
</refnamediv>
|
|
|
|
<refsect1>
|
|
|
|
<title>Description</title>
|
|
|
|
<funcsynopsis>
|
|
|
|
<funcdef>string <function>dba_delete</function></funcdef>
|
|
|
|
<paramdef>string <parameter>key</parameter></paramdef>
|
|
|
|
<paramdef>int <parameter>handle</parameter></paramdef>
|
|
|
|
</funcsynopsis>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
<function>dba_delete</function> deletes the entry specified by
|
|
|
|
<parameter>key</parameter> from the database specified with
|
1999-10-20 22:41:42 +00:00
|
|
|
<parameter>handle</parameter>.</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
<para>
|
1999-10-20 22:41:42 +00:00
|
|
|
<parameter>key</parameter> is the key of the entry which is deleted.</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
<para>
|
|
|
|
<parameter>handle</parameter> is a database handle returned by
|
1999-10-20 22:41:42 +00:00
|
|
|
<function>dba_open</function>.</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
<para>
|
|
|
|
<function>dba_delete</function> returns true or false, if the entry is
|
1999-10-20 22:41:42 +00:00
|
|
|
deleted or not deleted, respectively.</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
<para>
|
|
|
|
See also:
|
|
|
|
<function>dba_exists</function>
|
|
|
|
<function>dba_fetch</function>
|
|
|
|
<function>dba_insert</function>
|
|
|
|
<function>dba_replace</function>
|
1999-10-20 22:41:42 +00:00
|
|
|
</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
</refsect1>
|
|
|
|
</refentry>
|
|
|
|
|
1999-10-20 22:41:42 +00:00
|
|
|
<refentry>
|
1999-06-06 18:51:02 +00:00
|
|
|
<refnamediv>
|
|
|
|
<refname>dba_exists</refname>
|
|
|
|
<refpurpose>Check whether key exists</refpurpose>
|
|
|
|
</refnamediv>
|
|
|
|
<refsect1>
|
|
|
|
<title>Description</title>
|
|
|
|
<funcsynopsis>
|
|
|
|
<funcdef>bool <function>dba_exists</function></funcdef>
|
|
|
|
<paramdef>string <parameter>key</parameter></paramdef>
|
|
|
|
<paramdef>int <parameter>handle</parameter></paramdef>
|
|
|
|
</funcsynopsis>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
<function>dba_exists</function> checks whether the specified
|
|
|
|
<parameter>key</parameter> exists in the database specified by
|
1999-10-20 22:41:42 +00:00
|
|
|
<parameter>handle</parameter>.</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
<para>
|
1999-10-20 22:41:42 +00:00
|
|
|
<parameter>key</parameter> is the key the check is performed for.</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
<para>
|
|
|
|
<parameter>handle</parameter> is a database handle returned by
|
1999-10-20 22:41:42 +00:00
|
|
|
<function>dba_open</function>.</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
<para>
|
|
|
|
<function>dba_exists</function> returns true or false, if the key is found
|
1999-10-20 22:41:42 +00:00
|
|
|
or not found, respectively.</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
<para>
|
|
|
|
See also:
|
|
|
|
<function>dba_fetch</function>
|
|
|
|
<function>dba_delete</function>
|
|
|
|
<function>dba_insert</function>
|
|
|
|
<function>dba_replace</function>
|
1999-10-20 22:41:42 +00:00
|
|
|
</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
</refsect1>
|
|
|
|
</refentry>
|
|
|
|
|
1999-10-20 22:41:42 +00:00
|
|
|
<refentry>
|
1999-06-06 18:51:02 +00:00
|
|
|
<refnamediv>
|
|
|
|
<refname>dba_fetch</refname>
|
|
|
|
<refpurpose>Fetch data specified by key</refpurpose>
|
|
|
|
</refnamediv>
|
|
|
|
<refsect1>
|
|
|
|
<title>Description</title>
|
|
|
|
<funcsynopsis>
|
|
|
|
<funcdef>string <function>dba_fetch</function></funcdef>
|
|
|
|
<paramdef>string <parameter>key</parameter></paramdef>
|
|
|
|
<paramdef>int <parameter>handle</parameter></paramdef>
|
|
|
|
</funcsynopsis>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
<function>dba_fetch</function> fetches the data specified by
|
|
|
|
<parameter>key</parameter> from the database specified with
|
1999-10-20 22:41:42 +00:00
|
|
|
<parameter>handle</parameter>.</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
<para>
|
1999-10-20 22:41:42 +00:00
|
|
|
<parameter>key</parameter> is the key the data is specified by.</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
<para>
|
|
|
|
<parameter>handle</parameter> is a database handle returned by
|
1999-10-20 22:41:42 +00:00
|
|
|
<function>dba_open</function>.</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
<para>
|
|
|
|
<function>dba_fetch</function> returns the associated string or false, if
|
1999-10-20 22:41:42 +00:00
|
|
|
the key/data pair is found or not found, respectively.</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
<para>
|
|
|
|
See also:
|
|
|
|
<function>dba_exists</function>
|
|
|
|
<function>dba_delete</function>
|
|
|
|
<function>dba_insert</function>
|
|
|
|
<function>dba_replace</function>
|
1999-10-20 22:41:42 +00:00
|
|
|
</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
</refsect1>
|
|
|
|
</refentry>
|
|
|
|
|
1999-10-20 22:41:42 +00:00
|
|
|
<refentry>
|
1999-06-06 18:51:02 +00:00
|
|
|
<refnamediv>
|
|
|
|
<refname>dba_firstkey</refname>
|
|
|
|
<refpurpose>Fetch first key</refpurpose>
|
|
|
|
</refnamediv>
|
|
|
|
<refsect1>
|
|
|
|
<title>Description</title>
|
|
|
|
<funcsynopsis>
|
|
|
|
<funcdef>string <function>dba_firstkey</function></funcdef>
|
|
|
|
<paramdef>int <parameter>handle</parameter></paramdef>
|
|
|
|
</funcsynopsis>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
<function>dba_firstkey</function> returns the first key of the database
|
|
|
|
specified by <parameter>handle</parameter> and resets the internal key
|
1999-10-20 22:41:42 +00:00
|
|
|
pointer. This permits a linear search through the whole database.</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
<para>
|
|
|
|
<parameter>handle</parameter> is a database handle returned by
|
1999-10-20 22:41:42 +00:00
|
|
|
<function>dba_open</function>.</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
<para>
|
|
|
|
<function>dba_firstkey</function> returns the key or false depending on
|
1999-10-20 22:41:42 +00:00
|
|
|
whether it succeeds or fails, respectively.</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
<para>
|
|
|
|
See also:
|
|
|
|
<function>dba_nextkey</function>
|
1999-10-20 22:41:42 +00:00
|
|
|
</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
</refsect1>
|
|
|
|
</refentry>
|
|
|
|
|
1999-10-20 22:41:42 +00:00
|
|
|
<refentry>
|
1999-06-06 18:51:02 +00:00
|
|
|
<refnamediv>
|
|
|
|
<refname>dba_insert</refname>
|
|
|
|
<refpurpose>Insert entry</refpurpose>
|
|
|
|
</refnamediv>
|
|
|
|
<refsect1>
|
|
|
|
<title>Description</title>
|
|
|
|
<funcsynopsis>
|
|
|
|
<funcdef>bool <function>dba_insert</function></funcdef>
|
|
|
|
<paramdef>string <parameter>key</parameter></paramdef>
|
|
|
|
<paramdef>string <parameter>value</parameter></paramdef>
|
|
|
|
<paramdef>int <parameter>handle</parameter></paramdef>
|
|
|
|
</funcsynopsis>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
<function>dba_insert</function> inserts the entry described with
|
|
|
|
<parameter>key</parameter> and <parameter>value</parameter> into the
|
|
|
|
database specified by <parameter>handle</parameter>. It fails, if an entry
|
1999-10-20 22:41:42 +00:00
|
|
|
with the same <parameter>key</parameter> already exists.</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
<para>
|
1999-10-20 22:41:42 +00:00
|
|
|
<parameter>key</parameter> is the key of the entry to be inserted.</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
<para>
|
1999-10-20 22:41:42 +00:00
|
|
|
<parameter>value</parameter> is the value to be inserted.</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
<para>
|
|
|
|
<parameter>handle</parameter> is a database handle returned by
|
1999-10-20 22:41:42 +00:00
|
|
|
<function>dba_open</function>.</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
<para>
|
|
|
|
<function>dba_insert</function> returns true or false, depending on
|
1999-10-20 22:41:42 +00:00
|
|
|
whether it succeeds of fails, respectively.</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
<para>
|
|
|
|
See also:
|
|
|
|
<function>dba_exists</function>
|
|
|
|
<function>dba_delete</function>
|
|
|
|
<function>dba_fetch</function>
|
|
|
|
<function>dba_replace</function>
|
1999-10-20 22:41:42 +00:00
|
|
|
</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
</refsect1>
|
|
|
|
</refentry>
|
|
|
|
|
1999-10-20 22:41:42 +00:00
|
|
|
<refentry>
|
1999-06-06 18:51:02 +00:00
|
|
|
<refnamediv>
|
|
|
|
<refname>dba_nextkey</refname>
|
|
|
|
<refpurpose>Fetch next key</refpurpose>
|
|
|
|
</refnamediv>
|
|
|
|
<refsect1>
|
|
|
|
<title>Description</title>
|
|
|
|
<funcsynopsis>
|
|
|
|
<funcdef>string <function>dba_nextkey</function></funcdef>
|
|
|
|
<paramdef>int <parameter>handle</parameter></paramdef>
|
|
|
|
</funcsynopsis>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
<function>dba_nextkey</function> returns the next key of the database
|
|
|
|
specified by <parameter>handle</parameter> and increments the internal
|
1999-10-20 22:41:42 +00:00
|
|
|
key pointer.</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
<para>
|
|
|
|
<parameter>handle</parameter> is a database handle returned by
|
1999-10-20 22:41:42 +00:00
|
|
|
<function>dba_open</function>.</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
<para>
|
|
|
|
<function>dba_nextkey</function> returns the key or false depending on
|
1999-10-20 22:41:42 +00:00
|
|
|
whether it succeeds or fails, respectively.</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
<para>
|
|
|
|
See also:
|
|
|
|
<function>dba_firstkey</function>
|
1999-10-20 22:41:42 +00:00
|
|
|
</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
</refsect1>
|
|
|
|
</refentry>
|
|
|
|
|
1999-10-20 22:41:42 +00:00
|
|
|
<refentry>
|
1999-06-06 18:51:02 +00:00
|
|
|
<refnamediv>
|
|
|
|
<refname>dba_popen</refname>
|
|
|
|
<refpurpose>Open database persistently</refpurpose>
|
|
|
|
</refnamediv>
|
|
|
|
<refsect1>
|
|
|
|
<title>Description</title>
|
|
|
|
<funcsynopsis>
|
|
|
|
<funcdef>int <function>dba_popen</function></funcdef>
|
|
|
|
<paramdef>string <parameter>path</parameter></paramdef>
|
|
|
|
<paramdef>string <parameter>mode</parameter></paramdef>
|
|
|
|
<paramdef>string <parameter>handler</parameter></paramdef>
|
|
|
|
<paramdef><parameter><optional>...</optional></parameter></paramdef>
|
|
|
|
</funcsynopsis>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
<function>dba_popen</function> establishes a persistent database instance
|
|
|
|
for <parameter>path</parameter> with <parameter>mode</parameter> using
|
1999-10-20 22:41:42 +00:00
|
|
|
<parameter>handler</parameter>.</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
<para>
|
1999-10-20 22:41:42 +00:00
|
|
|
<parameter>path</parameter> is commonly a regular path in your filesystem.</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
<para>
|
|
|
|
<parameter>mode</parameter> is "r" for read access, "w" for read/write
|
1999-06-22 21:49:39 +00:00
|
|
|
access to an already existing database, "c" for read/write access
|
|
|
|
and database creation if it doesn't currently exist, and "n" for
|
1999-10-20 22:41:42 +00:00
|
|
|
create, truncate and read/write access.</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
<para>
|
|
|
|
<parameter>handler</parameter> is the name of the handler which shall be
|
|
|
|
used for accessing <parameter>path</parameter>. It is passed all optional
|
|
|
|
parameters given to <function>dba_popen</function> and can act on behalf
|
1999-10-20 22:41:42 +00:00
|
|
|
of them.</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
<para>
|
|
|
|
<function>dba_popen</function> returns a positive handler id or false, in
|
1999-10-20 22:41:42 +00:00
|
|
|
the case the open is successful or fails, respectively.</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
<para>
|
|
|
|
See also:
|
|
|
|
<function>dba_open</function>
|
|
|
|
<function>dba_close</function>
|
1999-10-20 22:41:42 +00:00
|
|
|
</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
</refsect1>
|
|
|
|
</refentry>
|
|
|
|
|
1999-10-20 22:41:42 +00:00
|
|
|
<refentry>
|
1999-06-06 18:51:02 +00:00
|
|
|
<refnamediv>
|
|
|
|
<refname>dba_open</refname>
|
|
|
|
<refpurpose>Open database</refpurpose>
|
|
|
|
</refnamediv>
|
|
|
|
<refsect1>
|
|
|
|
<title>Description</title>
|
|
|
|
<funcsynopsis>
|
|
|
|
<funcdef>int <function>dba_open</function></funcdef>
|
|
|
|
<paramdef>string <parameter>path</parameter></paramdef>
|
|
|
|
<paramdef>string <parameter>mode</parameter></paramdef>
|
|
|
|
<paramdef>string <parameter>handler</parameter></paramdef>
|
|
|
|
<paramdef><parameter><optional>...</optional></parameter></paramdef>
|
|
|
|
</funcsynopsis>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
<function>dba_open</function> establishes a database instance for
|
|
|
|
<parameter>path</parameter> with <parameter>mode</parameter> using
|
1999-10-20 22:41:42 +00:00
|
|
|
<parameter>handler</parameter>.</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
<para>
|
1999-10-20 22:41:42 +00:00
|
|
|
<parameter>path</parameter> is commonly a regular path in your filesystem.</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
<para>
|
|
|
|
<parameter>mode</parameter> is "r" for read access, "w" for read/write
|
1999-06-22 21:49:39 +00:00
|
|
|
access to an already existing database, "c" for read/write access
|
|
|
|
and database creation if it doesn't currently exist, and "n" for
|
1999-10-20 22:41:42 +00:00
|
|
|
create, truncate and read/write access.</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
<para>
|
|
|
|
<parameter>handler</parameter> is the name of the handler which shall be
|
|
|
|
used for accessing <parameter>path</parameter>. It is passed all optional
|
|
|
|
parameters given to <function>dba_open</function> and can act on behalf of
|
1999-10-20 22:41:42 +00:00
|
|
|
them.</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
<para>
|
|
|
|
<function>dba_open</function> returns a positive handler id or false, in
|
1999-10-20 22:41:42 +00:00
|
|
|
the case the open is successful or fails, respectively.</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
<para>
|
|
|
|
See also:
|
|
|
|
<function>dba_popen</function>
|
|
|
|
<function>dba_close</function>
|
1999-10-20 22:41:42 +00:00
|
|
|
</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
</refsect1>
|
|
|
|
</refentry>
|
|
|
|
|
1999-10-20 22:41:42 +00:00
|
|
|
<refentry>
|
1999-06-06 18:51:02 +00:00
|
|
|
<refnamediv>
|
|
|
|
<refname>dba_optimize</refname>
|
|
|
|
<refpurpose>Optimize database</refpurpose>
|
|
|
|
</refnamediv>
|
|
|
|
<refsect1>
|
|
|
|
<title>Description</title>
|
|
|
|
<funcsynopsis>
|
|
|
|
<funcdef>bool <function>dba_optimize</function></funcdef>
|
|
|
|
<paramdef>int <parameter>handle</parameter></paramdef>
|
|
|
|
</funcsynopsis>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
<function>dba_optimize</function> optimizes the underlying database
|
1999-10-20 22:41:42 +00:00
|
|
|
specified by <parameter>handle</parameter>.</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
<para>
|
|
|
|
<parameter>handle</parameter> is a database handle returned by
|
1999-10-20 22:41:42 +00:00
|
|
|
<function>dba_open</function>.</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
<para>
|
|
|
|
<function>dba_optimize</function> returns true or false, if the
|
1999-10-20 22:41:42 +00:00
|
|
|
optimization succeeds or fails, respectively.</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
<para>
|
|
|
|
See also:
|
|
|
|
<function>dba_sync</function>
|
1999-10-20 22:41:42 +00:00
|
|
|
</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
</refsect1>
|
|
|
|
</refentry>
|
|
|
|
|
1999-10-20 22:41:42 +00:00
|
|
|
<refentry>
|
1999-06-06 18:51:02 +00:00
|
|
|
<refnamediv>
|
|
|
|
<refname>dba_replace</refname>
|
|
|
|
<refpurpose>Replace or insert entry</refpurpose>
|
|
|
|
</refnamediv>
|
|
|
|
<refsect1>
|
|
|
|
<title>Description</title>
|
|
|
|
<funcsynopsis>
|
|
|
|
<funcdef>bool <function>dba_replace</function></funcdef>
|
|
|
|
<paramdef>string <parameter>key</parameter></paramdef>
|
|
|
|
<paramdef>string <parameter>value</parameter></paramdef>
|
|
|
|
<paramdef>int <parameter>handle</parameter></paramdef>
|
|
|
|
</funcsynopsis>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
<function>dba_replace</function> replaces or inserts the entry described
|
|
|
|
with <parameter>key</parameter> and <parameter>value</parameter> into the
|
1999-10-20 22:41:42 +00:00
|
|
|
database specified by <parameter>handle</parameter>.</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
<para>
|
1999-10-20 22:41:42 +00:00
|
|
|
<parameter>key</parameter> is the key of the entry to be inserted.</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
<para>
|
1999-10-20 22:41:42 +00:00
|
|
|
<parameter>value</parameter> is the value to be inserted.</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
<para>
|
|
|
|
<parameter>handle</parameter> is a database handle returned by
|
1999-10-20 22:41:42 +00:00
|
|
|
<function>dba_open</function>.</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
<para>
|
|
|
|
<function>dba_replace</function> returns true or false, depending on
|
1999-10-20 22:41:42 +00:00
|
|
|
whether it succeeds of fails, respectively.</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
<para>
|
|
|
|
See also:
|
|
|
|
<function>dba_exists</function>
|
|
|
|
<function>dba_delete</function>
|
|
|
|
<function>dba_fetch</function>
|
|
|
|
<function>dba_insert</function>
|
1999-10-20 22:41:42 +00:00
|
|
|
</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
</refsect1>
|
|
|
|
</refentry>
|
|
|
|
|
1999-10-20 22:41:42 +00:00
|
|
|
<refentry>
|
1999-06-06 18:51:02 +00:00
|
|
|
<refnamediv>
|
|
|
|
<refname>dba_sync</refname>
|
|
|
|
<refpurpose>Synchronize database</refpurpose>
|
|
|
|
</refnamediv>
|
|
|
|
<refsect1>
|
|
|
|
<title>Description</title>
|
|
|
|
<funcsynopsis>
|
|
|
|
<funcdef>bool <function>dba_sync</function></funcdef>
|
|
|
|
<paramdef>int <parameter>handle</parameter></paramdef>
|
|
|
|
</funcsynopsis>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
<function>dba_sync</function> synchronizes the database specified by
|
|
|
|
<parameter>handle</parameter>. This will probably trigger a physical write
|
1999-10-20 22:41:42 +00:00
|
|
|
to disk, if supported.</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
<para>
|
|
|
|
<parameter>handle</parameter> is a database handle returned by
|
1999-10-20 22:41:42 +00:00
|
|
|
<function>dba_open</function>.</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
<para>
|
|
|
|
<function>dba_sync</function> returns true or false, if the
|
1999-10-20 22:41:42 +00:00
|
|
|
synchronization succeeds or fails, respectively.</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
<para>
|
|
|
|
See also:
|
|
|
|
<function>dba_optimize</function>
|
1999-10-20 22:41:42 +00:00
|
|
|
</para>
|
1999-06-06 18:51:02 +00:00
|
|
|
|
|
|
|
</refsect1>
|
|
|
|
</refentry>
|
|
|
|
</reference>
|
1999-10-20 22:41:42 +00:00
|
|
|
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
|
|
Local variables:
|
|
|
|
mode: sgml
|
|
|
|
sgml-omittag:t
|
|
|
|
sgml-shorttag:t
|
|
|
|
sgml-minimize-attributes:nil
|
|
|
|
sgml-always-quote-attributes:t
|
|
|
|
sgml-indent-step:1
|
|
|
|
sgml-indent-data:t
|
|
|
|
sgml-parent-document:nil
|
|
|
|
sgml-default-dtd-file:"../manual.ced"
|
|
|
|
sgml-exposed-tags:nil
|
|
|
|
sgml-local-catalogs:nil
|
|
|
|
sgml-local-ecat-files:nil
|
|
|
|
End:
|
|
|
|
-->
|