You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: invitation.go
    path of file: ./repos/chatnio/admin
    
    the code of the file until where you have to start completion: package admin

import (
	"chat/globals"
	"chat/utils"
	"database/sql"
	"errors"
	"fmt"
	"math"
	"strings"
)

func GetInvitationPagination(db *sql.DB, page int64) PaginationForm {
	var invitations []interface{}
	var total int64
	if err := globals.QueryRowDb(db, `
		SELECT COUNT(*) FROM invitation
	`).Scan(&total); err != nil {
		return PaginationForm{
			Status:  false,
			Message: err.Error(),
		}
	}

	// get used_user from auth table by `user_id`
	rows, err := globals.QueryDb(db, `
		SELECT invitation.code, invitation.quota, invitation.type, invitation.used, 
		       invitation.created_at, invitation.updated_at, 
		       COALESCE(auth.username, '-') as username
		FROM invitation
		LEFT JOIN auth ON auth.id = invitation.used_id
		ORDER BY invitation.id DESC LIMIT ? OFFSET ?
	`, pagination, page*pagination)
	if err != nil {
		return PaginationForm{
			Status:  false,
			Message: err.Error(),
		}
	}

	for rows.Next() {
		var invitation InvitationData
		var createdAt []uint8
		var updatedAt []uint8
		if err := rows.Scan(&invitation.Code, &invitation.Quota, &invitation.Type, &invitation.Used, &createdAt, &updatedAt, &invitation.Username); err != nil {
			return PaginationForm{
				Status:  false,
				Message: err.Error(),
			}
		}
		invitation.CreatedAt = utils.ConvertTime(createdAt).Forma
    
func GetInvitationPagination(db *sql.DB, page int64) PaginationForm {
	var invitations []interface{}
	var total int64
	if err := globals.QueryRowDb(db, `
		SELECT COUNT(*) FROM invitation
	`).Scan(&total); err != nil {
		return PaginationForm{
			Status:  false,
			Message: err.Error(),
		}
	}

	// get used_user from auth table by `user_id`
	rows, err := globals.QueryDb(db, `
		SELECT invitation.code, invitation.quota, invitation.type, invitation.used, 
		       invitation.created_at, invitation.updated_at, 
		       COALESCE(auth.username, '-') as username
		FROM invitation
		LEFT JOIN auth ON auth.id = invitation.used_id
		ORDER BY invitation.id DESC LIMIT ? OFFSET ?
	`, pagination, page*pagination)
	if err != nil {
		return PaginationForm{
			Status:  false,
			Message: err.Error(),
		}
	}

	for rows.Next() {
		var invitation InvitationData
		var createdAt []uint8
		var updatedAt []uint8
		if err := rows.Scan(&invitation.Code, &invitation.Quota, &invitation.Type, &invitation.Used, &createdAt, &updatedAt, &invitation.Username); err != nil {
			return PaginationForm{
				Status:  false,
				Message: err.Error(),
			}
		}
		invitation.CreatedAt = utils.ConvertTime(createdAt).Format("2006-01-02 15:04:05")
		invitation.UpdatedAt = utils.ConvertTime(updatedAt).Format("2006-01-02 15:04:05")
		invitations = append(invitations, invitation)
	}

	return PaginationForm{
		Status: true,
		Total:  int(math.Ceil(float64(total) / float64(pagination))),
		Data:   invitations,
	}
}