Schotime/PetaPoco. Long Time No Post and PetaPoco v5 -Topten Software. After a very busy 2011, I took the first couple of months of 2012 off and did pretty much nothing - at least nothing to do with software development - just alot of unwinding and I feel all the better for it.
Since then I've been working on a few different projects, including new version of Cantabile, some contract work doing mobile development for iOS and Android, and more recently I've been playing with OpenGL, Mono, MonoTouch and MonoDroid with thoughts of maybe doing a mobile game (it's been along time since I did any games programming). The question I keep getting asked however is when will there be a new version of PetaPoco?
Well firstly I'm somewhat reluctant to change PetaPoco too much - simply because I want it to stay as simple as possible and well, I like it the way it is. If you were hoping to see PetaPoco grow into something bigger, more feature rich, then I'm sorry to disappoint - but that's simply missing the point of what PetaPoco is. Dropping the Single C# File Approach. Toptensoftware/PetaPoco at v5. Blog - Micro ORM Data Mapping with PetaPoco and ASP.NET MVC 4. Like others, I spend a LOT of time in and out of EntityFramework for Silverlight and MVC application development.
Though it has its place in the development ecosystem, there are those times that it may be overkill, cumbersome and/or down right annoying to use (i.e.: auto-generated strongly typed metadata, lack of stored procedure support without blank tables/views come to mind). Welcome to Micro ORM land, a place that allows you the developer to wrap your data objects as you see fit, use standard SQL syntax, even map complex datasets to local objects (POCOs).
Today we're playing with PetaPoco, but feel free to check post references for info on additional Micro ORMs. PetaPoco is a single file solution for mapping your database objects without the overhead of more mainstream ORMs. It provides flexibility for data access including querying, joining, CRUD operations and much more with your application POCO (Plain Old CLR Object) objects. Installing PetaPoco PM> Install-Package PetaPoco. Server-Side Paging with PetaPoco and DataTables. TL;DR – Server-side paging of table data is not only faster and more responsive, but very easy to implement with PetaPoco and DataTables.
I will demonstrate how millisecond response times are still possible even when dealing with a million rows of data. This blog post can be forked on GitHub: tawman / PetaPocoPage. Sample Web Site and Data For the sample web site, I used the Spawner Data Generator tool to generate 1,000,000 rows of test data for use in this example. As you can see from the timings, each table grid page request is limited to approximately 1.25 KB of data and a response time around 75 milliseconds. On my current project, we initially used jQuery tablesorter with a table loading between 1,000 and 1,500 detail records for a report. DataTables DataTables is a great extensible jQuery plug-in and satisfied our searching, paging, and server-side processing requirements.
Client Side Setup Server Side Setup PetaPoco Conclusion DataTables and PetaPoco were made to page together.