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

Closed
5 of 14 tasks
pamtbaau opened this issue Jan 18, 2018 · 5 comments
Closed
5 of 14 tasks

Preserve format in Copy Create Statement #1300

pamtbaau opened this issue Jan 18, 2018 · 5 comments
Assignees
Labels
enhancement Feature requests.

Comments

@pamtbaau
Copy link

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:

@justinclift justinclift added the enhancement Feature requests. label Jan 18, 2018
mgrojo added a commit that referenced this issue Jan 18, 2018
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
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
Copy link
Member

mgrojo commented Jan 18, 2018

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

@pamtbaau
Copy link
Author

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

@justinclift
Copy link
Member

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

@pamtbaau
Copy link
Author

Sure, this issue can be closed.

@justinclift
Copy link
Member

Awesome. 😄

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

No branches or pull requests

3 participants