Skip to content

gather parsed SQLs by file name #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 5, 2023
Merged

gather parsed SQLs by file name #15

merged 3 commits into from
Dec 5, 2023

Conversation

ColdWaterLW
Copy link
Collaborator

parser.go Outdated

// ParseXMLsWithFilePath is a parser for parse all query in several XML files to map[string][]string one by one;
// you can set `skipErrorQuery` true to ignore invalid query.
func ParseXMLsWithFilePath(dataFromFiles []XmlFiles, skipErrorQuery bool) (map[string] /*file path*/ []string /*sqls*/, error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

建议返回结构化的SQL内容,方便后续扩展,例如要返回SQL在XML文件里的位置等其他信息

type sqlInfo struct{
    sql      string
    filepath string
} 

return []SqlInfo

@sjjian sjjian merged commit 98ff025 into actiontech:main Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants