import sqlite3
from typing import Dict


def get_metric_mapping(db: sqlite3.Connection) -> Dict[str, int]:
    """Gets a mapping from metric_name to metric_id."""
    results = db.execute('SELECT name, id FROM metric_names').fetchall()
    return dict(results)