use serde::{Deserialize, Serialize};
use serde_json::Value;

// Tauri's IPC layer does not support u128/i128 in command arguments,
// so timings round-trip through frontend → backend as u64 ms.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct QueryResult {
    pub columns: Vec<String>,
    pub types: Vec<String>,
    pub rows: Vec<Vec<Value>>,
    pub row_count: usize,
    pub execution_time_ms: u64,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct PaginatedQueryResult {
    pub columns: Vec<String>,
    pub types: Vec<String>,
    pub rows: Vec<Vec<Value>>,
    pub row_count: usize,
    pub execution_time_ms: u64,
    pub total_rows: i64,
    pub page: u32,
    pub page_size: u32,
    pub ctids: Vec<String>,
}
