MCPcopy Create free account
hub / github.com/SeaQL/sea-orm / offset

Method offset

src/query/helper.rs:197–207  ·  view source on GitHub ↗

Add an offset expression. Passing in None would remove the offset. ``` use sea_orm::{entity::*, query::*, tests_cfg::cake, DbBackend}; assert_eq!( cake::Entity::find() .offset(10) .build(DbBackend::MySql) .to_string(), "SELECT `cake`.`id`, `cake`.`name` FROM `cake` OFFSET 10" ); assert_eq!( cake::Entity::find() .offset(Some(10)) .offset(Some(20)) .build(DbBackend::MySql) .to_string(), "SELECT `

(mut self, offset: T)

Source from the content-addressed store, hash-verified

195 /// );
196 /// ```
197 fn offset<T>(mut self, offset: T) -> Self
198 where
199 T: Into<Option<u64>>,
200 {
201 if let Some(offset) = offset.into() {
202 self.query().offset(offset);
203 } else {
204 self.query().reset_offset();
205 }
206 self
207 }
208
209 /// Add a limit expression. Passing in None would remove the limit.
210 ///

Callers 11

fetch_pageMethod · 0.80
fetch_pageFunction · 0.80
fetch_page_rawFunction · 0.80
fetchFunction · 0.80
fetch_rawFunction · 0.80
fetch_and_nextFunction · 0.80
fetch_and_next_rawFunction · 0.80
into_streamFunction · 0.80
into_stream_rawFunction · 0.80
exists_with_limit_offsetFunction · 0.80

Implementers 1

cursor.rssrc/executor/cursor.rs

Calls 1

queryMethod · 0.45

Tested by 1

exists_with_limit_offsetFunction · 0.64