ElSql icon indicating copy to clipboard operation
ElSql copied to clipboard

Preserve MultiLine SQL

Open ati-ozgur opened this issue 12 years ago • 3 comments

When I use ElSqlBundle to read external sql file. An multiline SQL changed to one line sql. For example:

@name(example) SELECT
COUNT(*) FROM Employee

this is changed to SELECT COUNT(*) FROM Employee

I would like to preserve multi line structure of SQL if it is possible.

ati-ozgur avatar Dec 06 '12 14:12 ati-ozgur

I'm sure it is possible. The question is why is it necessary?

jodastephen avatar Dec 06 '12 14:12 jodastephen

If sql file content is preserved with multi lines, Database developer more easily re-use this files. I would like to copy paste sql from Sql Client (Toad, Sql Server Management Studio) to elsql file. Also copy paste from elsql to this sql clients. Right now : ElSql does not preserve multi lines therefore comments in sql does not work. Consider this example.

SELECT 
* FROM
EMPLOYEES  
WHERE
( -- only active employees
Status = 1
)

this sql is changed to following and gives sql error.

SELECT * FROM EMPLOYEES WHERE ( -- only active employees Status = 1)

I would like to use my sql scripts with least amount of modification.

ati-ozgur avatar Dec 06 '12 15:12 ati-ozgur

I fixed the trailing comment issue, but this one is surprisingly hard to fix as it has knock on effects all over the place,

jodastephen avatar Oct 17 '13 23:10 jodastephen