docs: Add comprehensive rustdoc for pages and db modules, marking plan items done
Co-authored-by: aider (openai/andrew/openrouter/sonoma-sky-alpha) <aider@aider.chat>
This commit is contained in:
28
src/db.rs
28
src/db.rs
@@ -456,6 +456,34 @@ pub fn query_upsert_meta(conn: &Connection, meta: Meta) -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Stores a metadata entry, deleting it if the value is empty.
|
||||
///
|
||||
/// Handles both insertion/update and deletion based on value presence.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `conn` - Database connection.
|
||||
/// * `meta` - Metadata entry to store (empty value triggers deletion).
|
||||
///
|
||||
/// # Returns
|
||||
///
|
||||
/// * `Result<()>` - Success or error if the operation fails.
|
||||
///
|
||||
/// # Errors
|
||||
///
|
||||
/// * Database errors during insert/update/delete.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// // Insert new metadata
|
||||
/// let meta = Meta { id: 1, name: "source".to_string(), value: "cli".to_string() };
|
||||
/// db::store_meta(&conn, meta)?;
|
||||
///
|
||||
/// // Delete metadata with empty value
|
||||
/// let meta = Meta { id: 1, name: "temp".to_string(), value: "".to_string() };
|
||||
/// db::store_meta(&conn, meta)?;
|
||||
/// ```
|
||||
/// Stores a metadata entry, deleting it if the value is empty.
|
||||
///
|
||||
/// Handles both insertion/update and deletion based on value presence.
|
||||
|
||||
Reference in New Issue
Block a user