Db
numbat.db
SqliteHelper
Helper class for sqlite operation
connect
staticmethod
Wrapper for sqlite3 connect method so the api doesn't rely directly on sqlite and his more general
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path |
str
|
The path to the database, if the path doesn't point to an existing file, a new database file will be created |
required |
Returns:
Type | Description |
---|---|
Connection
|
A connection handle that can be used for future operation on the database |
exec
staticmethod
Execute the sqlite request without returning the result
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
request |
str
|
The SQL request to execute |
required |
parameters |
tuple
|
A tuple containing values for the bind parameters of the SQL request (if any) |
()
|
Returns:
Type | Description |
---|---|
int
|
The id of the last modified row (useful in case insertion) |
fetch
staticmethod
Return the result of the sqlite request as list
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
request |
str
|
The SQL request to execute |
required |
parameters |
tuple
|
A tuple containing values for the bind parameters of the SQL request (if any) |
()
|
Returns:
Type | Description |
---|---|
list
|
A list containing the results of the SQL request |
ElementDAO
This class is a static class that can manipulate Element objects, inserting and removing them from a sqlite database.
create_table
staticmethod
Create the element table of the Sourcetrail database if it doesn't exist.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
Returns:
Type | Description |
---|---|
None
|
None |
delete_table
staticmethod
Delete the element table of the Sourcetrail database only if it exists.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
Returns:
Type | Description |
---|---|
None
|
None |
new
staticmethod
Insert a new Element inside the element table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
obj |
Element
|
The object to insert |
required |
Returns:
Type | Description |
---|---|
int
|
The id of the inserted element |
delete
staticmethod
Delete an Element from the element table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
obj |
Element
|
The object to delete |
required |
Returns:
Type | Description |
---|---|
None
|
None |
clear
staticmethod
Delete all Elements from the element table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
Returns:
Type | Description |
---|---|
None
|
None |
get
staticmethod
Return an element from the database with the matching id
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
elem_id |
int
|
The id of the element to retrieve |
required |
Returns:
Type | Description |
---|---|
Element
|
A Element object that reflect the content inside the database |
update
staticmethod
Update an Element inside the element table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
obj |
Element
|
The Element object to update |
required |
Returns:
Type | Description |
---|---|
None
|
None |
ElementComponentDAO
This class is a static class that can manipulate ElementComponent objects, inserting and removing them from a sqlite database.
create_table
staticmethod
Create the element_component table of the Sourcetrail database if it doesn't exist.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
Returns:
Type | Description |
---|---|
None
|
None |
delete_table
staticmethod
Delete the element_component table of the Sourcetrail database only if it exists.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
Returns:
Type | Description |
---|---|
None
|
None |
new
staticmethod
Insert a new ElementComponent inside the element_component table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
obj |
ElementComponent
|
The object to insert |
required |
Returns:
Type | Description |
---|---|
int
|
The id of the inserted element |
delete
staticmethod
Delete an ElementComponent from the element_component table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
obj |
ElementComponent
|
The object to delete |
required |
Returns:
Type | Description |
---|---|
None
|
None |
clear
staticmethod
Delete all ElementComponents from the element_component table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
Returns:
Type | Description |
---|---|
None
|
None |
get
staticmethod
Return a ElementComponent from the database with the matching id
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
elem_id |
int
|
The id of the element_component to retrieve |
required |
Returns:
Type | Description |
---|---|
ElementComponent
|
A ElementComponent object that reflect the content inside the database |
update
staticmethod
Update an ElementComponent inside the element_component table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
obj |
ElementComponent
|
The Element object to update |
required |
Returns:
Type | Description |
---|---|
None
|
None |
list
staticmethod
Return the list of all the elements from the element_component table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
Returns:
Type | Description |
---|---|
list[ElementComponent]
|
The list of ElementComponents |
EdgeDAO
This class is a static class that can manipulate Edge objects, inserting and removing them from a sqlite database.
create_table
staticmethod
Create the edge table of the Sourcetrail database if it doesn't exist.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
Returns:
Type | Description |
---|---|
None
|
None |
delete_table
staticmethod
Delete the edge table of the Sourcetrail database only if it exists.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
Returns:
Type | Description |
---|---|
None
|
None |
new
staticmethod
Insert a new Edge inside the edge table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
obj |
Edge
|
The object to insert |
required |
Returns:
Type | Description |
---|---|
int
|
The id of the inserted element |
delete
staticmethod
Delete an Edge from the edge table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
obj |
Edge
|
The object to delete |
required |
Returns:
Type | Description |
---|---|
None
|
None |
clear
staticmethod
Delete all Edges from the edge table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
Returns:
Type | Description |
---|---|
None
|
None |
get
staticmethod
Return an Edge from the database with the matching id
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
elem_id |
int
|
The id of the element to retrieve |
required |
Returns:
Type | Description |
---|---|
Edge
|
A Edge object that reflect the content inside the database |
update
staticmethod
Update an Edge inside the element table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
obj |
Edge
|
The Edge object to update |
required |
Returns:
Type | Description |
---|---|
None
|
None |
NodeDAO
This class is a static class that can manipulate Node objects, inserting and removing them from a sqlite database.
create_table
staticmethod
Create the node table of the Sourcetrail database if it doesn't exist.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
Returns:
Type | Description |
---|---|
None
|
None |
delete_table
staticmethod
Delete the node table of the Sourcetrail database only if it exists.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
Returns:
Type | Description |
---|---|
None
|
None |
new
staticmethod
Insert a new Node inside the node table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
obj |
Node
|
The object to insert |
required |
Returns:
Type | Description |
---|---|
int
|
The id of the inserted element |
delete
staticmethod
Delete a Node from the node table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
obj |
Node
|
The object to delete |
required |
Returns:
Type | Description |
---|---|
None
|
None |
clear
staticmethod
Delete all Nodes from the node table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
Returns:
Type | Description |
---|---|
None
|
None |
get
staticmethod
Return a Node from the database with the matching id
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
elem_id |
int
|
The id of the element to retrieve |
required |
Returns:
Type | Description |
---|---|
Node
|
A Node object that reflect the content inside the database |
get_by_name
staticmethod
Return a Node from the database with the matching serialized_name
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
name |
str
|
The serialized_name of the element to retrieve |
required |
Returns:
Type | Description |
---|---|
Node
|
A Node object that reflect the content inside the database |
update
staticmethod
Update a Node inside the node table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
obj |
Node
|
The Node object to update |
required |
Returns:
Type | Description |
---|---|
None
|
None |
SymbolDAO
This class is a static class that can manipulate Symbol objects, inserting and removing them from a sqlite database.
create_table
staticmethod
Create the symbol table of the Sourcetrail database if it doesn't exist.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
Returns:
Type | Description |
---|---|
None
|
None |
delete_table
staticmethod
Delete the symbol table of the Sourcetrail database only if it exists.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
Returns:
Type | Description |
---|---|
None
|
None |
new
staticmethod
Insert a new Symbol inside the symbol table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
obj |
Symbol
|
The object to insert |
required |
Returns:
Type | Description |
---|---|
int
|
The id of the inserted symbol |
delete
staticmethod
Delete a Symbol from the symbol table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
obj |
Symbol
|
The object to delete |
required |
Returns:
Type | Description |
---|---|
None
|
None |
clear
staticmethod
Delete all Symbols from the symbol table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
Returns:
Type | Description |
---|---|
None
|
None |
get
staticmethod
Return a symbol from the database with the matching id
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
elem_id |
int
|
The id of the symbol to retrieve |
required |
Returns:
Type | Description |
---|---|
Symbol
|
A Symbol object that reflect the content inside the database |
update
staticmethod
Update a Symbol inside the symbol table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
obj |
Symbol
|
The Symbol object to update |
required |
Returns:
Type | Description |
---|---|
None
|
None |
FileDAO
This class is a static class that can manipulate File objects, inserting and removing them from a sqlite database.
create_table
staticmethod
Create the file table of the Sourcetrail database if it doesn't exist.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
Returns:
Type | Description |
---|---|
None
|
None |
delete_table
staticmethod
Delete the file table of the Sourcetrail database only if it exists.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
Returns:
Type | Description |
---|---|
None
|
None |
new
staticmethod
Insert a new File inside the file table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
obj |
File
|
The object to insert |
required |
Returns:
Type | Description |
---|---|
int
|
The id of the inserted file |
delete
staticmethod
Delete a File from the file table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
obj |
File
|
The object to delete |
required |
Returns:
Type | Description |
---|---|
None
|
None |
clear
staticmethod
Delete all Files from the file table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
Returns:
Type | Description |
---|---|
None
|
None |
get
staticmethod
Return a file from the database with the matching id
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
elem_id |
int
|
The id of the file to retrieve |
required |
Returns:
Type | Description |
---|---|
File
|
A File object that reflect the content inside the database |
update
staticmethod
Update a File inside the file table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
obj |
File
|
The File object to update |
required |
Returns:
Type | Description |
---|---|
None
|
None |
FileContentDAO
This class is a static class that can manipulate FileContent objects, inserting and removing them from a sqlite database.
create_table
staticmethod
Create the filecontent table of the Sourcetrail database if it doesn't exist.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
Returns:
Type | Description |
---|---|
None
|
None |
delete_table
staticmethod
Delete the filecontent table of the Sourcetrail database only if it exists.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
Returns:
Type | Description |
---|---|
None
|
None |
new
staticmethod
Insert a new FileContent inside the filecontent table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
obj |
FileContent
|
The object to insert |
required |
Returns:
Type | Description |
---|---|
int
|
The id of the inserted filecontent |
delete
staticmethod
Delete an FileContent from the filecontent table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
obj |
FileContent
|
The object to delete |
required |
Returns:
Type | Description |
---|---|
None
|
None |
clear
staticmethod
Delete all FileContents from the filecontent table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
Returns:
Type | Description |
---|---|
None
|
None |
get
staticmethod
Return a filecontent from the database with the matching id
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
elem_id |
int
|
The id of the filecontent to retrieve |
required |
Returns:
Type | Description |
---|---|
FileContent
|
A FileContent object that reflect the content inside the database |
update
staticmethod
Update an FileContent inside the filecontent table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
obj |
FileContent
|
The FileContent object to update |
required |
Returns:
Type | Description |
---|---|
None
|
None |
list
staticmethod
Return the list of all the filecontents from the filecontent table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
Returns:
Type | Description |
---|---|
list[FileContent]
|
The list of FileContents |
LocalSymbolDAO
This class is a static class that can manipulate LocalSymbol objects, inserting and removing them from a sqlite database.
create_table
staticmethod
Create the local_symbol table of the Sourcetrail database if it doesn't exist.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
Returns:
Type | Description |
---|---|
None
|
None |
delete_table
staticmethod
Delete the local_symbol table of the Sourcetrail database only if it exists.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
Returns:
Type | Description |
---|---|
None
|
None |
new
staticmethod
Insert a new LocalSymbol inside the local_symbol table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
obj |
LocalSymbol
|
The object to insert |
required |
Returns:
Type | Description |
---|---|
int
|
The id of the inserted local_symbol |
delete
staticmethod
Delete an LocalSymbol from the local_symbol table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
obj |
LocalSymbol
|
The object to delete |
required |
Returns:
Type | Description |
---|---|
None
|
None |
clear
staticmethod
Delete all LocalSymbols from the local_symbol table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
Returns:
Type | Description |
---|---|
None
|
None |
get
staticmethod
Return a local_symbol from the database with the matching id
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
elem_id |
int
|
The id of the local_symbol to retrieve |
required |
Returns:
Type | Description |
---|---|
LocalSymbol
|
A LocalSymbol object that reflect the content inside the database |
get_from_name
staticmethod
Return a local_symbol from the database with the matching name
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
name |
str
|
The name of the local_symbol to retrieve |
required |
Returns:
Type | Description |
---|---|
LocalSymbol
|
A LocalSymbol object that reflect the content inside the database |
update
staticmethod
Update an LocalSymbol inside the local_symbol table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
obj |
LocalSymbol
|
The LocalSymbol object to update |
required |
Returns:
Type | Description |
---|---|
None
|
None |
list
staticmethod
Return the list of all the local_symbols from the local_symbol table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
Returns:
Type | Description |
---|---|
list[LocalSymbol]
|
The list of LocalSymbols |
SourceLocationDAO
This class is a static class that can manipulate SourceLocation objects, inserting and removing them from a sqlite database.
create_table
staticmethod
Create the source_location table of the Sourcetrail database if it doesn't exist.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
Returns:
Type | Description |
---|---|
None
|
None |
delete_table
staticmethod
Delete the source_location table of the Sourcetrail database only if it exists.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
Returns:
Type | Description |
---|---|
None
|
None |
new
staticmethod
Insert a new SourceLocation inside the source_location table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
obj |
SourceLocation
|
The object to insert |
required |
Returns:
Type | Description |
---|---|
int
|
The id of the inserted source_location |
delete
staticmethod
Delete an SourceLocation from the source_location table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
obj |
SourceLocation
|
The object to delete |
required |
Returns:
Type | Description |
---|---|
None
|
None |
clear
staticmethod
Delete all SourceLocations from the source_location table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
Returns:
Type | Description |
---|---|
None
|
None |
get
staticmethod
Return a source_location from the database with the matching id
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
elem_id |
int
|
The id of the source_location to retrieve |
required |
Returns:
Type | Description |
---|---|
SourceLocation
|
A SourceLocation object that reflect the content inside the database |
update
staticmethod
Update an SourceLocation inside the source_location table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
obj |
SourceLocation
|
The SourceLocation object to update |
required |
Returns:
Type | Description |
---|---|
None
|
None |
list
staticmethod
Return the list of all the source_locations from the source_location table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
Returns:
Type | Description |
---|---|
list[SourceLocation]
|
The list of SourceLocations |
OccurrenceDAO
This class is a static class that can manipulate Occurrence objects, inserting and removing them from a sqlite database.
create_table
staticmethod
Create the occurrence table of the Sourcetrail database if it doesn't exist.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
Returns:
Type | Description |
---|---|
None
|
None |
delete_table
staticmethod
Delete the occurrence table of the Sourcetrail database only if it exists.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
Returns:
Type | Description |
---|---|
None
|
None |
new
staticmethod
Insert a new Occurrence inside the occurrence table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
obj |
Occurrence
|
The object to insert |
required |
Returns:
Type | Description |
---|---|
int
|
The id of the inserted occurrence |
delete
staticmethod
Delete an Occurrence from the occurrence table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
obj |
Occurrence
|
The object to delete |
required |
Returns:
Type | Description |
---|---|
None
|
None |
clear
staticmethod
Delete all Occurrences from the occurrence table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
Returns:
Type | Description |
---|---|
None
|
None |
get
staticmethod
Return an occurrence from the database with the matching id
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
elem_id |
int
|
The id of the occurrence to retrieve |
required |
Returns:
Type | Description |
---|---|
Occurrence
|
A Occurrence object that reflect the content inside the database |
update
staticmethod
Update an Occurrence inside the occurrence table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
obj |
Occurrence
|
The Occurrence object to update |
required |
Returns:
Type | Description |
---|---|
None
|
None |
list
staticmethod
Return the list of all the occurrences from the occurrence table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
Returns:
Type | Description |
---|---|
list[Occurrence]
|
The list of Occurrences |
ComponentAccessDAO
This class is a static class that can manipulate ComponentAccess objects, inserting and removing them from a sqlite database.
create_table
staticmethod
Create the component_access table of the Sourcetrail database if it doesn't exist.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
Returns:
Type | Description |
---|---|
None
|
None |
delete_table
staticmethod
Delete the component_access table of the Sourcetrail database only if it exists.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
Returns:
Type | Description |
---|---|
None
|
None |
new
staticmethod
Insert a new ComponentAccess inside the component_access table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
obj |
ComponentAccess
|
The object to insert |
required |
Returns:
Type | Description |
---|---|
int
|
The id of the inserted component_access |
delete
staticmethod
Delete an ComponentAccess from the component_access table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
obj |
ComponentAccess
|
The object to delete |
required |
Returns:
Type | Description |
---|---|
None
|
None |
clear
staticmethod
Delete all ComponentAccess from the component_access table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
Returns:
Type | Description |
---|---|
None
|
None |
get
staticmethod
Return a component_access from the database with the matching id
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
elem_id |
int
|
The id of the component_access to retrieve |
required |
Returns:
Type | Description |
---|---|
ComponentAccess
|
A ComponentAccess object that reflect the content inside the database |
update
staticmethod
Update an ComponentAccess inside the component_access table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
obj |
ComponentAccess
|
The ComponentAccess object to update |
required |
Returns:
Type | Description |
---|---|
None
|
None |
list
staticmethod
Return the list of all the component_access from the component_access table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
Returns:
Type | Description |
---|---|
list[ComponentAccess]
|
The list of ComponentAccess |
ErrorDAO
This class is a static class that can manipulate Error objects, inserting and removing them from a sqlite database.
create_table
staticmethod
Create the error table of the Sourcetrail database if it doesn't exist.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
Returns:
Type | Description |
---|---|
None
|
None |
delete_table
staticmethod
Delete the error table of the Sourcetrail database only if it exists.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
Returns:
Type | Description |
---|---|
None
|
None |
new
staticmethod
Insert a new Error inside the error table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
obj |
Error
|
The object to insert |
required |
Returns:
Type | Description |
---|---|
int
|
The id of the inserted error |
delete
staticmethod
Delete an Error from the error table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
obj |
Error
|
The object to delete |
required |
Returns:
Type | Description |
---|---|
None
|
None |
get
staticmethod
Return an error from the database with the matching id
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
elem_id |
int
|
The id of the error to retrieve |
required |
Returns:
Type | Description |
---|---|
Error
|
A Error object that reflect the content inside the database |
clear
staticmethod
Delete all Errors from the error table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
Returns:
Type | Description |
---|---|
None
|
None |
update
staticmethod
Update an Error inside the error table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
obj |
Error
|
The Error object to update |
required |
Returns:
Type | Description |
---|---|
None
|
None |
MetaDAO
This class is a static class that can manipulate Meta information, inserting and removing them from a sqlite database. There is no Meta object but a simple key, value pair can be used.
create_table
staticmethod
Create the meta table of the Sourcetrail database if it doesn't exist.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
Returns:
Type | Description |
---|---|
None
|
None |
delete_table
staticmethod
Delete the meta table of the Sourcetrail database only if it exists.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
Returns:
Type | Description |
---|---|
None
|
None |
new
staticmethod
Insert a new Meta inside the meta table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
key |
str
|
The key to insert |
required |
value |
str
|
The value to insert |
required |
Returns:
Type | Description |
---|---|
int
|
The id of the inserted meta |
delete
staticmethod
Delete a Meta from the meta table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
id_ |
int
|
The identifier of the object to delete |
required |
Returns:
Type | Description |
---|---|
None
|
None |
get
staticmethod
Return a meta from the database with the matching id
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
id_ |
int
|
The id of the meta to retrieve |
required |
Returns:
Type | Description |
---|---|
tuple[int, str, str]
|
A Meta object that reflect the content inside the database |
clear
staticmethod
Delete all Metas from the meta table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
Returns:
Type | Description |
---|---|
None
|
None |
update
staticmethod
Update a Meta inside the meta table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
id_ |
int
|
The id of the meta to update |
required |
key |
str
|
The key to update |
required |
value |
str
|
The value to insert |
required |
Returns:
Type | Description |
---|---|
None
|
None |
list
staticmethod
Return the list of all the metas from the meta table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database |
Connection
|
A database handle |
required |
Returns:
Type | Description |
---|---|
list[tuple[int, str, str]]
|
The list of Metas |