db2struct
db2struct copied to clipboard
Redirect output includes prompts and errors
When piping output to a file db2struct -h host -u user -p -t whatever... >> ~/test.go any errors messages, and the "Password:" prompt, are also sent to the file, the latter causing an apparent freeze unless you realise and press something!
You can use -p <password> on the command line which helps but does not solve the underlying issue.
Otherwise, thanks for writing this - it has saved me a heck of a lot of typing!!! Feature request - option to specify "all tables" or a list of them.
@irrelevantdotcom you can use the --target
to write the struct output to a file.
For the all tables request, would you want all the structs in a single file or one file per struct with the name of the file the snake case version of the struct name?
Ah, I han't spotted that option. Ta! Both output options have their benefits .... in my case I started off appending all to one file, but ended up writing them to separate files, (which I then ran through a touch of PHP to adjust things.)