2.2 Semantic Database

The Semantic Database (SemanticDB) caches the results of parsing source code files. This data can be saved to disk when you exit Emacs, and reloaded automatically when you subsequently revisit the same source code files. This saves time by eliminating the need to re-parse unmodified files.

SemanticDB also provides an API that programs can use to acquire information about source code tags. This information can be accessed without loading the original the source files into memory. It can also be used to create alternate “back-ends” for storing tag information in alternative on-disk formats.

By default, SemanticDB is enabled together with Semantic mode. To disable it, remove it from semantic-default-submodes (see Semantic mode). You can also enable or disable SemanticDB with M-x global-semanticdb-minor-mode.

Command: global-semanticdb-minor-mode

Toggle SemanticDB mode. When enabled, any source code parsed by Semantic is cached in a database.

SemanticDB offers a large number of customizable options, which are described in the following subsections.