pub struct RowRequestBuilder { /* private fields */ }
Expand description
Builder for constructing table row queries
Provides a fluent interface for building queries with filtering, sorting, and other options.
§Examples
Basic query with filters, sorting, and view selection:
use baserow_rs::{ConfigBuilder, Baserow, BaserowTableOperations, OrderDirection, filter::Filter};
use baserow_rs::api::client::BaserowClient;
#[tokio::main]
async fn main() {
let config = ConfigBuilder::new()
.base_url("https://api.baserow.io")
.api_key("your-api-key")
.build();
let baserow = Baserow::with_configuration(config);
let table = baserow.table_by_id(1234);
// Build a query with filters, sorting, and view selection
let results = table.rows()
.view(456) // Query from a specific view
.filter_by("Status", Filter::Equal, "Active")
.order_by("Created", OrderDirection::Desc)
.get()
.await
.unwrap();
println!("Found {} matching rows", results.count);
}
Paginated query:
// Get first page of 25 rows
let page1 = table.clone().rows()
.page_size(25)
.offset(0)
.get()
.await
.unwrap();
// Get second page
let page2 = table.clone().rows()
.page_size(25)
.offset(25)
.get()
.await
.unwrap();
println!("Total rows: {}", page1.count);
println!("First page rows: {}", page1.results.len());
println!("Second page rows: {}", page2.results.len());
Implementations§
Source§impl RowRequestBuilder
impl RowRequestBuilder
pub fn with_table(self, table: BaserowTable) -> Self
pub fn with_baserow(self, baserow: Baserow) -> Self
Sourcepub fn order_by(self, field: &str, direction: OrderDirection) -> Self
pub fn order_by(self, field: &str, direction: OrderDirection) -> Self
Sourcepub async fn get_typed<T>(self) -> Result<TypedRowsResponse<T>, Box<dyn Error>>where
T: DeserializeOwned,
pub async fn get_typed<T>(self) -> Result<TypedRowsResponse<T>, Box<dyn Error>>where
T: DeserializeOwned,
Execute the query and return typed results
Similar to get(), but deserializes the rows into the specified type.
§Type Parameters
T
- The type to deserialize each row into. Must implement DeserializeOwned.
§Returns
A TypedRowsResponse containing the matching rows deserialized as type T
§Errors
Returns an error if the request fails or the response cannot be parsed
Auto Trait Implementations§
impl Freeze for RowRequestBuilder
impl !RefUnwindSafe for RowRequestBuilder
impl Send for RowRequestBuilder
impl Sync for RowRequestBuilder
impl Unpin for RowRequestBuilder
impl !UnwindSafe for RowRequestBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more