1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
6 <refentrytitle>ldb</refentrytitle>
7 <manvolnum>3</manvolnum>
8 <refmiscinfo class="source">Samba</refmiscinfo>
9 <refmiscinfo class="manual">C Library Functions</refmiscinfo>
10 <refmiscinfo class="version">3.5</refmiscinfo>
14 <refname>ldb</refname>
15 <refclass>The Samba Project</refclass>
16 <refpurpose>A light-weight database library</refpurpose>
20 <synopsis>#include <ldb.h></synopsis>
24 <title>description</title>
27 ldb is a light weight embedded database library and API. With a
28 programming interface that is very similar to LDAP, ldb can store its
29 data either in a tdb(3) database or in a real LDAP database.
33 When used with the tdb backend ldb does not require any database
34 daemon. Instead, ldb function calls are processed immediately by the
35 ldb library, which does IO directly on the database, while allowing
36 multiple readers/writers using operating system byte range locks. This
37 leads to an API with very low overheads, often resulting in speeds of
38 more than 10x what can be achieved with a more traditional LDAP
43 In a taxonomy of databases ldb would sit half way between key/value
44 pair databases (such as berkley db or tdb) and a full LDAP
45 database. With a structured attribute oriented API like LDAP and good
46 indexing capabilities, ldb can be used for quite sophisticated
47 applications that need a light weight database, without the
48 administrative overhead of a full LDAP installation.
52 Included with ldb are a number of useful command line tools for
53 manipulating a ldb database. These tools are similar in style to the
54 equivalent ldap command line tools.
58 In its default mode of operation with a tdb backend, ldb can also be
59 seen as a "schema-less LDAP". By default ldb does not require a
60 schema, which greatly reduces the complexity of getting started with
61 ldb databases. As the complexity of you application grows you can take
62 advantage of some of the optional schema-like attributes that ldb
63 offers, or you can migrate to using the full LDAP api while keeping
64 your exiting ldb code.
68 If you are new to ldb, then I suggest starting with the manual pages
69 for ldbsearch(1) and ldbedit(1), and experimenting with a local
70 database. Then I suggest you look at the ldb_connect(3) and
71 ldb_search(3) manual pages.
80 <application>ldbsearch(1)</application>
81 - command line ldb search utility
85 <application>ldbedit(1)</application>
86 - edit all or part of a ldb database using your favourite editor
90 <application>ldbadd(1)</application>
91 - add records to a ldb database using LDIF formatted input
95 <application>ldbdel(1)</application>
96 - delete records from a ldb database
100 <application>ldbmodify(1)</application>
101 - modify records in a ldb database using LDIF formatted input
107 <title>FUNCTIONS</title>
111 <function>ldb_connect(3)</function>
112 - connect to a ldb backend
116 <function>ldb_search(3)</function>
117 - perform a database search
121 <function>ldb_add(3)</function>
122 - add a record to the database
126 <function>ldb_delete(3)</function>
127 - delete a record from the database
131 <function>ldb_modify(3)</function>
132 - modify a record in the database
136 <function>ldb_errstring(3)</function>
137 - retrieve extended error information from the last operation
141 <function>ldb_ldif_write(3)</function>
142 - write a LDIF formatted message
146 <function>ldb_ldif_write_file(3)</function>
147 - write a LDIF formatted message to a file
151 <function>ldb_ldif_read(3)</function>
152 - read a LDIF formatted message
156 <function>ldb_ldif_read_free(3)</function>
157 - free the result of a ldb_ldif_read()
161 <function>ldb_ldif_read_file(3)</function>
162 - read a LDIF message from a file
166 <function>ldb_ldif_read_string(3)</function>
167 - read a LDIF message from a string
171 <function>ldb_msg_find_element(3)</function>
172 - find an element in a ldb_message
176 <function>ldb_val_equal_exact(3)</function>
177 - compare two ldb_val structures
181 <function>ldb_msg_find_val(3)</function>
182 - find an element by value
186 <function>ldb_msg_add_empty(3)</function>
187 - add an empty message element to a ldb_message
192 <function>ldb_msg_add(3)</function>
193 - add a non-empty message element to a ldb_message
198 <function>ldb_msg_element_compare(3)</function>
199 - compare two ldb_message_element structures
204 <function>ldb_msg_find_int(3)</function>
205 - return an integer value from a ldb_message
210 <function>ldb_msg_find_uint(3)</function>
211 - return an unsigned integer value from a ldb_message
216 <function>ldb_msg_find_double(3)</function>
217 - return a double value from a ldb_message
222 <function>ldb_msg_find_string(3)</function>
223 - return a string value from a ldb_message
228 <function>ldb_set_alloc(3)</function>
229 - set the memory allocation function to be used by ldb
234 <function>ldb_set_debug(3)</function>
235 - set a debug handler to be used by ldb
240 <function>ldb_set_debug_stderr(3)</function>
241 - set a debug handler for stderr output
247 <title>Author</title>
251 <ulink url="http://samba.org/~tridge/">Andrew Tridgell</ulink>.
255 If you wish to report a problem or make a suggestion then please see
256 the <ulink url="http://ldb.samba.org/"/> web site for
257 current contact and maintainer information.
261 ldb is released under the GNU Lesser General Public License version 2
262 or later. Please see the file COPYING for license details.