FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
sqlparser/redact_query.go at master · dearcode/sqlparser · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
dearcode
/
sqlparser
Public
Notifications
You must be signed in to change notification settings
Fork
4
Star
4
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
sqlparser
/
redact_query.go
Copy path
More file actions
More file actions
Latest commit
History
History
History
19 lines (14 loc) · 460 Bytes
Breadcrumbs
sqlparser
/
redact_query.go
Copy path
File metadata and controls
19 lines (14 loc) · 460 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package
sqlparser
import
querypb
"vitess.io/vitess/go/vt/proto/query"
// RedactSQLQuery returns a sql string with the params stripped out for display
func
RedactSQLQuery
(
sql
string
) (
string
,
error
) {
bv
:=
map
[
string
]
*
querypb.
BindVariable
{}
sqlStripped
,
comments
:=
SplitTrailingComments
(
sql
)
stmt
,
err
:=
Parse
(
sqlStripped
)
if
err
!=
nil
{
return
""
,
err
}
prefix
:=
"redacted"
Normalize
(
stmt
,
bv
,
prefix
)
return
String
(
stmt
)
+
comments
,
nil
}
Back
|
FazBrowse Home
|
New Git URL