1 | <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>ldb</title><link rel="stylesheet" href="../samba.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.74.0"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en"><a name="ldb.3"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ldb<p><b>The Samba Project</b></p> — A light-weight database library</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">#include <ldb.h></pre></div><div class="refsect1" lang="en"><a name="id2522906"></a><h2>description</h2><p>
|
---|
2 | ldb is a light weight embedded database library and API. With a
|
---|
3 | programming interface that is very similar to LDAP, ldb can store its
|
---|
4 | data either in a tdb(3) database or in a real LDAP database.
|
---|
5 | </p><p>
|
---|
6 | When used with the tdb backend ldb does not require any database
|
---|
7 | daemon. Instead, ldb function calls are processed immediately by the
|
---|
8 | ldb library, which does IO directly on the database, while allowing
|
---|
9 | multiple readers/writers using operating system byte range locks. This
|
---|
10 | leads to an API with very low overheads, often resulting in speeds of
|
---|
11 | more than 10x what can be achieved with a more traditional LDAP
|
---|
12 | architecture.
|
---|
13 | </p><p>
|
---|
14 | In a taxonomy of databases ldb would sit half way between key/value
|
---|
15 | pair databases (such as berkley db or tdb) and a full LDAP
|
---|
16 | database. With a structured attribute oriented API like LDAP and good
|
---|
17 | indexing capabilities, ldb can be used for quite sophisticated
|
---|
18 | applications that need a light weight database, without the
|
---|
19 | administrative overhead of a full LDAP installation.
|
---|
20 | </p><p>
|
---|
21 | Included with ldb are a number of useful command line tools for
|
---|
22 | manipulating a ldb database. These tools are similar in style to the
|
---|
23 | equivalent ldap command line tools.
|
---|
24 | </p><p>
|
---|
25 | In its default mode of operation with a tdb backend, ldb can also be
|
---|
26 | seen as a "schema-less LDAP". By default ldb does not require a
|
---|
27 | schema, which greatly reduces the complexity of getting started with
|
---|
28 | ldb databases. As the complexity of you application grows you can take
|
---|
29 | advantage of some of the optional schema-like attributes that ldb
|
---|
30 | offers, or you can migrate to using the full LDAP api while keeping
|
---|
31 | your exiting ldb code.
|
---|
32 | </p><p>
|
---|
33 | If you are new to ldb, then I suggest starting with the manual pages
|
---|
34 | for ldbsearch(1) and ldbedit(1), and experimenting with a local
|
---|
35 | database. Then I suggest you look at the ldb_connect(3) and
|
---|
36 | ldb_search(3) manual pages.
|
---|
37 | </p></div><div class="refsect1" lang="en"><a name="id2483332"></a><h2>TOOLS</h2><div class="itemizedlist"><ul type="disc"><li><p>
|
---|
38 | <span class="application">ldbsearch(1)</span>
|
---|
39 | - command line ldb search utility
|
---|
40 | </p></li><li><p>
|
---|
41 | <span class="application">ldbedit(1)</span>
|
---|
42 | - edit all or part of a ldb database using your favourite editor
|
---|
43 | </p></li><li><p>
|
---|
44 | <span class="application">ldbadd(1)</span>
|
---|
45 | - add records to a ldb database using LDIF formatted input
|
---|
46 | </p></li><li><p>
|
---|
47 | <span class="application">ldbdel(1)</span>
|
---|
48 | - delete records from a ldb database
|
---|
49 | </p></li><li><p>
|
---|
50 | <span class="application">ldbmodify(1)</span>
|
---|
51 | - modify records in a ldb database using LDIF formatted input
|
---|
52 | </p></li></ul></div></div><div class="refsect1" lang="en"><a name="id2483518"></a><h2>FUNCTIONS</h2><div class="itemizedlist"><ul type="disc"><li><p>
|
---|
53 | <code class="function">ldb_connect(3)</code>
|
---|
54 | - connect to a ldb backend
|
---|
55 | </p></li><li><p>
|
---|
56 | <code class="function">ldb_search(3)</code>
|
---|
57 | - perform a database search
|
---|
58 | </p></li><li><p>
|
---|
59 | <code class="function">ldb_add(3)</code>
|
---|
60 | - add a record to the database
|
---|
61 | </p></li><li><p>
|
---|
62 | <code class="function">ldb_delete(3)</code>
|
---|
63 | - delete a record from the database
|
---|
64 | </p></li><li><p>
|
---|
65 | <code class="function">ldb_modify(3)</code>
|
---|
66 | - modify a record in the database
|
---|
67 | </p></li><li><p>
|
---|
68 | <code class="function">ldb_errstring(3)</code>
|
---|
69 | - retrieve extended error information from the last operation
|
---|
70 | </p></li><li><p>
|
---|
71 | <code class="function">ldb_ldif_write(3)</code>
|
---|
72 | - write a LDIF formatted message
|
---|
73 | </p></li><li><p>
|
---|
74 | <code class="function">ldb_ldif_write_file(3)</code>
|
---|
75 | - write a LDIF formatted message to a file
|
---|
76 | </p></li><li><p>
|
---|
77 | <code class="function">ldb_ldif_read(3)</code>
|
---|
78 | - read a LDIF formatted message
|
---|
79 | </p></li><li><p>
|
---|
80 | <code class="function">ldb_ldif_read_free(3)</code>
|
---|
81 | - free the result of a ldb_ldif_read()
|
---|
82 | </p></li><li><p>
|
---|
83 | <code class="function">ldb_ldif_read_file(3)</code>
|
---|
84 | - read a LDIF message from a file
|
---|
85 | </p></li><li><p>
|
---|
86 | <code class="function">ldb_ldif_read_string(3)</code>
|
---|
87 | - read a LDIF message from a string
|
---|
88 | </p></li><li><p>
|
---|
89 | <code class="function">ldb_msg_find_element(3)</code>
|
---|
90 | - find an element in a ldb_message
|
---|
91 | </p></li><li><p>
|
---|
92 | <code class="function">ldb_val_equal_exact(3)</code>
|
---|
93 | - compare two ldb_val structures
|
---|
94 | </p></li><li><p>
|
---|
95 | <code class="function">ldb_msg_find_val(3)</code>
|
---|
96 | - find an element by value
|
---|
97 | </p></li><li><p>
|
---|
98 | <code class="function">ldb_msg_add_empty(3)</code>
|
---|
99 | - add an empty message element to a ldb_message
|
---|
100 | </p></li><li><p>
|
---|
101 | <code class="function">ldb_msg_add(3)</code>
|
---|
102 | - add a non-empty message element to a ldb_message
|
---|
103 | </p></li><li><p>
|
---|
104 | <code class="function">ldb_msg_element_compare(3)</code>
|
---|
105 | - compare two ldb_message_element structures
|
---|
106 | </p></li><li><p>
|
---|
107 | <code class="function">ldb_msg_find_int(3)</code>
|
---|
108 | - return an integer value from a ldb_message
|
---|
109 | </p></li><li><p>
|
---|
110 | <code class="function">ldb_msg_find_uint(3)</code>
|
---|
111 | - return an unsigned integer value from a ldb_message
|
---|
112 | </p></li><li><p>
|
---|
113 | <code class="function">ldb_msg_find_double(3)</code>
|
---|
114 | - return a double value from a ldb_message
|
---|
115 | </p></li><li><p>
|
---|
116 | <code class="function">ldb_msg_find_string(3)</code>
|
---|
117 | - return a string value from a ldb_message
|
---|
118 | </p></li><li><p>
|
---|
119 | <code class="function">ldb_set_alloc(3)</code>
|
---|
120 | - set the memory allocation function to be used by ldb
|
---|
121 | </p></li><li><p>
|
---|
122 | <code class="function">ldb_set_debug(3)</code>
|
---|
123 | - set a debug handler to be used by ldb
|
---|
124 | </p></li><li><p>
|
---|
125 | <code class="function">ldb_set_debug_stderr(3)</code>
|
---|
126 | - set a debug handler for stderr output
|
---|
127 | </p></li></ul></div></div><div class="refsect1" lang="en"><a name="id2481467"></a><h2>Author</h2><p>
|
---|
128 | ldb was written by
|
---|
129 | <a class="ulink" href="http://samba.org/~tridge/" target="_top">Andrew Tridgell</a>.
|
---|
130 | </p><p>
|
---|
131 | If you wish to report a problem or make a suggestion then please see
|
---|
132 | the <a class="ulink" href="http://ldb.samba.org/" target="_top">http://ldb.samba.org/</a> web site for
|
---|
133 | current contact and maintainer information.
|
---|
134 | </p><p>
|
---|
135 | ldb is released under the GNU Lesser General Public License version 2
|
---|
136 | or later. Please see the file COPYING for license details.
|
---|
137 | </p></div></div></body></html>
|
---|