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 storedProcedures = []repositorymodels.StoredProcedure{}
|
|
|
|
|
|
|
|
func GetAllStoredProcedures(databaseId string, collectionId string) ([]repositorymodels.StoredProcedure, repositorymodels.RepositoryStatus) {
|
|
|
|
sps := make([]repositorymodels.StoredProcedure, 0)
|
2024-02-10 19:05:08 +00:00
|
|
|
|
|
|
|
for _, coll := range storedProcedures {
|
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
|
|
|
sps = append(sps, coll)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-12 19:38:03 +00:00
|
|
|
return sps, repositorymodels.StatusOk
|
2024-02-10 19:05:08 +00:00
|
|
|
}
|