#ifndef DB_DATABASE_H
#define DB_DATABASE_H

#include <sqlite3.h>

/**
 * Initialize the settings database for a profile
 * @param db_path Path to the database file
 * @return sqlite3* handle or NULL on failure
 */
sqlite3 *settings_init(const char *db_path);

/**
 * Get a setting value by key
 * @param db Database handle
 * @param key Setting key
 * @return Value string (caller must free) or NULL if not found
 */
char *settings_get(sqlite3 *db, const char *key);

/**
 * Set a setting value
 * @param db Database handle
 * @param key Setting key
 * @param value Setting value
 * @return 0 on success, -1 on failure
 */
int settings_set(sqlite3 *db, const char *key, const char *value);

/**
 * Delete a setting
 * @param db Database handle
 * @param key Setting key
 * @return 0 on success, -1 on failure
 */
int settings_delete(sqlite3 *db, const char *key);

/**
 * Close the settings database
 * @param db Database handle
 */
void settings_close(sqlite3 *db);

#endif
