project/nanoeval/nanoeval/_db.py [65:103]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            conn.execute(
                """
                CREATE TABLE IF NOT EXISTS eval (
                    run_id TEXT PRIMARY KEY,
                    name TEXT NOT NULL,
                    start_time TIMESTAMP NOT NULL,
                    spec BLOB NOT NULL,
                    recorder BLOB NOT NULL,
                    concurrency INTEGER NOT NULL
                )
                """
            )
            conn.execute(
                """
                CREATE TABLE IF NOT EXISTS executor (
                    pid INTEGER PRIMARY KEY,
                    aiomonitor_host STRING NOT NULL
                )
                """
            )
            conn.execute(
                """
                CREATE TABLE IF NOT EXISTS task (
                    eval_id TEXT NOT NULL,
                    group_id TEXT NOT NULL,
                    start_time TIMESTAMP,
                    end_time TIMESTAMP,
                    task BLOB NOT NULL,
                    result BLOB,
                    executor_pid INTEGER,
                    FOREIGN KEY(eval_id) REFERENCES eval(run_id),
                    UNIQUE(eval_id, group_id)
                )
                """
            )

            # The task table can be very large, so we add an index for the executor worker's sql query
            # Without this index, evals become very slow over time as the task table grows (result is not null anymore)
            conn.execute(
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



project/nanoeval/nanoeval/_db.py [103:126]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            conn.execute(
                """
                -- Used to pull new tasks
                CREATE INDEX IF NOT EXISTS task_result_executor_pid_idx ON task(result, executor_pid)
                """
            )
            conn.execute(
                """
                CREATE INDEX IF NOT EXISTS task_executor_pid_idx ON task(executor_pid);
            """
            )

            # Create a KV metadata table
            conn.execute(
                """
                CREATE TABLE IF NOT EXISTS metadata (
                    key TEXT PRIMARY KEY,
                    value TEXT NOT NULL
                )
                """
            )

            # Insert the run_set_id into the metadata table so .evaluation() can read it later
            conn.execute(
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



