2024-02-10 19:05:08 +00:00
|
|
|
package repositories
|
|
|
|
|
2024-02-12 19:38:03 +00:00
|
|
|
import repositorymodels "github.com/pikami/cosmium/internal/repository_models"
|
2024-02-10 19:05:08 +00:00
|
|
|
|
2024-02-12 19:38:03 +00:00
|
|
|
var userDefinedFunctions = []repositorymodels.UserDefinedFunction{}
|
|
|
|
|
|
|
|
func GetAllUserDefinedFunctions(databaseId string, collectionId string) ([]repositorymodels.UserDefinedFunction, repositorymodels.RepositoryStatus) {
|
|
|
|
udfs := make([]repositorymodels.UserDefinedFunction, 0)
|
2024-02-10 19:05:08 +00:00
|
|
|
|
|
|
|
for _, coll := range userDefinedFunctions {
|
2024-02-12 19:38:03 +00:00
|
|
|
if coll.Internals.DatabaseId == databaseId && coll.Internals.CollectionId == collectionId {
|
2024-02-10 19:05:08 +00:00
|
|
|
udfs = append(udfs, coll)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-12 19:38:03 +00:00
|
|
|
return udfs, repositorymodels.StatusOk
|
2024-02-10 19:05:08 +00:00
|
|
|
}
|