Module: Delfos::Neo4j
- Extended by:
- Neo4j
- Included in:
- Neo4j
- Defined in:
- lib/delfos/neo4j.rb,
lib/delfos/neo4j/schema.rb,
lib/delfos/neo4j/informer.rb,
lib/delfos/neo4j/batch/execution.rb,
lib/delfos/neo4j/distance/update.rb,
lib/delfos/neo4j/call_stack_query.rb,
lib/delfos/neo4j/query_execution/http.rb,
lib/delfos/neo4j/query_execution/sync.rb,
lib/delfos/neo4j/query_execution/errors.rb,
lib/delfos/neo4j/distance/call_site_fetcher.rb,
lib/delfos/neo4j/query_execution/http_query.rb,
lib/delfos/neo4j/query_execution/transactional.rb
Defined Under Namespace
Modules: Batch, Distance, QueryExecution, Schema
Classes: CallStackQuery, Informer, Neo4jConfig
Instance Method Summary
collapse
Instance Method Details
#config ⇒ Object
35
36
37
38
39
40
41
42
|
# File 'lib/delfos/neo4j.rb', line 35
def config
host ||= ENV["NEO4J_HOST"] || "http://localhost"
port ||= ENV["NEO4J_PORT"] || "7476"
username ||= ENV["NEO4J_USERNAME"] || "neo4j"
password ||= ENV["NEO4J_PASSWORD"] || "password"
Neo4jConfig.new(host, port, username, password)
end
|
#ensure_schema! ⇒ Object
24
25
26
27
28
29
|
# File 'lib/delfos/neo4j.rb', line 24
def ensure_schema!
Schema.ensure_constraints!(
"Class" => "name",
"CallStack" => "number",
)
end
|
#execute(query, params = {}) ⇒ Object
16
17
18
|
# File 'lib/delfos/neo4j.rb', line 16
def execute(query, params = {})
Batch::Execution.execute!(query, params: params)
end
|
#execute_sync(query, params = {}) ⇒ Object
12
13
14
|
# File 'lib/delfos/neo4j.rb', line 12
def execute_sync(query, params = {})
QueryExecution::Sync.new(query, params).perform
end
|
#flush! ⇒ Object
20
21
22
|
# File 'lib/delfos/neo4j.rb', line 20
def flush!
Batch::Execution.flush!
end
|
#update_distance! ⇒ Object
31
32
33
|
# File 'lib/delfos/neo4j.rb', line 31
def update_distance!
Distance::Update.new.perform
end
|