-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
feat(*): support SQL output format #122
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yoooo this is awesome!! 🔥 So excited to see this coming together. I apologize in advanced for the flood of comments haha.
Thanks for all the comments!! I am going to make sure I address all of them. I'm going to be out of town this week/weekend, but will get to them as soon as I can 💪🏻 Appreciate how quickly you reviewed this! 😁 |
…ram at cli app level
…ables to be plural (group was keyword)
Also, feel free to let me know if you'd like me to add documentation to this. I'm not sure which takes preference, the gitbook repository or the |
…-output-formats' into 59-support-multiple-output-formats
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Just left some nits
cli/app.go
Outdated
&cli.StringFlag{ | ||
Name: "format", | ||
Aliases: []string{"f"}, | ||
Usage: "Specific output format of the dump (ODXML or SQL)", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: "Specific" seems unnecessary here
cli/app.go
Outdated
}, | ||
Before: cli.BeforeFunc(func(c *cli.Context) error { | ||
s := c.String("format") | ||
switch s { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: could probably be more concise as a simple if/else statement
Also sorry it's taken me so long to get back to this 😅 |
No worries at all! I fixed the nits you suggested and will merge this in since the test cases still pass 😁 thank you for taking the time to review the PR. Very excited about this feature and I'd be glad to help on future ones 🎊 🚀 |
This PR creates the functionality as discussed on #59 to the support the conversion of odict to SQL format. This will allow people to seed a database with odict data easily in all popular SQL dialects. This is thanks to @bokwoon95's help & project,
sq
.The following commands are now available:
go run odict.go d -f postgres examples/example1.odict examples/output.sql
go run odict.go d -f sqlite examples/example1.odict examples/output.sql
go run odict.go d -f mysql examples/example1.odict examples/output.sql
go run odict.go d -f sqlserver examples/example1.odict examples/output.sql
I added these to the
.vscode/launch.json
file which allows us to test them in VS-Code! Very excited about this feature and would be glad to receive any feedback. Here is an example image of my seeded PostgreSQL database with odict data thanks to theouput.sql
file generated by thepostgres
command above: