Skip to main content

Module database

Module database 

Source
Expand description

Module for database features (based on SQLite)

Structs§

Database
Manage the database according to the database model defined with MitreDatabase.
MitreData
The MitreData struct represents the necessary information to Mitre Data to used to.

Constants§

MITRE_DB_NAME
Mitre database name

Traits§

MitreDatabase
Define the tables definition for the Mitre data
MitreDefinition
Defines a MitreData definition.

Functions§

bind_criteria
Associate the list of arguments with the SQL query in construction
criteria_analysis
Analyse a string criteria and split each element by separating the words criteria from the operators.
db_mitre_path
Return the path of mitre database
execute_query
Executes a given query and processes the response.
find_capec_by_id
find the capec by its id.
find_columns
Finds the list of columns for the given table name
find_cwe_by_id
find the cwe by its id.
find_domain_and_criteria
Split the arguments list to domain and criteria. domain is corresponding to the name of field into the concerning table’s database.
find_mitre_by_id
Find the mitre record according to the mitre’s identification.
parse_id_to_u32
Parse the string values to a list of unsigned 32 bits. The string must be formatted like this: ::<num>::<num>::...::
prepare_query
Prepare the query model given as parameter with the elements of criteria
refresh_data_mitre_into_database
Refresh the Mitre data that will be injected into the local database.
refresh_mitre_database
Refresh the mitre database. the function takes a string that contains a list of csv files and the associated url. The method converts this string in an internal vector and create the query to download the CSV file from the associated url and inject these values into the local mitre database.
search
Search the list of words into the database.
searching
Search the values into the list of columns.
text_or_null
Return the Value::Null if the string argument is empty. Otherwise return the corresponding Value/

Type Aliases§

SearchResultExtractor
Record extractor from the search result