# What Database Does LingBot‑Map Use? Understanding the COLMAP SQLite Integration

> Discover the database LingBot-Map uses. Learn how it integrates with COLMAP's default SQLite database, database.db, for efficient reconstruction data management.

- Repository: [Robbyant/lingbot-map](https://github.com/Robbyant/lingbot-map)
- Tags: how-to-guide
- Published: 2026-07-19

---

**LingBot‑Map relies on the default SQLite database created by COLMAP for managing reconstruction data, with the database file instantiated as `database.db` inside the COLMAP workspace.**

LingBot‑Map is a benchmarking and mapping tool that leverages COLMAP for structure-from-motion tasks. The database used by lingbot-map is a standard SQLite file that stores all sparse reconstruction metadata including camera parameters, image features, and geometric matches. This integration allows the pipeline to persist intermediate results across different stages of the reconstruction process.

## SQLite Database Architecture in LingBot‑Map

### Database Initialization and Path Configuration

In [`benchmark/datasets/general.py`](https://github.com/Robbyant/lingbot-map/blob/main/benchmark/datasets/general.py), the database path is constructed by appending `'database.db'` to the COLMAP workspace directory. The specific implementation at line 307 defines the database location as:

```python
db_path = colmap_ws / "database.db"

```

This path is subsequently passed to all COLMAP commands via the `--database_path` argument, ensuring consistent data access throughout the pipeline execution.

### Schema and Data Storage

The SQLite database stores sparse reconstruction information critical to the mapping process. This includes **camera intrinsics and extrinsics**, **image metadata**, **extracted keypoints and descriptors**, and **geometric feature matches**. COLMAP manages this schema internally, providing atomic transactions that prevent data corruption during multi-stage processing.

## COLMAP Integration and Database Operations

### Feature Extraction Pipeline

During the feature extraction stage, COLMAP populates the SQLite database with visual features detected in the input imagery. The pipeline invokes COLMAP with the database path as shown in [`benchmark/datasets/general.py`](https://github.com/Robbyant/lingbot-map/blob/main/benchmark/datasets/general.py) (lines 315-341):

```python
from pathlib import Path
import subprocess

# COLMAP workspace directory

colmap_ws = Path("/path/to/colmap_workspace")

# SQLite database used by COLMAP

db_path = colmap_ws / "database.db"

# Run COLMAP feature extraction using the SQLite DB

subprocess.run([
    "colmap", "feature_extractor",
    "--image_path", str(colmap_ws / "images"),
    "--database_path", str(db_path)
])

```

### Matching and Reconstruction Stages

Following feature extraction, the matching stage queries and updates the same SQLite database to establish correspondences between images. The exhaustive matcher reads from and writes to this centralized storage:

```python

# Run COLMAP matching using the same SQLite DB

subprocess.run([
    "colmap", "exhaustive_matcher",
    "--database_path", str(db_path)
])

```

This unified storage approach ensures that all reconstruction stages—spanning feature detection, matching, bundle adjustment, and dense reconstruction—operate on consistent data without requiring intermediate file exports.

## Summary

- LingBot‑Map utilizes **COLMAP's default SQLite database** for all reconstruction data management
- The database file `database.db` is instantiated within the **COLMAP workspace** and defined in [`benchmark/datasets/general.py`](https://github.com/Robbyant/lingbot-map/blob/main/benchmark/datasets/general.py)
- All COLMAP commands receive the database path via the **`--database_path`** argument
- The SQLite schema stores cameras, images, keypoints, descriptors, and matches required for sparse reconstruction
- This architecture provides **atomic transactions** and persistent storage across pipeline stages

## Frequently Asked Questions

### What type of database does lingbot-map use?

LingBot‑Map uses a **SQLite database** created and managed by COLMAP. This is a file-based relational database that requires no separate server process, making it ideal for portable reconstruction workflows.

### Where is the database file located in lingbot-map?

The database file is located at `database.db` inside the COLMAP workspace directory. In the source code at [`benchmark/datasets/general.py`](https://github.com/Robbyant/lingbot-map/blob/main/benchmark/datasets/general.py) line 307, this path is constructed using `colmap_ws / 'database.db'`.

### Can I use a different database engine with lingbot-map?

No, LingBot‑Map is tightly integrated with COLMAP, which exclusively uses SQLite for its internal data management. The `--database_path` argument passed to COLMAP commands expects a valid SQLite file, and the pipeline does not support alternative database engines without significant modification to the underlying COLMAP integration.

### What data is stored in the lingbot-map database?

The database stores **sparse reconstruction metadata** including camera calibration parameters, image poses, extracted SIFT or other feature keypoints, feature descriptors, and geometric matches between image pairs. This data persists across the feature extraction, matching, and mapping stages.