2
.\" Author: [see the "Author" section]
3
.\" Generator: DocBook XSL Stylesheets v1.74.0 <http://docbook.sf.net/>
5
.\" Manual: C Library Functions
9
.TH "LDB" "3" "10/29/2009" "Samba 3\&.4" "C Library Functions"
10
.\" -----------------------------------------------------------------
11
.\" * (re)Define some macros
12
.\" -----------------------------------------------------------------
13
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14
.\" toupper - uppercase a string (locale-aware)
15
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
17
.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ
19
.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz
21
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
22
.\" SH-xref - format a cross-reference to an SH section
23
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
32
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
33
.\" SH - level-one heading that works better for non-TTY output
34
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
36
.\" put an extra blank line of space above the head in non-TTY output
43
.nr an-prevailing-indent \\n[IN]
47
.HTML-TAG ".NH \\n[an-level]"
49
.nr an-no-space-flag 1
51
\." make the size of the head bigger
56
.\" if n (TTY output), use uppercase
61
.\" if not n (not TTY), use normal case (not uppercase)
65
.\" if not n (not TTY), put a border/line under subheading
70
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
71
.\" SS - level-two heading that works better for non-TTY output
72
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
77
.nr an-prevailing-indent \\n[IN]
82
.nr an-no-space-flag 1
85
\." make the size of the head bigger
91
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
92
.\" BB/BE - put background/screen (filled box) around block of text
93
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
106
.if "\\$2"adjust-for-leading-newline" \{\
114
.nr BW \\n(.lu-\\n(.i
117
.ie "\\$2"adjust-for-leading-newline" \{\
118
\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[]
121
\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[]
132
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
133
.\" BM/EM - put colored marker in margin next to block of text
134
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
151
\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[]
159
.\" -----------------------------------------------------------------
160
.\" * set default formatting
161
.\" -----------------------------------------------------------------
162
.\" disable hyphenation
164
.\" disable justification (adjust text to left margin only)
166
.\" -----------------------------------------------------------------
167
.\" * MAIN CONTENT STARTS HERE *
168
.\" -----------------------------------------------------------------
170
ldb \- A light\-weight database library
182
ldb is a light weight embedded database library and API\&. With a programming interface that is very similar to LDAP, ldb can store its data either in a tdb(3) database or in a real LDAP database\&.
184
When used with the tdb backend ldb does not require any database daemon\&. Instead, ldb function calls are processed immediately by the ldb library, which does IO directly on the database, while allowing multiple readers/writers using operating system byte range locks\&. This leads to an API with very low overheads, often resulting in speeds of more than 10x what can be achieved with a more traditional LDAP architecture\&.
186
In a taxonomy of databases ldb would sit half way between key/value pair databases (such as berkley db or tdb) and a full LDAP database\&. With a structured attribute oriented API like LDAP and good indexing capabilities, ldb can be used for quite sophisticated applications that need a light weight database, without the administrative overhead of a full LDAP installation\&.
188
Included with ldb are a number of useful command line tools for manipulating a ldb database\&. These tools are similar in style to the equivalent ldap command line tools\&.
190
In its default mode of operation with a tdb backend, ldb can also be seen as a "schema\-less LDAP"\&. By default ldb does not require a schema, which greatly reduces the complexity of getting started with ldb databases\&. As the complexity of you application grows you can take advantage of some of the optional schema\-like attributes that ldb offers, or you can migrate to using the full LDAP api while keeping your exiting ldb code\&.
192
If you are new to ldb, then I suggest starting with the manual pages for ldbsearch(1) and ldbedit(1), and experimenting with a local database\&. Then I suggest you look at the ldb_connect(3) and ldb_search(3) manual pages\&.
205
\- command line ldb search utility
218
\- edit all or part of a ldb database using your favourite editor
231
\- add records to a ldb database using LDIF formatted input
244
\- delete records from a ldb database
257
\- modify records in a ldb database using LDIF formatted input
270
\- connect to a ldb backend
283
\- perform a database search
296
\- add a record to the database
309
\- delete a record from the database
322
\- modify a record in the database
334
\fBldb_errstring(3)\fR
335
\- retrieve extended error information from the last operation
347
\fBldb_ldif_write(3)\fR
348
\- write a LDIF formatted message
360
\fBldb_ldif_write_file(3)\fR
361
\- write a LDIF formatted message to a file
373
\fBldb_ldif_read(3)\fR
374
\- read a LDIF formatted message
386
\fBldb_ldif_read_free(3)\fR
387
\- free the result of a ldb_ldif_read()
399
\fBldb_ldif_read_file(3)\fR
400
\- read a LDIF message from a file
412
\fBldb_ldif_read_string(3)\fR
413
\- read a LDIF message from a string
425
\fBldb_msg_find_element(3)\fR
426
\- find an element in a ldb_message
438
\fBldb_val_equal_exact(3)\fR
439
\- compare two ldb_val structures
451
\fBldb_msg_find_val(3)\fR
452
\- find an element by value
464
\fBldb_msg_add_empty(3)\fR
465
\- add an empty message element to a ldb_message
478
\- add a non\-empty message element to a ldb_message
490
\fBldb_msg_element_compare(3)\fR
491
\- compare two ldb_message_element structures
503
\fBldb_msg_find_int(3)\fR
504
\- return an integer value from a ldb_message
516
\fBldb_msg_find_uint(3)\fR
517
\- return an unsigned integer value from a ldb_message
529
\fBldb_msg_find_double(3)\fR
530
\- return a double value from a ldb_message
542
\fBldb_msg_find_string(3)\fR
543
\- return a string value from a ldb_message
555
\fBldb_set_alloc(3)\fR
556
\- set the memory allocation function to be used by ldb
568
\fBldb_set_debug(3)\fR
569
\- set a debug handler to be used by ldb
581
\fBldb_set_debug_stderr(3)\fR
582
\- set a debug handler for stderr output
588
If you wish to report a problem or make a suggestion then please see the
589
: http://ldb.samba.org/
590
web site for current contact and maintainer information\&.
592
ldb is released under the GNU Lesser General Public License version 2 or later\&. Please see the file COPYING for license details\&.