func (receiver *ModelStore) Single(pathInterface interface{}, queryInterface interface{}) (interface{}, error) {
	path := pathInterface.(string)
	controller, err := extension.GetAssociatedControllerWithPath(path)
	if err != nil {
		logging.Logger().Debug(err.Error())
		return nil, err
	}
	singleURL, err := controller.GetResourceSingleURL()
	if err != nil {
		logging.Logger().Debug(err.Error())
		return nil, err
	}
	parameters, err := extension.CreateParametersFromPathAndRoute(path, singleURL)
	if err != nil {
		logging.Logger().Debug(err.Error())
		return nil, err
	}
	urlValues, err := url.ParseQuery(queryInterface.(string))
	if err != nil {
		logging.Logger().Debug(err.Error())
		return nil, err
	}
	model := controller.GetModel()
	parameter, err := dbpkg.NewParameter(urlValues)
	if err != nil {
		logging.Logger().Debug(err.Error())
		return nil, err
	}
	typeName := model.GetTypeName(model)
	containerForQueryFields, err := extension.CreateOutputContainerByTypeName(typeName, urlValues.Get("preloads"))
	if err != nil {
		logging.Logger().Debug(err.Error())
		return nil, err
	}
	db := receiver.db.New()
	db, err = parameter.Paginate(db)
	if err != nil {
		logging.Logger().Debug(err.Error())
		return nil, err
	}
	db = parameter.SetPreloads(db)
	db = parameter.FilterFields(db)
	fields := helper.ParseFields(parameter.DefaultQuery(urlValues, "fields", "*"))
	responseMappingTag := parameter.DefaultQuery(urlValues, "response_mapping_tag", extension.TagJSON)
	queryFields, err := helper.QueryFields(containerForQueryFields, fields, responseMappingTag)
	if err != nil {
		logging.Logger().Debug(err.Error())
		return nil, err
	}
	result, err := model.GetSingle(model, db, parameters, urlValues, queryFields)
	if err != nil {
		logging.Logger().Debug(err.Error())
		return nil, err
	}
	return result, nil
}
Single retrieves a single record from DB
package modelstore
import (
	"errors"
	"net/url"
	"reflect"
	"github.com/jinzhu/gorm"
	dbpkg "github.com/qb0C80aE/clay/db"
	"github.com/qb0C80aE/clay/extension"
	"github.com/qb0C80aE/clay/helper"
	"github.com/qb0C80aE/clay/logging"
)
type ModelStore struct {
	db *gorm.DB
}
func NewModelStore(db *gorm.DB) *ModelStore {
	return &ModelStore{db: db}
}