yoheinakajima / instagraph

Converts text input or URL into knowledge graph and displays
MIT License
3.27k stars 281 forks source link

Changed to not initialize neo4j first #67

Closed isamu closed 10 months ago

isamu commented 10 months ago

Summary by CodeRabbit

coderabbitai[bot] commented 10 months ago

Walkthrough

The code has been refactored to improve the initialization and connection to the Neo4j database. The changes include the creation of a new function init_db() that handles the database initialization and connection, enhancing the code's modularity and maintainability.

Changes

File Summary
main.py Refactored to move the initialization of the Neo4j database into a separate function init_db(). This function checks for Neo4j credentials and connects to the database if the credentials are provided. The neo4j_driver variable is now assigned the return value of the init_db() function and is used to establish a connection with the Neo4j database.

🐇

In the land of code, where logic intertwines,

A rabbit hopped and tweaked some lines.

With a function new, and a driver too,

The database connection is now easy to do! 🎉

Tips ### Chat with CodeRabbit Bot (`@coderabbitai`) - Mention `@coderabbitai` in any *review comment* for bot assistance. - Note: Review comments are made on code diffs or files, not on the PR overview. ### Pause Incremental Reviews - Insert `@coderabbitai: ignore` in the PR description to halt the bot's ongoing reviews. Remove the line to resume. - Additionally, enter `@coderabbitai pause` to halt the bot's ongoing reviews as any issue or review comment. To resume reviews, enter `@coderabbitai resume` as any issue or review comment.