Skip to content

Conversation

@huboneo
Copy link
Contributor

@huboneo huboneo commented Aug 12, 2019

This PR adds support for exporting the result of :history as TXT.

STR

  • run :history
  • Select "Export TXT" from export dropdown

Screenshots

Screenshot 2019-08-13 at 10 43 14

Screenshot 2019-08-13 at 10 41 24

@huboneo
Copy link
Contributor Author

huboneo commented Aug 12, 2019

@jexp
Copy link
Member

jexp commented Aug 12, 2019

Thanks a lot Hugo for working on this.

How about a plain text download? Just as semicolon and newline separated statements in a .cypher script file instead?

I guess CSV will be quite horrible with regard to excaped double quotes "?

@huboneo huboneo force-pushed the feature-export-history branch from 183012b to 5c57766 Compare August 12, 2019 11:26
@huboneo
Copy link
Contributor Author

huboneo commented Aug 12, 2019

@jexp Thank you for your feedback. I have updated the PR to export as TXT (:cmds are not valid cypher)

Copy link
Member

@oskarhane oskarhane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM except from a point on when and when not to add semicolons at the end.

const { frame } = this.props

if (frame.type === 'history') {
const asTxt = frame.result.join(';\n\n')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you check so the statement isn't already ending with a semicolon?
Also, client commands (statements starting with :) should / cannot end with a semicolon, only Cypher.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done!

@jexp
Copy link
Member

jexp commented Aug 12, 2019

Perfect thanks.

What's cool though even as :commands are not valid cypher they should still work
if you run them with cypher-shell or paste/d&d into neo4j-browser for multi-line mode.

@huboneo huboneo requested a review from oskarhane August 13, 2019 08:42
Copy link
Member

@oskarhane oskarhane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@huboneo huboneo merged commit 816c973 into neo4j:master Aug 13, 2019
@huboneo huboneo deleted the feature-export-history branch August 13, 2019 13:55
@ryguyrg
Copy link

ryguyrg commented Aug 13, 2019

SWEET!!! Super helpful!!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants