SqlScriptDOM icon indicating copy to clipboard operation
SqlScriptDOM copied to clipboard

Add generator option for newlines between statements

Open Stefan-Puskarica opened this issue 1 year ago • 4 comments

Currently the generator only generates one newline between statements which leads to code like this:

CREATE TABLE [MyTable] (
  ...
);
ALTER TABLE [MyTable]
  ...;

Which can be unfavourable, I've added a script generator option that allows you to specify how many newlines you want so you can get something like this instead:

CREATE TABLE [MyTable] (
  ...
);

ALTER TABLE [MyTable]
  ...;

Stefan-Puskarica avatar Oct 06 '24 13:10 Stefan-Puskarica

@microsoft-github-policy-service agree

Stefan-Puskarica avatar Oct 06 '24 13:10 Stefan-Puskarica

Please also add tests to verify the new option

llali avatar Oct 09 '24 22:10 llali

the new option is not added to SqlScriptGeneratorOptions so this will have build error.

Hi, I'm not sure what you mean, it was added to the .xml file. As far as I can see there is no tracked .cs equivalent to be generated rather it is generated at build time. When I built and tested locally it worked for me

Stefan-Puskarica avatar Oct 10 '24 23:10 Stefan-Puskarica

Please also add tests to verify the new option

Where should this go? I don't see any current tests for SQL generation

Stefan-Puskarica avatar Oct 11 '24 00:10 Stefan-Puskarica

@llali can I get an update on this?

Stefan-Puskarica avatar Nov 03 '24 16:11 Stefan-Puskarica

the new option is not added to SqlScriptGeneratorOptions so this will have build error.

Hi, I'm not sure what you mean, it was added to the .xml file. As far as I can see there is no tracked .cs equivalent to be generated rather it is generated at build time. When I built and tested locally it worked for me

you are right my bad.

llali avatar Nov 08 '24 18:11 llali

@llali can I get an update on this?

Please add test for this new option. Thanks

llali avatar Nov 08 '24 18:11 llali

@llali can I get an update on this?

Please add test for this new option. Thanks

I've added a test

Stefan-Puskarica avatar Nov 09 '24 04:11 Stefan-Puskarica