func (boltDB *BoltService) AddToSchedule(schedulePost *types.ScheduleRequest) error {
	boltDB.DB.Update(func(tx *bolt.Tx) error {
		b, err := tx.CreateBucketIfNotExists([]byte(os.Getenv("bucketname")))
		if err != nil {
			logger.Log(err.Error())
			return err
		}
		scheduleID, err := b.NextSequence()
		if err != nil {
			logger.Log(err.Error())
			return err
		}
		schedulePost.ScheduleID = strconv.FormatUint(scheduleID, 10)
		schedulePost.Complete = false
		jsonstruct, err := json.Marshal(schedulePost)
		if err != nil {
			logger.Log(err.Error())
			return err
		}
		id := utils.ConvertIntToByte(int(scheduleID))
		b.Put(id, jsonstruct)
		return nil
	})
	return nil
}
AddToSchedule : Adds a new scheduled post to the database
package scheduledatabase
import (
	"encoding/json"
	"os"
	"reflect"
	"sheddit/logger"
	"sheddit/types"
	"sheddit/utils"
	"strconv"
	"time"
	"github.com/boltdb/bolt"
	_ "github.com/joho/godotenv/autoload"
)
const ISOFormat = "2006-01-02T15:04:05.999999999Z07:00"
type BoltService struct {
	DB *bolt.DB
}
func (boltDB *BoltService) InitializeDB() error {
	db, err := bolt.Open("schedule.db", 0600, nil)
	if err != nil {
		logger.Log(err.Error())
		return err
	}
	logger.Log("DB initialized")
	boltDB.DB = db
	return nil
}