Skip to content

Commit

Permalink
fix: use copy not inserts
Browse files Browse the repository at this point in the history
  • Loading branch information
Vilsol committed Oct 11, 2024
1 parent e3f87c5 commit 31bbecd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ go 1.22.6
require (
github.com/aws/aws-sdk-go-v2 v1.30.3
github.com/aws/aws-sdk-go-v2/config v1.27.27
github.com/aws/aws-sdk-go-v2/credentials v1.17.27
github.com/aws/aws-sdk-go-v2/service/s3 v1.58.3
github.com/google/uuid v1.6.0
)

require (
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.3 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.17.27 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.11 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.15 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.15 // indirect
Expand Down
5 changes: 2 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
"github.com/aws/aws-sdk-go-v2/service/s3"
)

var emailRegex = regexp.MustCompile(`'[a-z0-9._%+!$&*=^|~#'?{}/\-]+?@[a-z0-9\- ]+?\.[^@' ]+?'`)
var emailRegex = regexp.MustCompile(`\t[a-z0-9._%+!$&*=^|~#'?{}/\-]+?@[a-z0-9\- ]+?\.[^@' ]+?\t`)

func main() {
// read in flags
Expand Down Expand Up @@ -49,7 +49,6 @@ func main() {
"-U", user,
"-b",
"--quote-all-identifiers",
"--inserts",
"--exclude-table-data", "user_sessions",
)

Expand All @@ -65,7 +64,7 @@ func main() {

// replace all emails
outStr = emailRegex.ReplaceAllStringFunc(outStr, func(s string) string {
return "'" + uuid.New().String() + "@" + uuid.New().String() + ".com'"
return "\t" + uuid.New().String() + "@" + uuid.New().String() + ".com\t"
})

// save data
Expand Down

0 comments on commit 31bbecd

Please sign in to comment.