Header menu logo TestPrune

Database Type

SQLite-backed dependency graph storage.

Constructors

Constructor Description

Database(dbPath)

Full Usage: Database(dbPath)

Parameters:
    dbPath : string

Returns: Database
dbPath : string
Returns: Database

Instance members

Instance member Description

this.ClearEvents

Full Usage: this.ClearEvents

Parameters:
    runId : string

Delete all events for a given run ID.

runId : string

this.GetAllHandlerSourceFiles

Full Usage: this.GetAllHandlerSourceFiles

Returns: Set<string>

Get all handler source files in the route_handlers table.

Returns: Set<string>

this.GetAllRouteHandlers

Full Usage: this.GetAllRouteHandlers

Returns: RouteHandlerEntry list

Get all route handler entries.

Returns: RouteHandlerEntry list

this.GetAllSymbolNames

Full Usage: this.GetAllSymbolNames

Returns: Set<string>

Return the set of all symbol full names.

Returns: Set<string>

this.GetAllSymbols

Full Usage: this.GetAllSymbols

Returns: SymbolInfo list

Return all symbols ordered by file and line.

Returns: SymbolInfo list

this.GetDependenciesFromFile

Full Usage: this.GetDependenciesFromFile

Parameters:
    sourceFile : string

Returns: Dependency list

Get dependencies originating from symbols defined in the given source file.

sourceFile : string
Returns: Dependency list

this.GetEvents

Full Usage: this.GetEvents

Parameters:
    runId : string

Returns: (string * string * string) list

Get all events for a given run ID, ordered by insertion order.

runId : string
Returns: (string * string * string) list

this.GetFileKey

Full Usage: this.GetFileKey

Parameters:
    sourceFile : string

Returns: string option

Get the stored cache key for a source file, or None if not yet indexed.

sourceFile : string
Returns: string option

this.GetIncomingEdgesBatch

Full Usage: this.GetIncomingEdgesBatch

Parameters:
    symbolNames : string list

Returns: Map<string, string list>

Get incoming edges for a batch of symbol names (who depends on each).

symbolNames : string list
Returns: Map<string, string list>

this.GetProjectKey

Full Usage: this.GetProjectKey

Parameters:
    projectName : string

Returns: string option

Get the stored cache key for a project, or None if not yet indexed.

projectName : string
Returns: string option

this.GetReachableSymbols

Full Usage: this.GetReachableSymbols

Parameters:
    rootSymbolNames : string list

Returns: Set<string>

Get all symbols reachable from the given root symbol names (transitively).

rootSymbolNames : string list
Returns: Set<string>

this.GetSymbolsInFile

Full Usage: this.GetSymbolsInFile

Parameters:
    sourceFile : string

Returns: SymbolInfo list

Return all symbols stored for a given source file path.

sourceFile : string
Returns: SymbolInfo list

this.GetTestMethodSymbolNames

Full Usage: this.GetTestMethodSymbolNames

Returns: Set<string>

Return the set of symbol names that are test methods.

Returns: Set<string>

this.GetTestMethodsInFile

Full Usage: this.GetTestMethodsInFile

Parameters:
    sourceFile : string

Returns: TestMethodInfo list

Get test methods whose symbol is defined in the given source file.

sourceFile : string
Returns: TestMethodInfo list

this.GetUrlPatternsForSourceFile

Full Usage: this.GetUrlPatternsForSourceFile

Parameters:
    sourceFile : string

Returns: string list

Get all URL patterns served by a given handler source file.

sourceFile : string
Returns: string list

this.InsertEvent

Full Usage: this.InsertEvent

Parameters:
    runId : string
    timestamp : string
    eventType : string
    eventData : string

Insert an audit event into the analysis_events table.

runId : string
timestamp : string
eventType : string
eventData : string

this.QueryAffectedTests

Full Usage: this.QueryAffectedTests

Parameters:
    changedSymbolNames : string list

Returns: TestMethodInfo list

Find test methods transitively depending on the given changed symbol names.

changedSymbolNames : string list
Returns: TestMethodInfo list

this.RebuildProjects

Full Usage: this.RebuildProjects

Parameters:
    results : AnalysisResult list
    ?fileKeys : (string * string) list
    ?projectKeys : (string * string) list

Clear and re-insert symbols, dependencies, and test methods. All symbols are inserted before any dependencies, so cross-project edges resolve correctly. When called with a subset of projects, dependency edges to symbols in other projects will only resolve if those symbols already exist in the database from a prior call. Optional fileKeys/projectKeys are written in the same transaction for atomicity.

results : AnalysisResult list
?fileKeys : (string * string) list
?projectKeys : (string * string) list

this.RebuildRouteHandlers

Full Usage: this.RebuildRouteHandlers

Parameters:

Store route -> handler source file mappings. Clears and rebuilds all entries.

entries : RouteHandlerEntry list

Static members

Static member Description

Database.create dbPath

Full Usage: Database.create dbPath

Parameters:
    dbPath : string

Returns: Database

Create a Database instance, initializing the schema if needed.

dbPath : string
Returns: Database

Type something to start searching.