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

Add functionality for delete command #25

Closed
joshiayush opened this issue Dec 7, 2021 · 0 comments
Closed

Add functionality for delete command #25

joshiayush opened this issue Dec 7, 2021 · 0 comments
Assignees
Labels
contributions welcome External contributions are welcome enhancement New feature or request good first issue Good for newcomers

Comments

@joshiayush
Copy link
Owner

Description

def delete(self: Command) -> None:
"""Method `delete()` deletes user's information from database.
This feature is not programed yet. Contributions are welcome.
Args:
self: (Command) Self.
Example:
>>> from argparse import Namespace
>>> from inbparser import Command
>>>
>>> namespace = Namespace(which='delete', keyword='email') # Not designed yet
>>> command = Command(namespace)
>>> command.delete()
>>> # -> It should remove values from database
"""
self.logger.info("facility not present")

As of now command delete which is meant to delete the user's information from the database or the entire database, does not work. It will be a good feature to implement in conjunction with config command to give user's the ability to create and remove database entries or to remove the entire database with the help of the delete command.

Possible solutions

  1. Check if we have write permissions.
  2. Check if database exists, if yes then follow step 3.
  3. If requested to delete entries, delete the entries using the Python SQLite API using which the database was created.
  4. If requested to delete the entire database, execute rm -f command on the database.
@joshiayush joshiayush added enhancement New feature or request good first issue Good for newcomers feature request contributions welcome External contributions are welcome labels Dec 7, 2021
@joshiayush joshiayush self-assigned this Dec 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributions welcome External contributions are welcome enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant