This repository has been archived on 2026-10-03. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files

21 lines
442 B
Go
Raw Permalink Normal View History

2023-10-07 10:22:56 +01:00
package arango
import (
"regexp"
)
// https://docs.arangodb.com/3.11/aql/fundamentals/bind-parameters/#syntax
2023-10-13 07:59:04 +01:00
var paramRegexp = regexp.MustCompile("@(@?[A-z0-9_]+)")
2023-10-07 10:22:56 +01:00
// ReadParams reads out named parameters from an AQL string.
func ReadParams(input string) []string {
params := []string{}
matches := paramRegexp.FindAllStringSubmatch(input, -1)
2023-11-25 16:51:25 +00:00
for _, match := range matches {
params = append(params, match[1])
2023-10-07 10:22:56 +01:00
}
return params
}