summaryrefslogtreecommitdiff
path: root/docs/src/config-strings.dox
blob: bfe6e364c2f164ccfcde4dbef99e5298dfd2b831 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/* vim: set filetype=c.doxygen : */

/*! @page config_strings Configuration Strings

@section config_intro Introduction

Many operations in WiredTiger accept a string to configure options.  These strings all have the same format:

<pre>
  [key['='value]][','[key['='value]]]*
</pre>

That is, they are simple comma-separated lists of <code>"<key>=<value>"</code> pairs.  If the <code>"=<value>"</code> part is omitted, the value of 1 is assumed.

To handle more complex configuration, such as specifying a schema, values may be nested lists using parentheses.  For example:

<pre>
  schema=(keyfmt=S,valuefmt=S,columns=(name,notes))
</pre>

Empty configuration strings may be represented in C or C++ by passing <code>NULL</code>.

Superfluous commas and whitespace in the configuration string are ignored (including at the beginning and end of the string), so it is always safe to combine two configuration strings by concatenating them with a comma in between.

Keys are processed in order from left to right, with later settings overriding earlier ones unless multiple settings for a key are permitted.

@section config_examples Code Samples

The code below is taken from the complete example program @ex_ref{ex_config.c}.

@todo improve the example

@dontinclude ex_config.c

Open a connection to a database, creating it if it does not exist and set a cache size of 10MB:

@skip wiredtiger_open
@until != 0

Create a table that uses C language strings for keys and values:

@skipline create_table

Assign a priority to a transaction and give it a name for debugging:

@skipline begin_transaction
*/