With this PR, only the records that match the ExploitType to be fetched will be deleted. In other words, ExploitType: OffensiveSecurity/GitHub/AwesomePoc can exist at the same time.
Type of change
[x] New feature (non-breaking change which adds functionality)
How Has This Been Tested?
$ go-exploitdb fetch exploitdb
$ go-exploitdb fetch awesomepoc
$ go-exploitdb fetch exploitdb
$ sqlite3 go-exploitdb.sqlite3
SQLite version 3.31.1 2020-01-27 19:55:54
Enter ".help" for usage hints.
// The data from the first fetch of exploitdb has been deleted, and the data from awesomepoc has been added to the top.
sqlite> select id, exploit_type from exploits LIMIT 5;
id|exploit_type
46788|AwesomePoc
46789|AwesomePoc
46790|AwesomePoc
46791|AwesomePoc
46792|AwesomePoc
// Of course, the data from Exploitdb is inserted at the end.
sqlite> select id, exploit_type from exploits ORDER By id desc LIMIT 5;
id|exploit_type
94397|OffensiveSecurity
94396|OffensiveSecurity
94395|OffensiveSecurity
94394|OffensiveSecurity
94393|OffensiveSecurity
$ go-exploitdb fetch githubrepos
$ sqlite3 go-exploitdb.sqlite3
SQLite version 3.31.1 2020-01-27 19:55:54
Enter ".help" for usage hints.
sqlite> select DISTINCT exploit_type from exploits;
exploit_type
AwesomePoc
OffensiveSecurity
GitHub
Checklist:
You don't have to satisfy all of the following.
[ ] Write tests
[ ] Write documentation
[x] Check that there aren't other open pull requests for the same issue/feature
[x] Format your source code by make fmt
[x] Pass the test by make test
[x] Provide verification config / commands
[x] Enable "Allow edits from maintainers" for this PR
What did you implement:
With this PR, only the records that match the ExploitType to be fetched will be deleted. In other words, ExploitType: OffensiveSecurity/GitHub/AwesomePoc can exist at the same time.
Type of change
How Has This Been Tested?
Checklist:
You don't have to satisfy all of the following.
make fmt
make test
Is this ready for review?: YES
Reference