Almost have pagination working. On the backend it works but I can't figure out how to make alpine do the request and update.
This commit is contained in:
parent
c8ece708c3
commit
52e92a3814
3 changed files with 32 additions and 22 deletions
|
@ -8,9 +8,9 @@ import (
|
|||
sq "github.com/Masterminds/squirrel"
|
||||
)
|
||||
|
||||
func SelectTable(table string, the_type reflect.Type, limit uint64, offset uint64) ([]interface{}, error) {
|
||||
func SelectTable(table string, the_type reflect.Type, limit uint64, page uint64) ([]interface{}, error) {
|
||||
var results []interface{}
|
||||
sql_query, args, err := sq.Select("*").Limit(limit).Offset(offset).From(table).ToSql()
|
||||
sql_query, args, err := sq.Select("*").Limit(limit).Offset(limit * page).From(table).ToSql()
|
||||
if err != nil { return results, err }
|
||||
|
||||
rows, err := data.DB.Queryx(sql_query, args...)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue