func GetEventsByUserId(db *sql.DB, offset int, userId int64) (events []Event, err error) { rows, err := db.Query("SELECT * FROM events WHERE event_user = $2 LIMIT 50 OFFSET $1", offset, userId) if err != nil { return } err = crud.ScanAll(rows, &events) return }
func GetUsers(db *sql.DB, offset int) (users []User, err error) { rows, err := db.Query("SELECT * FROM users LIMIT 50 OFFSET $1", offset) if err != nil { return } err = crud.ScanAll(rows, &users) return }
func GetAssets(db *sql.DB, offset int) (assets []Asset, err error) { rows, err := db.Query("SELECT * FROM assets LIMIT 50 OFFSET $1", offset) if err != nil { return } err = crud.ScanAll(rows, &assets) return }