-
Notifications
You must be signed in to change notification settings - Fork 69
Initial version of go-sqlcmd #1
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
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.
Lots of structural and style comments. My biggest suggestion is to alter the overall project layout and adapt it to support your future utilities you described.
sqlcmderrors/errors.go
Outdated
} | ||
|
||
func InvalidFileError(err error, path string) error { | ||
return errors.New(ErrorPrefix + " Error occurred while opening or operating on file " + path + " (Reason: " + err.Error() + ").") |
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.
You can use:
return fmt.Errorf("%s Error occurred while opening or operating on file %q (Reason: %v).", ErrorPrefix, path, err)
sqlcmd/sqlcmd.go
Outdated
var ( | ||
ErrExitRequested = errors.New("exit") | ||
ErrNeedPassword = errors.New("need password") | ||
ErrCtrlC = errors.New(sqlcmderrors.WarningPrefix + "The last operation was terminated because the user pressed CTRL+C") |
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.
Can use fmt.Errorf
There's a LONG way to go but basic interactive mode with file output is ready for main!
What do we have in this version?
eg with SQLCMDCOLWIDTH == 10 before running go-sqlcmd:
What's obviously missing or broken?