tursodatabase / turso-cli

Command line interface to Turso.
https://turso.tech
MIT License
229 stars 37 forks source link

Issue#917: Add a check to know if database is archived #920

Closed ashishgangaramani closed 3 weeks ago

ashishgangaramani commented 1 month ago

917

Add a check to see if the database is archived. If yes, a warning message prompting the user to unarchive the group this database belongs to will appear.

ashishgangaramani commented 3 weeks ago

I have addressed issue #917 with this pull request. If you have any feedback or need further changes, please let me know. Otherwise, if everything looks good, could you please proceed with merging it?

Thank you for your time and assistance!

Best regards, Ashish Babish Gangaramani

avinassh commented 3 weeks ago

Hi, the code doesn't exit after printing the error. It should not proceed further.

Also * within the message don't do anything when printed. Just remove them so that it prints:

Your DB might be archived. Please run `turso group unarchive <group name here>` to unarchive it
ashishgangaramani commented 3 weeks ago

Hi, Thanks for your prompt feedback. As you requested, I have made the changes kindly take a look.

avinassh commented 3 weeks ago

Hey @ashishgangaramani, this looks good. However I missed one thing in my earlier review. Why not do the check right after if !isURL(nameOrUrl) if else block (i.e. line 187). Right now the code is checking for status when an SQL query is passed to the shell or when it is running the shell directly. But since it is doing the checks at both places anyway, we can instead do it before and fail early.

ashishgangaramani commented 3 weeks ago

*re-opening pull request

ashishgangaramani commented 3 weeks ago

Hi @avinassh,

Thank you for your insightful suggestions. I have implemented the changes as advised. Could you please review them and let me know if any further modifications are needed?

avinassh commented 3 weeks ago

Thank you @ashishgangaramani