use super::Operation;
use crate::{
schema::db::{ColumnId, IndexId, TableId},
stmt,
};
#[derive(Debug, Clone)]
pub enum QueryPkLimit {
Cursor {
page_size: i64,
after: Option<stmt::Value>,
},
Offset {
limit: i64,
offset: Option<i64>,
},
}
#[derive(Debug, Clone)]
pub struct QueryPk {
pub table: TableId,
pub index: Option<IndexId>,
pub select: Vec<ColumnId>,
pub pk_filter: stmt::Expr,
pub filter: Option<stmt::Expr>,
pub limit: Option<QueryPkLimit>,
pub order: Option<stmt::Direction>,
}
impl From<QueryPk> for Operation {
fn from(value: QueryPk) -> Self {
Self::QueryPk(value)
}
}