MCPcopy Index your code
hub / github.com/dnote/dnote / paginate

Function paginate

pkg/server/app/notes.go:247–257  ·  view source on GitHub ↗
(conn *gorm.DB, page, perPage int)

Source from the content-addressed store, hash-verified

245}
246
247func paginate(conn *gorm.DB, page, perPage int) *gorm.DB {
248 // Paginate
249 if page > 0 {
250 offset := perPage * (page - 1)
251 conn = conn.Offset(offset)
252 }
253
254 conn = conn.Limit(perPage)
255
256 return conn
257}
258
259// GetNotesResult is the result of getting notes
260type GetNotesResult struct {

Callers 1

GetNotesMethod · 0.85

Calls 1

LimitMethod · 0.80

Tested by

no test coverage detected