Package ghidra.features.bsim.query.file
Class H2VectorTable
java.lang.Object
ghidra.features.bsim.query.client.tables.SQLComplexTable
ghidra.features.bsim.query.file.H2VectorTable
-
Field Summary
FieldsFields inherited from class ghidra.features.bsim.query.client.tables.SQLComplexTable
db, idColumnName, tableName -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidCreates the db table.intdelete(long id) Deletes the row with the given id from the db.intdeleteVector(long id, int countDiff) Update vector table entry with the specified countDiff.voidDrops the current table.longInserts a row(s) into the db.queryVectorById(long id) Get vector details which correspond to specified vector IDRead all vectors from table and generate an ID-based vector maplongupdateVector(LSHVector vec, int countDiff) Update or insert vector table entry with the specified positive countDiff.Methods inherited from class ghidra.features.bsim.query.client.tables.SQLComplexTable
setConnection
-
Field Details
-
TABLE_NAME
- See Also:
-
-
Constructor Details
-
H2VectorTable
-
-
Method Details
-
close
public void close()- Overrides:
closein classSQLComplexTable
-
create
Description copied from class:SQLComplexTableCreates the db table.- Specified by:
createin classSQLComplexTable- Parameters:
st- the query statement- Throws:
SQLException- if there is a problem
-
drop
Description copied from class:SQLComplexTableDrops the current table. NOTE: If explicitly created index tables exist they should be removed first or this method override.- Overrides:
dropin classSQLComplexTable- Parameters:
st- the query statement- Throws:
SQLException- if there is a problem with the execute update command
-
insert
Description copied from class:SQLComplexTableInserts a row(s) into the db. The arguments passed to this function are by definition not known, so they are left as a variable-length list ofObjectinstances, to be interpreted by the implementer.- Specified by:
insertin classSQLComplexTable- Parameters:
arguments- any arguments required for the insert- Returns:
- to be defined by the implementor
- Throws:
SQLException- if there is a problem executing the insert command
-
readVectors
Read all vectors from table and generate an ID-based vector map- Returns:
- vector map (ID->VectorStoreEntry)
- Throws:
SQLException- if error occurs
-
queryVectorById
Get vector details which correspond to specified vector ID- Parameters:
id- vector ID- Returns:
- vector details
- Throws:
SQLException- if error occurs
-
updateVector
Update or insert vector table entry with the specified positive countDiff.- Parameters:
vec- vectorcountDiff- positive vector count change- Returns:
- vector ID which was updated or created
- Throws:
SQLException- if an error occurs
-
deleteVector
Update vector table entry with the specified countDiff. Record will be removed if reduced vector count less-than-or-equal zero.- Parameters:
id- vector IDcountDiff- positive vector count reduction- Returns:
- 0 if decrement short of 0, return 1 if record was removed, return -1 if there was a problem
- Throws:
SQLException- if an error occurs
-
delete
Description copied from class:SQLComplexTableDeletes the row with the given id from the db. Users must set theDELETE_STMTstring to delete the exact table they need.- Overrides:
deletein classSQLComplexTable- Parameters:
id- the database row ID- Returns:
- the number of deleted rows
- Throws:
SQLException- if there is a problem creating or executing the query
-