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

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