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

Upload of table content #114

Open
MartinStenzig opened this issue Aug 31, 2023 · 2 comments
Open

Upload of table content #114

MartinStenzig opened this issue Aug 31, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@MartinStenzig
Copy link

Thomas, love the tool. I just wanted to see if you already have or considered functionality to upload content from i.e. csv files? At present I can easily use it to download/backup table content via hana-cli querySimple -q "select * from $tableName" -n ./$exportDirName/$tableName -o "csv" . It would be great (and maybe there is already, but I could not find it in the documentation) if you could do something like hana-cli import -n ./$exportDirName/$tableName -o "csv" --truncateAllBefore
Looking forward to seeing you in India.

@jung-thomas
Copy link
Contributor

I have thought about that kind of command but intentionally avoided it. As a general rule I try to avoid features in the hana-cli that would be direct duplicate of the HANA SQL Command Line (hdbsql). There is the command hana-cli hdbsql that will start hdbsql with the credentials and context of the hana-cli. And then you can fire off commands like the IMPORT statement.

The one time I most blatantly violated that rule was with the querySimple command. :) That clearly could be done via the hdbsql and I brought that over to hana-cli out of pure convenience and because I wanted to make the export of results easier. And now I'm talking myself right into your request. Because like the querySimple export, an import from hana-cli could be client based and not server side file system based. But it would be an extra dangerous command since it would change data and not just read it.

It is something I'll consider. I have a few other features in the backlog I have to finish ahead of this for Devtoberfest anyway. But I would be interested in other users' opinions on this too.

@jung-thomas jung-thomas self-assigned this Aug 31, 2023
@jung-thomas jung-thomas added the enhancement New feature or request label Aug 31, 2023
@MartinStenzig
Copy link
Author

Fully understand the reasoning. Just to let you know, hana-cli compared to hdbsql allows me to export directly to my file system and I don't have to point the export or export into to a 3rd party provider location. Same with the import. So if anybody asks me, I think there is no other tool (other than hana-cli) that allows the easy export to my local file system without jumping through hoops. Not to mention that you provide additional functionality i.e. json output etc.

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

No branches or pull requests

2 participants