Command Line (batch) formatting

ChillierChillier Posts: 11
edited March 21, 2014 7:26AM in SQL Prompt
We would like to make a Jenkins task to format our SQL before committing. Is there a way to specify a "command line" command to format :?:

Comments

  • Aaron LAaron L Posts: 596 New member
    Hi Chiller,
    Unfortunately there's no way to get prompt to run from the command line at the moment.

    Could I ask how you'd want this to work? A command line exe that'd take in a .sql file and an exported .sqlpromptstyle file that then writes out a new formatted .sql file?

    Thanks,
    Aaron.
  • Hei -

    Thanks, but not sure. We just want to automate the action of applying a standard formatting before committing.

    When we commit, we want the diff to show our actual changes, not programmer-specific formatting changes.... so we want to automagically apply the same formatting template to all SQL code.

    mvh Charles
  • Aaron LAaron L Posts: 596 New member
    Are you using SQL Source Control to commit your changes?

    We've had a request to automatically add prompt formatting in the commit tab on UserVoice here which sounds like it'd be exactly what you need?
  • Sounds right to me - I'll have to ask if they had other motives for using Jenkins ... but sounds right to me. I'll check.
  • Should be OK to add formatting in the commit tab - preferably if we could specify the (standard) format template to be used. The objective would be compromised if everyone uses their own personal formatting before committing, even if automagically.
  • Aaron LAaron L Posts: 596 New member
    Hi Charles,

    I've let our SQL Source Control team know that you'd like this feature. It sounds like a really good idea, please do vote on the UserVoice request as it helps them to prioritise which features to work on next.

    Thanks,
    Aaron.
Sign In or Register to comment.