dbgraph 0.2.5__tar.gz → 0.2.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {dbgraph-0.2.5 → dbgraph-0.2.6}/.idea/workspace.xml +26 -26
- {dbgraph-0.2.5 → dbgraph-0.2.6}/PKG-INFO +1 -1
- {dbgraph-0.2.5 → dbgraph-0.2.6}/dbgraph/persistent/sql_graph_persistent.py +10 -3
- {dbgraph-0.2.5 → dbgraph-0.2.6}/pyproject.toml +1 -1
- {dbgraph-0.2.5 → dbgraph-0.2.6}/uv.lock +1 -1
- {dbgraph-0.2.5 → dbgraph-0.2.6}/.gitignore +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/.idea/.gitignore +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/.idea/dbgraph.iml +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/.idea/inspectionProfiles/profiles_settings.xml +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/.idea/misc.xml +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/.idea/modules.xml +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/.idea/vcs.xml +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/.python-version +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/README.md +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/data/northwind-desc.md +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/data/northwind-graph-import.db +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/data/northwind-graph-v2.json +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/data/northwind-graph-v4.json +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/data/northwind-graph.db +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/data/northwind-graph.json +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/data/northwind-graph.png +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/data/northwind-index/corpus.jsonl +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/data/northwind-index/corpus.mmindex.json +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/data/northwind-index/data.csc.index.npy +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/data/northwind-index/indices.csc.index.npy +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/data/northwind-index/indptr.csc.index.npy +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/data/northwind-index/params.index.json +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/data/northwind-index/vocab.index.json +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/data/northwind-semantic-v5.json +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/data/northwind.db +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/data/time-results.txt +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/dbgraph/__init__.py +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/dbgraph/application.py +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/dbgraph/builder/__init__.py +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/dbgraph/builder/graph_builder.py +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/dbgraph/builder/sql_graph_builder.py +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/dbgraph/descriptor/__init__.py +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/dbgraph/descriptor/graph_descriptor.py +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/dbgraph/descriptor/langchain_graph_descriptor.py +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/dbgraph/descriptor/prompt_templates.py +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/dbgraph/entity/__init__.py +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/dbgraph/entity/aspect.py +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/dbgraph/entity/asset.py +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/dbgraph/entity/asset_type.py +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/dbgraph/entity/dbgraph.py +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/dbgraph/entity/link.py +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/dbgraph/entity/link_type.py +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/dbgraph/entity/rdbgraph.py +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/dbgraph/io/__init__.py +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/dbgraph/io/graph_loader.py +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/dbgraph/io/graph_writer.py +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/dbgraph/io/json_graph_loader.py +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/dbgraph/io/json_graph_writer.py +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/dbgraph/persistent/__init__.py +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/dbgraph/persistent/graph_persistent.py +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/dbgraph/persistent/json_utils.py +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/dbgraph/persistent/models.py +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/dbgraph/render/__init__.py +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/dbgraph/render/graph_renderer.py +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/dbgraph/render/markdown_renderer.py +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/dbgraph/search/__init__.py +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/dbgraph/search/bm25_search_engine.py +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/dbgraph/search/search_engine.py +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/dbgraph/utils/__init__.py +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/dbgraph/utils/singleton.py +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/diagrams/entity.png +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/diagrams/entity.txt +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/diagrams/usecase.png +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/diagrams/usecase.txt +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/docs/index.md +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/docs/refs/aspect.md +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/docs/refs/graph.md +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/main.py +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/mkdocs.yml +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/tests/__init__.py +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/tests/test_application.py +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/tests/test_bm25s_search_engine.py +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/tests/test_dbgraph.py +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/tests/test_json_graph_loader.py +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/tests/test_json_graph_writer.py +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/tests/test_langchain_graph_descriptor.py +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/tests/test_load_graph_sql.py +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/tests/test_markdown_renderer.py +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/tests/test_rdbgraph.py +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/tests/test_sql_graph_builder.py +0 -0
- {dbgraph-0.2.5 → dbgraph-0.2.6}/tests/test_sql_graph_persistent.py +0 -0
|
@@ -71,32 +71,32 @@
|
|
|
71
71
|
<option name="hideEmptyMiddlePackages" value="true" />
|
|
72
72
|
<option name="showLibraryContents" value="true" />
|
|
73
73
|
</component>
|
|
74
|
-
<component name="PropertiesComponent"
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
74
|
+
<component name="PropertiesComponent">{
|
|
75
|
+
"keyToString": {
|
|
76
|
+
"ASKED_SHARE_PROJECT_CONFIGURATION_FILES": "true",
|
|
77
|
+
"ModuleVcsDetector.initialDetectionPerformed": "true",
|
|
78
|
+
"Python tests.Python tests for tests.test_dbgraph.TestDBGraph.executor": "Run",
|
|
79
|
+
"Python tests.Python tests for tests.test_json_graph_loader.TestJSONGraphLoader.test_get_neighbors_sub_graph.executor": "Run",
|
|
80
|
+
"Python tests.Python tests for tests.test_load_graph_sql.TestLoadGraphSQL.test_load.executor": "Run",
|
|
81
|
+
"Python tests.Python tests for tests.test_sql_graph_builder.TestSQLGraphBuilder.executor": "Run",
|
|
82
|
+
"Python tests.Python tests for tests.test_sql_graph_builder.TestSQLGraphBuilder.test__build_links.executor": "Run",
|
|
83
|
+
"Python tests.Python tests for tests.test_sql_graph_builder.TestSQLGraphBuilder.test_build_graph.executor": "Run",
|
|
84
|
+
"Python tests.Python tests for tests.test_sql_graph_persistent.TestSQLGraphPersistent.executor": "Run",
|
|
85
|
+
"Python tests.Python tests for tests.test_sql_graph_persistent.TestSQLGraphPersistent.test_delete_graph.executor": "Run",
|
|
86
|
+
"Python tests.Python tests for tests.test_sql_graph_persistent.TestSQLGraphPersistent.test_load_graph.executor": "Run",
|
|
87
|
+
"Python tests.Python tests for tests.test_sql_graph_persistent.TestSQLGraphPersistent.test_save_graph.executor": "Run",
|
|
88
|
+
"Python tests.Python tests in test_load_graph_sql.py.executor": "Run",
|
|
89
|
+
"Python tests.Python tests in tests.executor": "Run",
|
|
90
|
+
"RunOnceActivity.ShowReadmeOnStart": "true",
|
|
91
|
+
"RunOnceActivity.git.unshallow": "true",
|
|
92
|
+
"RunOnceActivity.typescript.service.memoryLimit.init": "true",
|
|
93
|
+
"codeWithMe.voiceChat.enabledByDefault": "false",
|
|
94
|
+
"git-widget-placeholder": "main",
|
|
95
|
+
"ignore.virus.scanning.warn.message": "true",
|
|
96
|
+
"nodejs_package_manager_path": "npm",
|
|
97
|
+
"settings.editor.selected.configurable": "editor.preferences.folding"
|
|
98
98
|
}
|
|
99
|
-
}
|
|
99
|
+
}</component>
|
|
100
100
|
<component name="RunManager" selected="Python tests.Python tests for tests.test_sql_graph_persistent.TestSQLGraphPersistent.test_delete_graph">
|
|
101
101
|
<configuration name="Python tests for tests.test_json_graph_loader.TestJSONGraphLoader.test_get_neighbors_sub_graph" type="tests" factoryName="Autodetect" temporary="true" nameIsGenerated="true">
|
|
102
102
|
<module name="dbgraph" />
|
|
@@ -318,7 +318,7 @@
|
|
|
318
318
|
<breakpoints>
|
|
319
319
|
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
|
|
320
320
|
<url>file://$PROJECT_DIR$/dbgraph/persistent/sql_graph_persistent.py</url>
|
|
321
|
-
<line>
|
|
321
|
+
<line>360</line>
|
|
322
322
|
<option name="timeStamp" value="5" />
|
|
323
323
|
</line-breakpoint>
|
|
324
324
|
</breakpoints>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import json
|
|
2
2
|
from dataclasses import asdict, dataclass
|
|
3
3
|
|
|
4
|
-
from sqlalchemy import create_engine, delete, select, update
|
|
4
|
+
from sqlalchemy import create_engine, delete, select, update, event
|
|
5
5
|
from sqlalchemy.orm import Session
|
|
6
6
|
|
|
7
7
|
from dbgraph.entity.aspect import (
|
|
@@ -41,8 +41,17 @@ class SQLGraphPersistent(GraphPersistent):
|
|
|
41
41
|
|
|
42
42
|
def __post_init__(self):
|
|
43
43
|
self.engine = create_engine(self.db_uri)
|
|
44
|
+
|
|
45
|
+
@event.listens_for(self.engine, "connect")
|
|
46
|
+
def set_sqlite_pragma(dbapi_connection, connection_record):
|
|
47
|
+
if dbapi_connection.__class__.__module__.startswith("sqlite3"):
|
|
48
|
+
cursor = dbapi_connection.cursor()
|
|
49
|
+
cursor.execute("PRAGMA foreign_keys=ON")
|
|
50
|
+
cursor.close()
|
|
51
|
+
|
|
44
52
|
Base.metadata.create_all(bind=self.engine)
|
|
45
53
|
|
|
54
|
+
|
|
46
55
|
def create_graph(self, graph_id: str, graph_name: str):
|
|
47
56
|
graph_model = GraphModel(graph_id=graph_id, name=graph_name, completed=False)
|
|
48
57
|
with Session(self.engine) as session:
|
|
@@ -52,8 +61,6 @@ class SQLGraphPersistent(GraphPersistent):
|
|
|
52
61
|
def delete_graph(self, graph_id: str):
|
|
53
62
|
with Session(self.engine) as session:
|
|
54
63
|
session.execute(delete(GraphModel).where(GraphModel.graph_id == graph_id))
|
|
55
|
-
session.execute(delete(AssetModel).where(AssetModel.graph_id == graph_id))
|
|
56
|
-
session.execute(delete(LinkModel).where(LinkModel.graph_id == graph_id))
|
|
57
64
|
session.commit()
|
|
58
65
|
|
|
59
66
|
def insert_assets(self, assets: list[Asset], graph_id: str):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|