Comments (8)
Select
.begin(@"*")
.from([ClassRoom class])
.limit(@"?")
.offset(@"?")
.endQuery(@[@(5),@(5)],[ClassRoom class],nil,^(NSArray *result){
NSLog(@"%@",result);
});
这样应该能先临时解决你的问题?后续会加上
from ffdb.
Select .begin(@"*") .from([ClassRoom class]) .limit(@"?") .offset(@"?") .endQuery(@[@(5),@(5)],[ClassRoom class],nil,^(NSArray *result){ NSLog(@"%@",result); });
这样应该能先临时解决你的问题?后续会加上
我先试试,感谢万分
from ffdb.
Select .begin(@"*") .from([ClassRoom class]) .limit(@"?") .offset(@"?") .endQuery(@[@(5),@(5)],[ClassRoom class],nil,^(NSArray *result){ NSLog(@"%@",result); });
这样应该能先临时解决你的问题?后续会加上
Select .begin(@"*") .from([ClassRoom class]) .limit(@"?") .offset(@"?") .endQuery(@[@(5),@(5)],[ClassRoom class],nil,^(NSArray *result){ NSLog(@"%@",result); });
这样应该能先临时解决你的问题?后续会加上
大佬你好,我看你写了不少功能但没有注释,比较难懂。可以问下方便给联系方式么,有几个问题想咨询
from ffdb.
这里问吧
from ffdb.
这里问吧
app想模拟网页,需要一个分页查询功能,比如页面可以上拉加载更多数据,数据为倒序返回(按创建时间最新或者按主键id倒序)。这个limit和offset能看懂,endQuery第一个参数数组怎么理解,按主键id倒序该怎么写
from ffdb.
倒序可以用orderby,
Select
.begin(@"*")
.from([ClassRoom class])
.orderBy(@"primaryKeyColumn DESC")
.limit(@"?")
.offset(@"?")
.endQuery(@[@(5),@(10)],[ClassRoom class],nil,^(NSArray *result){
NSLog(@"%@",result);
});
不过我发现这里之前写错了,少了个空格,晚些我处理下这个问题
https://github.com/Fidetro/FFDB/blob/022062466846d46e68c967f1c60a13c9482faba1/FFDB/OrderBy.m#L18C4-L18C4
// 错误
self.stmt = [NSString stringWithFormat:@"%@orderby %@ ",stmt,format];
// 预期
self.stmt = [NSString stringWithFormat:@"%@order by %@ ",stmt,format];
endQuery的参数是fmdb的用法,可以看下这里,5代表limit 5,10代表offset10,当然你也可以不这么用,这样写也可以
Select
.begin(@"*")
.from([ClassRoom class])
.orderBy(@"primaryKeyColumn DESC")
.limit(@"5")
.offset(@"10")
.endQuery(nil,[ClassRoom class],nil,^(NSArray *result){
NSLog(@"%@",result);
});
from ffdb.
倒序可以用orderby,
Select .begin(@"*") .from([ClassRoom class]) .orderBy(@"primaryKeyColumn DESC") .limit(@"?") .offset(@"?") .endQuery(@[@(5),@(10)],[ClassRoom class],nil,^(NSArray *result){ NSLog(@"%@",result); });不过我发现这里之前写错了,少了个空格,晚些我处理下这个问题 https://github.com/Fidetro/FFDB/blob/022062466846d46e68c967f1c60a13c9482faba1/FFDB/OrderBy.m#L18C4-L18C4
// 错误 self.stmt = [NSString stringWithFormat:@"%@orderby %@ ",stmt,format]; // 预期 self.stmt = [NSString stringWithFormat:@"%@order by %@ ",stmt,format];endQuery的参数是fmdb的用法,可以看下这里,5代表limit 5,10代表offset10,当然你也可以不这么用,这样写也可以
Select .begin(@"*") .from([ClassRoom class]) .orderBy(@"primaryKeyColumn DESC") .limit(@"5") .offset(@"10") .endQuery(nil,[ClassRoom class],nil,^(NSArray *result){ NSLog(@"%@",result); });
理解了,试了下有用,感谢
from ffdb.
Fixed 4.1.5
from ffdb.
Related Issues (2)
- 更新不兼容旧的接口吗? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ffdb.