When a table has no PRIMARY KEY, use PostgreSQL's ctid (physical row ID) to identify rows for UPDATE/DELETE operations instead of blocking edits. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
25 lines
613 B
Rust
25 lines
613 B
Rust
use serde::{Deserialize, Serialize};
|
|
use serde_json::Value;
|
|
|
|
#[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: u128,
|
|
}
|
|
|
|
#[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: u128,
|
|
pub total_rows: i64,
|
|
pub page: u32,
|
|
pub page_size: u32,
|
|
pub ctids: Vec<String>,
|
|
}
|