@@ -36,11 +36,15 @@ MERGE (file)-[:INCLUDE]->(func)
3636 TemplateMergeLinkFuncReference = "MERGE (%s)-[:FUNC_REFERENCE]->(%s)"
3737)
3838
39- type Neo4jDriver struct {
39+ type neo4jDriver struct {
4040 neo4j.DriverWithContext
4141}
4242
43- func (d * Neo4jDriver ) UploadFileResult (wc * WorkspaceConfig , f * extractor.FunctionFileResult , ctx context.Context ) error {
43+ func (d * neo4jDriver ) GetType () DriverType {
44+ return DtNeo4j
45+ }
46+
47+ func (d * neo4jDriver ) UploadFileResult (wc * WorkspaceConfig , f * extractor.FunctionFileResult , ctx context.Context ) error {
4448 session := d .DriverWithContext .NewSession (ctx , neo4j.SessionConfig {})
4549 defer session .Close (ctx )
4650 _ , err := session .ExecuteWrite (ctx , createFunctionFileTransaction (wc , f , ctx ))
@@ -50,7 +54,7 @@ func (d *Neo4jDriver) UploadFileResult(wc *WorkspaceConfig, f *extractor.Functio
5054 return nil
5155}
5256
53- func (d * Neo4jDriver ) UploadFuncContext (wc * WorkspaceConfig , f * FunctionContext , ctx context.Context ) error {
57+ func (d * neo4jDriver ) UploadFuncContext (wc * WorkspaceConfig , f * FunctionContext , ctx context.Context ) error {
5458 // session is cheap to create
5559 session := d .DriverWithContext .NewSession (ctx , neo4j.SessionConfig {})
5660 defer session .Close (ctx )
@@ -61,7 +65,7 @@ func (d *Neo4jDriver) UploadFuncContext(wc *WorkspaceConfig, f *FunctionContext,
6165 return nil
6266}
6367
64- func (d * Neo4jDriver ) QueryFiles (wc * WorkspaceConfig , ctx context.Context ) ([]string , error ) {
68+ func (d * neo4jDriver ) QueryFiles (wc * WorkspaceConfig , ctx context.Context ) ([]string , error ) {
6569 session := d .DriverWithContext .NewSession (ctx , neo4j.SessionConfig {})
6670 defer session .Close (ctx )
6771 ret , err := session .ExecuteWrite (ctx , func (tx neo4j.ManagedTransaction ) (any , error ) {
@@ -89,7 +93,7 @@ func (d *Neo4jDriver) QueryFiles(wc *WorkspaceConfig, ctx context.Context) ([]st
8993 return ret .([]string ), nil
9094}
9195
92- func (d * Neo4jDriver ) QueryFunctions (wc * WorkspaceConfig , path string , ctx context.Context ) ([]* FunctionWithPath , error ) {
96+ func (d * neo4jDriver ) QueryFunctions (wc * WorkspaceConfig , path string , ctx context.Context ) ([]* FunctionWithPath , error ) {
9397 session := d .DriverWithContext .NewSession (ctx , neo4j.SessionConfig {})
9498 defer session .Close (ctx )
9599 ret , err := session .ExecuteWrite (ctx , func (tx neo4j.ManagedTransaction ) (any , error ) {
@@ -133,7 +137,7 @@ func (d *Neo4jDriver) QueryFunctions(wc *WorkspaceConfig, path string, ctx conte
133137 return ret .([]* FunctionWithPath ), nil
134138}
135139
136- func (d * Neo4jDriver ) QueryFunctionWithSignature (wc * WorkspaceConfig , signature string , ctx context.Context ) (* FunctionWithPath , error ) {
140+ func (d * neo4jDriver ) QueryFunctionWithSignature (wc * WorkspaceConfig , signature string , ctx context.Context ) (* FunctionWithPath , error ) {
137141 session := d .DriverWithContext .NewSession (ctx , neo4j.SessionConfig {})
138142 defer session .Close (ctx )
139143 ret , err := session .ExecuteWrite (ctx , func (tx neo4j.ManagedTransaction ) (any , error ) {
@@ -184,7 +188,7 @@ func (d *Neo4jDriver) QueryFunctionWithSignature(wc *WorkspaceConfig, signature
184188 return ret .(* FunctionWithPath ), nil
185189}
186190
187- func (d * Neo4jDriver ) QueryFunctionsWithLines (wc * WorkspaceConfig , path string , lines []int , ctx context.Context ) ([]* FunctionWithPath , error ) {
191+ func (d * neo4jDriver ) QueryFunctionsWithLines (wc * WorkspaceConfig , path string , lines []int , ctx context.Context ) ([]* FunctionWithPath , error ) {
188192 functions , err := d .QueryFunctions (wc , path , ctx )
189193 if err != nil {
190194 return nil , err
@@ -198,7 +202,7 @@ func (d *Neo4jDriver) QueryFunctionsWithLines(wc *WorkspaceConfig, path string,
198202 return ret , nil
199203}
200204
201- func (d * Neo4jDriver ) QueryFunctionContextWithSignature (wc * WorkspaceConfig , signature string , ctx context.Context ) (* FunctionContext , error ) {
205+ func (d * neo4jDriver ) QueryFunctionContextWithSignature (wc * WorkspaceConfig , signature string , ctx context.Context ) (* FunctionContext , error ) {
202206 session := d .DriverWithContext .NewSession (ctx , neo4j.SessionConfig {})
203207 defer session .Close (ctx )
204208 ret , err := session .ExecuteWrite (ctx , func (tx neo4j.ManagedTransaction ) (any , error ) {
@@ -297,7 +301,7 @@ RETURN f, file, srcFunc, srcFile, targetFunc, targetFile
297301 return ret .(* FunctionContext ), nil
298302}
299303
300- func (d * Neo4jDriver ) DeleteWorkspace (wc * WorkspaceConfig , ctx context.Context ) error {
304+ func (d * neo4jDriver ) DeleteWorkspace (wc * WorkspaceConfig , ctx context.Context ) error {
301305 session := d .DriverWithContext .NewSession (ctx , neo4j.SessionConfig {})
302306 defer session .Close (ctx )
303307 _ , err := session .ExecuteWrite (ctx , func (tx neo4j.ManagedTransaction ) (any , error ) {
@@ -316,7 +320,7 @@ MATCH (repo:Repo {id: $repoId})-[:INCLUDE]->(rev:Rev {hash: $revHash})-[:INCLUDE
316320 return nil
317321}
318322
319- func (d * Neo4jDriver ) InitWorkspace (wc * WorkspaceConfig , ctx context.Context ) error {
323+ func (d * neo4jDriver ) InitWorkspace (wc * WorkspaceConfig , ctx context.Context ) error {
320324 session := d .DriverWithContext .NewSession (ctx , neo4j.SessionConfig {})
321325 defer session .Close (ctx )
322326 _ , err := session .ExecuteWrite (ctx , func (tx neo4j.ManagedTransaction ) (any , error ) {
@@ -335,7 +339,7 @@ MERGE (r)-[:INCLUDE]->(:Rev {hash: $revHash})`
335339 return nil
336340}
337341
338- func (d * Neo4jDriver ) QueryRevs (repoId string , ctx context.Context ) []string {
342+ func (d * neo4jDriver ) QueryRevs (repoId string , ctx context.Context ) []string {
339343 session := d .DriverWithContext .NewSession (ctx , neo4j.SessionConfig {})
340344 defer session .Close (ctx )
341345 ret , _ := session .ExecuteWrite (ctx , func (tx neo4j.ManagedTransaction ) (any , error ) {
@@ -361,7 +365,7 @@ func (d *Neo4jDriver) QueryRevs(repoId string, ctx context.Context) []string {
361365 return ret .([]string )
362366}
363367
364- func (d * Neo4jDriver ) UpdateFuncProperties (wc * WorkspaceConfig , signature string , k string , v any , ctx context.Context ) error {
368+ func (d * neo4jDriver ) UpdateFuncProperties (wc * WorkspaceConfig , signature string , k string , v any , ctx context.Context ) error {
365369 session := d .DriverWithContext .NewSession (ctx , neo4j.SessionConfig {})
366370 defer session .Close (ctx )
367371 _ , err := session .ExecuteWrite (ctx , func (tx neo4j.ManagedTransaction ) (any , error ) {
0 commit comments