Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Q
query-service
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GraphPolaris
Microservices
query-service
Commits
f659a522
Commit
f659a522
authored
4 months ago
by
Dorus
Browse files
Options
Downloads
Patches
Plain Diff
fix: fixed db connection
parent
f4faf25b
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/manual_mode/README.md
+1
-1
1 addition, 1 deletion
src/manual_mode/README.md
src/manual_mode/manualMode.ts
+10
-6
10 additions, 6 deletions
src/manual_mode/manualMode.ts
with
11 additions
and
7 deletions
src/manual_mode/README.md
+
1
−
1
View file @
f659a522
...
...
@@ -3,7 +3,7 @@
To run a neo4j db container locally
```
docker run --name neo4j -p 7687:7687 -p 7474:7474 -d --env NEO4J_AUTH=neo4j/password neo4j:latest
docker run
--rm
--name neo4j -p 7687:7687 -p 7474:7474 -d --env NEO4J_AUTH=neo4j/password neo4j:latest
```
To access the neo4j container
...
...
This diff is collapsed.
Click to expand it.
src/manual_mode/manualMode.ts
+
10
−
6
View file @
f659a522
...
...
@@ -29,24 +29,27 @@ if (require.main === module) {
// 3rd password
// 4th output file name
const
uri
:
string
=
process
.
argv
[
1
]
||
"
bolt://localhost:7687
"
;
// default neo4j port
const
username
:
string
=
process
.
argv
[
2
]
||
"
username
"
;
const
password
:
string
=
process
.
argv
[
3
]
||
"
pass
o
wrd
"
;
const
uri
:
string
=
process
.
argv
[
2
]
||
"
bolt://localhost:7687
"
;
// default neo4j port
const
username
:
string
=
process
.
argv
[
3
]
||
"
neo4j
"
;
const
password
:
string
=
process
.
argv
[
4
]
||
"
passw
o
rd
"
;
const
outputFile
:
string
=
process
.
argv
[
4
]
||
'
output.json
'
;
// Default output file if none provided
const
outputFile
:
string
=
process
.
argv
[
5
]
||
'
output.json
'
;
// Default output file if none provided
// connect to neo4j
try
{
console
.
log
(
`Connecting to:
${
uri
}
`
);
const
driver
=
neo4j
.
driver
(
uri
,
neo4j
.
auth
.
basic
(
username
,
password
));
const
session
=
driver
.
session
();
}
catch
(
error
)
{
console
.
log
(
"
Error connecting to neo4j
"
)
console
.
log
(
`
Error connecting to neo4j
:
${
error
}
`
)
}
console
.
log
(
`Connected succesfully`
);
// reccursive function that executes queries
const
promptQuery
=
()
=>
{
rl
.
question
(
'
query:
'
,
async
(
cypherQuery
)
=>
{
...
...
@@ -62,5 +65,6 @@ if (require.main === module) {
});
};
promptQuery
();
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment