Skip to content
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

Preserve MultiLine SQL #1

Open
ati-ozgur opened this issue Dec 6, 2012 · 3 comments
Open

Preserve MultiLine SQL #1

ati-ozgur opened this issue Dec 6, 2012 · 3 comments

Comments

@ati-ozgur
Copy link
Contributor

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.

@jodastephen
Copy link
Member

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

@ati-ozgur
Copy link
Contributor Author

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.

@jodastephen
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants