Open tracker1 opened 4 years ago
Whilst this sounds cool and nifty, I'm not sure where the need is for this and it's not something I have the time to concentrate on - I'd happily accept PRs for improvements, but this feels like a low priority for me at the moment
@dhensby totally understood... also, given the need to work, potentially with multiple databases and queries with GO
statements, etc... not sure it's within a good scope of this project. I'm working on creating an abstraction to make it easier to find/use sqlcmd executable directly on a host, or in a locally configured docker container (assuming docker executable and container configured).
I was just reading through the generated file, and thought it might not be too much work to support such scripts. Mainly from db export/backup and from db projects in visual studio. (aside: migrating from a vs sql project to a version-script solution, so starting point is a set of these scripts).
Was thinking it would be really cool to support the additional features of
sqlcmd
/osql
in a command parameter...sql.command(script, [commandVars])
For example:
/\r?\n\:setvar\s+(\w+)\s+([^\r\n]+)\s*\r?\n/g
;:on error exit
, always error on exit/\r?\nGO;?\r?\n/g
and injecting the script variables...__IsSqlCmdEnabled = True
for all commands.PRINT
statements toSELECT PRINT=...
- maybe use an emitter, or console.log the statements based on config?Object.assign({}, detectedVars, commandVars)
I'm not entirely sure what else sqlcmd does in practice, but could be a decent idea.