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 format in Copy Create Statement #1300

Closed
pamtbaau opened this Issue Jan 18, 2018 · 5 comments

Comments

Projects
None yet
3 participants
@pamtbaau
Copy link

pamtbaau commented Jan 18, 2018

Details for the issue

When using Copy Create Statement and copying the statement in the SQL tab, the statement results in one long single line without multiple spaces, tabs and newlines.

CREATE VIEW equityExclAccounts as WITH recursive assets AS ( SELECT * FROM category ca WHERE type IN ('ASSETS', 'LIABILITIES') UNION SELECT ca.* FROM category ca JOIN assets a on a.id = ca.parentId WHERE ca.type != 'ACCOUNT' ) SELECT * FROM assets

When exporting the schema of a table/view, the schema preserves the newlines.

DROP VIEW IF EXISTS `equityExclAccounts`;
CREATE VIEW equityExclAccounts as 
WITH recursive assets AS 
( 
SELECT * 
FROM category ca 
WHERE type IN ('ASSETS', 'LIABILITIES')

UNION 

SELECT ca.* 
FROM category ca 
JOIN assets a on a.id = ca.parentId 
WHERE ca.type != 'ACCOUNT' 
) 
SELECT * FROM assets;
COMMIT;

Enhancement request:
Could newlines be preserved in Copy Create Statement too? And maybe tabs and spaces also?

Useful extra information

I'm opening this issue because:

  • DB4S is crashing
  • DB4S has a bug
  • DB4S needs a feature
  • DB4S has another problem

I'm using DB4S on:

  • Windows: ( version: 10 )
  • Linux: ( distro: ___ )
  • macOS: ( version: ___ )
  • Other: ___

I'm using DB4S version:

  • 3.10.1
  • 3.10.0
  • 3.9.1
  • Other:

I have also:

mgrojo added a commit that referenced this issue Jan 18, 2018

Preserve format in Copy Create Statement
The original Create statement formatting is preserved when the menu option
"Copy Create statement" is selected, regardless of the setting that removes
the line breaks in the schema view.

The Edit Role is requested to the model for getting the original text data.

See issue #1300

mgrojo added a commit that referenced this issue Jan 18, 2018

Preserve format in Copy Create Statement
The original Create statement formatting is preserved when the menu option
"Copy Create statement" is selected, regardless of the setting that removes
the line breaks in the schema view.

The Edit Role is requested to the model for getting the original text data.

See issue #1300

@mgrojo mgrojo self-assigned this Jan 18, 2018

@mgrojo

This comment has been minimized.

Copy link
Contributor

mgrojo commented Jan 18, 2018

@pamtbaau This was easy to improve 😃 Could you check it the next nightly build?

@pamtbaau

This comment has been minimized.

Copy link
Author

pamtbaau commented Jan 19, 2018

Why oh why haven't I requested this before... 🤦‍♂️ Thanks a lot, this save me a lot of formatting!

@justinclift

This comment has been minimized.

Copy link
Member

justinclift commented Jan 19, 2018

@pamtbaau Cool. All good, and ok to close this now? 😄

@pamtbaau

This comment has been minimized.

Copy link
Author

pamtbaau commented Jan 20, 2018

Sure, this issue can be closed.

@justinclift

This comment has been minimized.

Copy link
Member

justinclift commented Jan 20, 2018

Awesome. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment