LoadAndSplitQuery loads and split cql / sql query into one statement per string. Comments are removed from the query.
( filePaths []string, )
| 35 | // LoadAndSplitQuery loads and split cql / sql query into one statement per string. |
| 36 | // Comments are removed from the query. |
| 37 | func LoadAndSplitQuery( |
| 38 | filePaths []string, |
| 39 | ) ([]string, error) { |
| 40 | var files []io.Reader |
| 41 | |
| 42 | for _, filePath := range filePaths { |
| 43 | f, err := os.Open(filePath) |
| 44 | if err != nil { |
| 45 | return nil, fmt.Errorf("error opening file %s: %w", filePath, err) |
| 46 | } |
| 47 | files = append(files, f) |
| 48 | } |
| 49 | |
| 50 | return LoadAndSplitQueryFromReaders(files) |
| 51 | } |
| 52 | |
| 53 | // LoadAndSplitQueryFromReaders loads and split cql / sql query into one statement per string. |
| 54 | // Comments are removed from the query. |