func ModelExists(name string, dbc db.DB) bool {
	if _, err := dbc.GetOne(tableModels, name); err != nil {
		return false
	}
	return true
}
ModelExists checks if the model exists in the database
package models
import (
	"errors"
	"fmt"
	"strings"
	"github.com/rtlnl/phoenix/pkg/db"
	"github.com/rtlnl/phoenix/utils"
)
const (
	tableModels = "models"
)
type Model struct {
	Name         string   `json:"name" description:"name of the model that will be used"`
	SignalOrder  []string `json:"signalOrder" description:"list of ordered signals"`
	Concatenator string   `json:"concatenator" description:"character used as concatenator for SignalOrder {'|','#','_','-'}"`
}
func NewModel(name, concatenator string, signalOrder []string, dbc db.DB) (Model, error) {
	if ModelExists(name, dbc) {
		return Model{}, fmt.Errorf("model with name %s already exists", name)
	}
	if len(signalOrder) > 1 && concatenator == "" {
		return Model{}, errors.New("multiple signals are being specified but no concatenator. concatenator is missing")
	}
	if utils.StringInSlice(name, reservedNames) {
		return Model{}, fmt.Errorf("cannot use %s as name. this name is reserved", name)
	}
	model := Model{
		Name:         name,
		SignalOrder:  signalOrder,
		Concatenator: concatenator,
	}
	serialized, err := utils.SerializeObject(model)
	if err != nil {
		return Model{}, fmt.Errorf("could not serialize model. error: %s", err.Error())
	}
	if err := dbc.AddOne(tableModels, name, serialized); err != nil {
		return Model{}, err
	}
	return model, nil
}