dbgraph 0.2.1__tar.gz → 0.2.3__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.
Files changed (96) hide show
  1. {dbgraph-0.2.1 → dbgraph-0.2.3}/.idea/workspace.xml +67 -23
  2. {dbgraph-0.2.1 → dbgraph-0.2.3}/PKG-INFO +1 -1
  3. dbgraph-0.2.3/data/northwind-index/corpus.mmindex.json +1 -0
  4. dbgraph-0.2.3/data/northwind-index/data.csc.index.npy +0 -0
  5. dbgraph-0.2.3/data/northwind-index/indices.csc.index.npy +0 -0
  6. dbgraph-0.2.3/data/northwind-index/indptr.csc.index.npy +0 -0
  7. dbgraph-0.2.3/data/northwind-index/vocab.index.json +1 -0
  8. {dbgraph-0.2.1 → dbgraph-0.2.3}/dbgraph/descriptor/langchain_graph_descriptor.py +2 -2
  9. {dbgraph-0.2.1 → dbgraph-0.2.3}/dbgraph/entity/dbgraph.py +10 -2
  10. {dbgraph-0.2.1 → dbgraph-0.2.3}/dbgraph/render/graph_renderer.py +2 -2
  11. {dbgraph-0.2.1 → dbgraph-0.2.3}/dbgraph/render/markdown_renderer.py +4 -9
  12. {dbgraph-0.2.1 → dbgraph-0.2.3}/pyproject.toml +1 -1
  13. {dbgraph-0.2.1 → dbgraph-0.2.3}/tests/test_json_graph_loader.py +1 -1
  14. {dbgraph-0.2.1 → dbgraph-0.2.3}/tests/test_markdown_renderer.py +2 -2
  15. {dbgraph-0.2.1 → dbgraph-0.2.3}/uv.lock +1 -1
  16. dbgraph-0.2.1/data/northwind-index/corpus.mmindex.json +0 -1
  17. dbgraph-0.2.1/data/northwind-index/data.csc.index.npy +0 -0
  18. dbgraph-0.2.1/data/northwind-index/indices.csc.index.npy +0 -0
  19. dbgraph-0.2.1/data/northwind-index/indptr.csc.index.npy +0 -0
  20. dbgraph-0.2.1/data/northwind-index/vocab.index.json +0 -1
  21. dbgraph-0.2.1/dbgraph/event/event.py +0 -20
  22. dbgraph-0.2.1/dbgraph/event/event_bus.py +0 -61
  23. dbgraph-0.2.1/dbgraph/event/event_handler.py +0 -11
  24. dbgraph-0.2.1/dbgraph/render/text_renderer.py +0 -11
  25. dbgraph-0.2.1/tests/__init__.py +0 -0
  26. {dbgraph-0.2.1 → dbgraph-0.2.3}/.gitignore +0 -0
  27. {dbgraph-0.2.1 → dbgraph-0.2.3}/.idea/.gitignore +0 -0
  28. {dbgraph-0.2.1 → dbgraph-0.2.3}/.idea/dbgraph.iml +0 -0
  29. {dbgraph-0.2.1 → dbgraph-0.2.3}/.idea/inspectionProfiles/profiles_settings.xml +0 -0
  30. {dbgraph-0.2.1 → dbgraph-0.2.3}/.idea/misc.xml +0 -0
  31. {dbgraph-0.2.1 → dbgraph-0.2.3}/.idea/modules.xml +0 -0
  32. {dbgraph-0.2.1 → dbgraph-0.2.3}/.idea/vcs.xml +0 -0
  33. {dbgraph-0.2.1 → dbgraph-0.2.3}/.python-version +0 -0
  34. {dbgraph-0.2.1 → dbgraph-0.2.3}/README.md +0 -0
  35. {dbgraph-0.2.1 → dbgraph-0.2.3}/data/northwind-desc.md +0 -0
  36. {dbgraph-0.2.1 → dbgraph-0.2.3}/data/northwind-graph-import.db +0 -0
  37. {dbgraph-0.2.1 → dbgraph-0.2.3}/data/northwind-graph-v2.json +0 -0
  38. {dbgraph-0.2.1 → dbgraph-0.2.3}/data/northwind-graph-v4.json +0 -0
  39. {dbgraph-0.2.1 → dbgraph-0.2.3}/data/northwind-graph.db +0 -0
  40. {dbgraph-0.2.1 → dbgraph-0.2.3}/data/northwind-graph.json +0 -0
  41. {dbgraph-0.2.1 → dbgraph-0.2.3}/data/northwind-graph.png +0 -0
  42. {dbgraph-0.2.1 → dbgraph-0.2.3}/data/northwind-index/corpus.jsonl +0 -0
  43. {dbgraph-0.2.1 → dbgraph-0.2.3}/data/northwind-index/params.index.json +0 -0
  44. {dbgraph-0.2.1 → dbgraph-0.2.3}/data/northwind-semantic-v5.json +0 -0
  45. {dbgraph-0.2.1 → dbgraph-0.2.3}/data/northwind.db +0 -0
  46. {dbgraph-0.2.1 → dbgraph-0.2.3}/data/time-results.txt +0 -0
  47. {dbgraph-0.2.1 → dbgraph-0.2.3}/dbgraph/__init__.py +0 -0
  48. {dbgraph-0.2.1 → dbgraph-0.2.3}/dbgraph/application.py +0 -0
  49. {dbgraph-0.2.1 → dbgraph-0.2.3}/dbgraph/builder/__init__.py +0 -0
  50. {dbgraph-0.2.1 → dbgraph-0.2.3}/dbgraph/builder/graph_builder.py +0 -0
  51. {dbgraph-0.2.1 → dbgraph-0.2.3}/dbgraph/builder/sql_graph_builder.py +0 -0
  52. {dbgraph-0.2.1 → dbgraph-0.2.3}/dbgraph/descriptor/__init__.py +0 -0
  53. {dbgraph-0.2.1 → dbgraph-0.2.3}/dbgraph/descriptor/graph_descriptor.py +0 -0
  54. {dbgraph-0.2.1 → dbgraph-0.2.3}/dbgraph/descriptor/prompt_templates.py +0 -0
  55. {dbgraph-0.2.1 → dbgraph-0.2.3}/dbgraph/entity/__init__.py +0 -0
  56. {dbgraph-0.2.1 → dbgraph-0.2.3}/dbgraph/entity/aspect.py +0 -0
  57. {dbgraph-0.2.1 → dbgraph-0.2.3}/dbgraph/entity/asset.py +0 -0
  58. {dbgraph-0.2.1 → dbgraph-0.2.3}/dbgraph/entity/asset_type.py +0 -0
  59. {dbgraph-0.2.1 → dbgraph-0.2.3}/dbgraph/entity/link.py +0 -0
  60. {dbgraph-0.2.1 → dbgraph-0.2.3}/dbgraph/entity/link_type.py +0 -0
  61. {dbgraph-0.2.1 → dbgraph-0.2.3}/dbgraph/entity/rdbgraph.py +0 -0
  62. {dbgraph-0.2.1/dbgraph/event → dbgraph-0.2.3/dbgraph/io}/__init__.py +0 -0
  63. {dbgraph-0.2.1 → dbgraph-0.2.3}/dbgraph/io/graph_loader.py +0 -0
  64. {dbgraph-0.2.1 → dbgraph-0.2.3}/dbgraph/io/graph_writer.py +0 -0
  65. {dbgraph-0.2.1 → dbgraph-0.2.3}/dbgraph/io/json_graph_loader.py +0 -0
  66. {dbgraph-0.2.1 → dbgraph-0.2.3}/dbgraph/io/json_graph_writer.py +0 -0
  67. {dbgraph-0.2.1/dbgraph/io → dbgraph-0.2.3/dbgraph/persistent}/__init__.py +0 -0
  68. {dbgraph-0.2.1 → dbgraph-0.2.3}/dbgraph/persistent/graph_persistent.py +0 -0
  69. {dbgraph-0.2.1 → dbgraph-0.2.3}/dbgraph/persistent/json_utils.py +0 -0
  70. {dbgraph-0.2.1 → dbgraph-0.2.3}/dbgraph/persistent/models.py +0 -0
  71. {dbgraph-0.2.1 → dbgraph-0.2.3}/dbgraph/persistent/sql_graph_persistent.py +0 -0
  72. {dbgraph-0.2.1/dbgraph/persistent → dbgraph-0.2.3/dbgraph/render}/__init__.py +0 -0
  73. {dbgraph-0.2.1/dbgraph/render → dbgraph-0.2.3/dbgraph/search}/__init__.py +0 -0
  74. {dbgraph-0.2.1 → dbgraph-0.2.3}/dbgraph/search/bm25_search_engine.py +0 -0
  75. {dbgraph-0.2.1 → dbgraph-0.2.3}/dbgraph/search/search_engine.py +0 -0
  76. {dbgraph-0.2.1/dbgraph/search → dbgraph-0.2.3/dbgraph/utils}/__init__.py +0 -0
  77. {dbgraph-0.2.1 → dbgraph-0.2.3}/dbgraph/utils/singleton.py +0 -0
  78. {dbgraph-0.2.1 → dbgraph-0.2.3}/diagrams/entity.png +0 -0
  79. {dbgraph-0.2.1 → dbgraph-0.2.3}/diagrams/entity.txt +0 -0
  80. {dbgraph-0.2.1 → dbgraph-0.2.3}/diagrams/usecase.png +0 -0
  81. {dbgraph-0.2.1 → dbgraph-0.2.3}/diagrams/usecase.txt +0 -0
  82. {dbgraph-0.2.1 → dbgraph-0.2.3}/docs/index.md +0 -0
  83. {dbgraph-0.2.1 → dbgraph-0.2.3}/docs/refs/aspect.md +0 -0
  84. {dbgraph-0.2.1 → dbgraph-0.2.3}/docs/refs/graph.md +0 -0
  85. {dbgraph-0.2.1 → dbgraph-0.2.3}/main.py +0 -0
  86. {dbgraph-0.2.1 → dbgraph-0.2.3}/mkdocs.yml +0 -0
  87. {dbgraph-0.2.1/dbgraph/utils → dbgraph-0.2.3/tests}/__init__.py +0 -0
  88. {dbgraph-0.2.1 → dbgraph-0.2.3}/tests/test_application.py +0 -0
  89. {dbgraph-0.2.1 → dbgraph-0.2.3}/tests/test_bm25s_search_engine.py +0 -0
  90. {dbgraph-0.2.1 → dbgraph-0.2.3}/tests/test_dbgraph.py +0 -0
  91. {dbgraph-0.2.1 → dbgraph-0.2.3}/tests/test_json_graph_writer.py +0 -0
  92. {dbgraph-0.2.1 → dbgraph-0.2.3}/tests/test_langchain_graph_descriptor.py +0 -0
  93. {dbgraph-0.2.1 → dbgraph-0.2.3}/tests/test_load_graph_sql.py +0 -0
  94. {dbgraph-0.2.1 → dbgraph-0.2.3}/tests/test_rdbgraph.py +0 -0
  95. {dbgraph-0.2.1 → dbgraph-0.2.3}/tests/test_sql_graph_builder.py +0 -0
  96. {dbgraph-0.2.1 → dbgraph-0.2.3}/tests/test_sql_graph_persistent.py +0 -0
@@ -4,15 +4,13 @@
4
4
  <option name="autoReloadType" value="SELECTIVE" />
5
5
  </component>
6
6
  <component name="ChangeListManager">
7
- <list default="true" id="263a96da-9a82-40fd-89b2-ba71dd2c194d" name="Changes" comment="fix bugs in builder">
8
- <change beforePath="$PROJECT_DIR$/dbgraph/__init__.py" beforeDir="false" afterPath="$PROJECT_DIR$/dbgraph/__init__.py" afterDir="false" />
9
- <change beforePath="$PROJECT_DIR$/dbgraph/builder/sql_graph_builder.py" beforeDir="false" afterPath="$PROJECT_DIR$/dbgraph/builder/sql_graph_builder.py" afterDir="false" />
10
- <change beforePath="$PROJECT_DIR$/dbgraph/entity/aspect.py" beforeDir="false" afterPath="$PROJECT_DIR$/dbgraph/entity/aspect.py" afterDir="false" />
11
- <change beforePath="$PROJECT_DIR$/dbgraph/persistent/json_utils.py" beforeDir="false" afterPath="$PROJECT_DIR$/dbgraph/persistent/json_utils.py" afterDir="false" />
12
- <change beforePath="$PROJECT_DIR$/dbgraph/persistent/sql_graph_persistent.py" beforeDir="false" afterPath="$PROJECT_DIR$/dbgraph/persistent/sql_graph_persistent.py" afterDir="false" />
7
+ <list default="true" id="263a96da-9a82-40fd-89b2-ba71dd2c194d" name="Changes" comment="update renderer">
8
+ <change beforePath="$PROJECT_DIR$/data/northwind-index/corpus.mmindex.json" beforeDir="false" afterPath="$PROJECT_DIR$/data/northwind-index/corpus.mmindex.json" afterDir="false" />
9
+ <change beforePath="$PROJECT_DIR$/data/northwind-index/data.csc.index.npy" beforeDir="false" afterPath="$PROJECT_DIR$/data/northwind-index/data.csc.index.npy" afterDir="false" />
10
+ <change beforePath="$PROJECT_DIR$/data/northwind-index/indices.csc.index.npy" beforeDir="false" afterPath="$PROJECT_DIR$/data/northwind-index/indices.csc.index.npy" afterDir="false" />
11
+ <change beforePath="$PROJECT_DIR$/data/northwind-index/indptr.csc.index.npy" beforeDir="false" afterPath="$PROJECT_DIR$/data/northwind-index/indptr.csc.index.npy" afterDir="false" />
12
+ <change beforePath="$PROJECT_DIR$/data/northwind-index/vocab.index.json" beforeDir="false" afterPath="$PROJECT_DIR$/data/northwind-index/vocab.index.json" afterDir="false" />
13
13
  <change beforePath="$PROJECT_DIR$/pyproject.toml" beforeDir="false" afterPath="$PROJECT_DIR$/pyproject.toml" afterDir="false" />
14
- <change beforePath="$PROJECT_DIR$/tests/test_load_graph_sql.py" beforeDir="false" afterPath="$PROJECT_DIR$/tests/test_load_graph_sql.py" afterDir="false" />
15
- <change beforePath="$PROJECT_DIR$/tests/test_sql_graph_persistent.py" beforeDir="false" afterPath="$PROJECT_DIR$/tests/test_sql_graph_persistent.py" afterDir="false" />
16
14
  </list>
17
15
  <option name="SHOW_DIALOG" value="false" />
18
16
  <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -74,7 +72,10 @@
74
72
  "ASKED_SHARE_PROJECT_CONFIGURATION_FILES": "true",
75
73
  "ModuleVcsDetector.initialDetectionPerformed": "true",
76
74
  "Python tests.Python tests for tests.test_dbgraph.TestDBGraph.executor": "Run",
75
+ "Python tests.Python tests for tests.test_json_graph_loader.TestJSONGraphLoader.test_get_neighbors_sub_graph.executor": "Run",
77
76
  "Python tests.Python tests for tests.test_load_graph_sql.TestLoadGraphSQL.test_load.executor": "Run",
77
+ "Python tests.Python tests for tests.test_sql_graph_builder.TestSQLGraphBuilder.executor": "Run",
78
+ "Python tests.Python tests for tests.test_sql_graph_builder.TestSQLGraphBuilder.test__build_links.executor": "Run",
78
79
  "Python tests.Python tests for tests.test_sql_graph_builder.TestSQLGraphBuilder.test_build_graph.executor": "Run",
79
80
  "Python tests.Python tests for tests.test_sql_graph_persistent.TestSQLGraphPersistent.executor": "Run",
80
81
  "Python tests.Python tests for tests.test_sql_graph_persistent.TestSQLGraphPersistent.test_load_graph.executor": "Run",
@@ -91,8 +92,8 @@
91
92
  "settings.editor.selected.configurable": "editor.preferences.folding"
92
93
  }
93
94
  }]]></component>
94
- <component name="RunManager" selected="Python tests.Python tests in tests">
95
- <configuration name="Python tests for tests.test_load_graph_sql.TestLoadGraphSQL.test_load" type="tests" factoryName="Autodetect" temporary="true" nameIsGenerated="true">
95
+ <component name="RunManager" selected="Python tests.Python tests for tests.test_json_graph_loader.TestJSONGraphLoader.test_get_neighbors_sub_graph">
96
+ <configuration name="Python tests for tests.test_json_graph_loader.TestJSONGraphLoader.test_get_neighbors_sub_graph" type="tests" factoryName="Autodetect" temporary="true" nameIsGenerated="true">
96
97
  <module name="dbgraph" />
97
98
  <option name="ENV_FILES" value="" />
98
99
  <option name="INTERPRETER_OPTIONS" value="" />
@@ -105,11 +106,11 @@
105
106
  <option name="DEBUG_JUST_MY_CODE" value="false" />
106
107
  <option name="RUN_TOOL" value="" />
107
108
  <option name="_new_additionalArguments" value="&quot;&quot;" />
108
- <option name="_new_target" value="&quot;tests.test_load_graph_sql.TestLoadGraphSQL.test_load&quot;" />
109
+ <option name="_new_target" value="&quot;tests.test_json_graph_loader.TestJSONGraphLoader.test_get_neighbors_sub_graph&quot;" />
109
110
  <option name="_new_targetType" value="&quot;PYTHON&quot;" />
110
111
  <method v="2" />
111
112
  </configuration>
112
- <configuration name="Python tests for tests.test_sql_graph_builder.TestSQLGraphBuilder.test_build_graph" type="tests" factoryName="Autodetect" temporary="true" nameIsGenerated="true">
113
+ <configuration name="Python tests for tests.test_sql_graph_builder.TestSQLGraphBuilder" type="tests" factoryName="Autodetect" temporary="true" nameIsGenerated="true">
113
114
  <module name="dbgraph" />
114
115
  <option name="ENV_FILES" value="" />
115
116
  <option name="INTERPRETER_OPTIONS" value="" />
@@ -122,11 +123,11 @@
122
123
  <option name="DEBUG_JUST_MY_CODE" value="false" />
123
124
  <option name="RUN_TOOL" value="" />
124
125
  <option name="_new_additionalArguments" value="&quot;&quot;" />
125
- <option name="_new_target" value="&quot;tests.test_sql_graph_builder.TestSQLGraphBuilder.test_build_graph&quot;" />
126
+ <option name="_new_target" value="&quot;tests.test_sql_graph_builder.TestSQLGraphBuilder&quot;" />
126
127
  <option name="_new_targetType" value="&quot;PYTHON&quot;" />
127
128
  <method v="2" />
128
129
  </configuration>
129
- <configuration name="Python tests for tests.test_sql_graph_persistent.TestSQLGraphPersistent" type="tests" factoryName="Autodetect" temporary="true" nameIsGenerated="true">
130
+ <configuration name="Python tests for tests.test_sql_graph_builder.TestSQLGraphBuilder.test__build_links" type="tests" factoryName="Autodetect" temporary="true" nameIsGenerated="true">
130
131
  <module name="dbgraph" />
131
132
  <option name="ENV_FILES" value="" />
132
133
  <option name="INTERPRETER_OPTIONS" value="" />
@@ -139,11 +140,11 @@
139
140
  <option name="DEBUG_JUST_MY_CODE" value="false" />
140
141
  <option name="RUN_TOOL" value="" />
141
142
  <option name="_new_additionalArguments" value="&quot;&quot;" />
142
- <option name="_new_target" value="&quot;tests.test_sql_graph_persistent.TestSQLGraphPersistent&quot;" />
143
+ <option name="_new_target" value="&quot;tests.test_sql_graph_builder.TestSQLGraphBuilder.test__build_links&quot;" />
143
144
  <option name="_new_targetType" value="&quot;PYTHON&quot;" />
144
145
  <method v="2" />
145
146
  </configuration>
146
- <configuration name="Python tests in test_load_graph_sql.py" type="tests" factoryName="Autodetect" temporary="true" nameIsGenerated="true">
147
+ <configuration name="Python tests for tests.test_sql_graph_builder.TestSQLGraphBuilder.test_build_graph" type="tests" factoryName="Autodetect" temporary="true" nameIsGenerated="true">
147
148
  <module name="dbgraph" />
148
149
  <option name="ENV_FILES" value="" />
149
150
  <option name="INTERPRETER_OPTIONS" value="" />
@@ -156,8 +157,8 @@
156
157
  <option name="DEBUG_JUST_MY_CODE" value="false" />
157
158
  <option name="RUN_TOOL" value="" />
158
159
  <option name="_new_additionalArguments" value="&quot;&quot;" />
159
- <option name="_new_target" value="&quot;$PROJECT_DIR$/tests/test_load_graph_sql.py&quot;" />
160
- <option name="_new_targetType" value="&quot;PATH&quot;" />
160
+ <option name="_new_target" value="&quot;tests.test_sql_graph_builder.TestSQLGraphBuilder.test_build_graph&quot;" />
161
+ <option name="_new_targetType" value="&quot;PYTHON&quot;" />
161
162
  <method v="2" />
162
163
  </configuration>
163
164
  <configuration name="Python tests in tests" type="tests" factoryName="Autodetect" temporary="true" nameIsGenerated="true">
@@ -179,10 +180,10 @@
179
180
  </configuration>
180
181
  <recent_temporary>
181
182
  <list>
183
+ <item itemvalue="Python tests.Python tests for tests.test_json_graph_loader.TestJSONGraphLoader.test_get_neighbors_sub_graph" />
182
184
  <item itemvalue="Python tests.Python tests in tests" />
183
- <item itemvalue="Python tests.Python tests for tests.test_load_graph_sql.TestLoadGraphSQL.test_load" />
184
- <item itemvalue="Python tests.Python tests in test_load_graph_sql.py" />
185
- <item itemvalue="Python tests.Python tests for tests.test_sql_graph_persistent.TestSQLGraphPersistent" />
185
+ <item itemvalue="Python tests.Python tests for tests.test_sql_graph_builder.TestSQLGraphBuilder" />
186
+ <item itemvalue="Python tests.Python tests for tests.test_sql_graph_builder.TestSQLGraphBuilder.test__build_links" />
186
187
  <item itemvalue="Python tests.Python tests for tests.test_sql_graph_builder.TestSQLGraphBuilder.test_build_graph" />
187
188
  </list>
188
189
  </recent_temporary>
@@ -226,7 +227,47 @@
226
227
  <option name="project" value="LOCAL" />
227
228
  <updated>1788407330419</updated>
228
229
  </task>
229
- <option name="localTasksCounter" value="4" />
230
+ <task id="LOCAL-00004" summary="format">
231
+ <option name="closed" value="true" />
232
+ <created>1788407896437</created>
233
+ <option name="number" value="00004" />
234
+ <option name="presentableId" value="LOCAL-00004" />
235
+ <option name="project" value="LOCAL" />
236
+ <updated>1788407896437</updated>
237
+ </task>
238
+ <task id="LOCAL-00005" summary="remove events">
239
+ <option name="closed" value="true" />
240
+ <created>1788576856001</created>
241
+ <option name="number" value="00005" />
242
+ <option name="presentableId" value="LOCAL-00005" />
243
+ <option name="project" value="LOCAL" />
244
+ <updated>1788576856001</updated>
245
+ </task>
246
+ <task id="LOCAL-00006" summary="update renderer">
247
+ <option name="closed" value="true" />
248
+ <created>1788922273132</created>
249
+ <option name="number" value="00006" />
250
+ <option name="presentableId" value="LOCAL-00006" />
251
+ <option name="project" value="LOCAL" />
252
+ <updated>1788922273132</updated>
253
+ </task>
254
+ <task id="LOCAL-00007" summary="update renderer">
255
+ <option name="closed" value="true" />
256
+ <created>1788922706985</created>
257
+ <option name="number" value="00007" />
258
+ <option name="presentableId" value="LOCAL-00007" />
259
+ <option name="project" value="LOCAL" />
260
+ <updated>1788922706985</updated>
261
+ </task>
262
+ <task id="LOCAL-00008" summary="update renderer">
263
+ <option name="closed" value="true" />
264
+ <created>1788928883769</created>
265
+ <option name="number" value="00008" />
266
+ <option name="presentableId" value="LOCAL-00008" />
267
+ <option name="project" value="LOCAL" />
268
+ <updated>1788928883769</updated>
269
+ </task>
270
+ <option name="localTasksCounter" value="9" />
230
271
  <servers />
231
272
  </component>
232
273
  <component name="TypeScriptGeneratedFilesManager">
@@ -246,7 +287,10 @@
246
287
  <component name="VcsManagerConfiguration">
247
288
  <MESSAGE value="update packaging" />
248
289
  <MESSAGE value="fix bugs in builder" />
249
- <option name="LAST_COMMIT_MESSAGE" value="fix bugs in builder" />
290
+ <MESSAGE value="format" />
291
+ <MESSAGE value="remove events" />
292
+ <MESSAGE value="update renderer" />
293
+ <option name="LAST_COMMIT_MESSAGE" value="update renderer" />
250
294
  </component>
251
295
  <component name="XDebuggerManager">
252
296
  <breakpoint-manager>
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: dbgraph
3
- Version: 0.2.1
3
+ Version: 0.2.3
4
4
  Summary: dbgraph is a database profiling tool which model the database as a graph
5
5
  Requires-Python: >=3.11
6
6
  Requires-Dist: bm25s>=0.3.9
@@ -0,0 +1 @@
1
+ [0,137,356,500,662,862,1059,1262,1444,1689,1866,2017,2200,2342,2527,2655,2805,2959,3168,3372,3527,3689,3789,3894,4003,4127,4226,4318,4441,4544,4639,4738,4829,4936,5034,5136,5264,5398,5489,5598,5688,5781,5888,6009,6108,6207,6317,6439,6564,6681,6791,6920,7042,7173,7292,7424,7545,7685,7785,7905,8035,8136,8258,8383,8518,8645,8773,8889,8990,9106,9211,9315,9433,9523,9667,9812,9972,10071,10199,10358,10508,10670,10860,11021,11119,11220,11323,11430,11531,11658,11789,11901,11997,12115,12223,12331,12441,12561,12678,12784,12919]
@@ -0,0 +1 @@
1
+ {"type":0,"discontinu":1,"store":2,"base":3,"system":4,"postal":5,"which":6,"ms":7,"first":8,"report":9,"object":10,"whom":11,"map":12,"file":13,"process":14,"metadata":15,"detail":16,"regard":17,"visual":18,"photo":19,"sold":20,"profil":21,"group":22,"tabl":23,"status":24,"given":25,"parent":26,"inform":27,"each":28,"scope":29,"discount":30,"destin":31,"content":32,"has":33,"dispatch":34,"relationship":35,"primari":36,"entiti":37,"purchas":38,"courtesi":39,"key":40,"customerdemograph":41,"yet":42,"telephon":43,"geograph":44,"imag":45,"segment":46,"note":47,"southern":48,"minimum":49,"provinc":50,"it":51,"ani":52,"between":53,"job":54,"referenc":55,"facsimil":56,"data":57,"full":58,"have":59,"junction":60,"quantiti":61,"threshold":62,"confect":63,"rang":64,"25":65,"titl":66,"profession":67,"phone":68,"zip":69,"correspond":70,"date":71,"foreign":72,"organiz":73,"countri":74,"logist":75,"citi":76,"address":77,"line":78,"record":79,"resid":80,"singl":81,"shipper":82,"salut":83,"employeeid":84,"weight":85,"busi":86,"when":87,"price":88,"descript":89,"serv":90,"definit":91,"handl":92,"binari":93,"url":94,"link":95,"assign":96,"identifi":97,"appli":98,"path":99,"time":100,"all":101,"area":102,"fax":103,"posit":104,"physic":105,"respons":106,"establish":107,"facilit":108,"product":109,"actual":110,"extens":111,"master":112,"street":113,"act":114,"integ":115,"provid":116,"associ":117,"mr":118,"where":119,"id":120,"per":121,"label":122,"last":123,"explain":124,"order":125,"been":126,"place":127,"pack":128,"supplier":129,"northern":130,"locat":131,"should":132,"lookup":133,"item":134,"current":135,"hire":136,"larg":137,"photograph":138,"charg":139,"role":140,"sale":141,"manag":142,"categor":143,"deliv":144,"often":145,"avail":146,"characterist":147,"dr":148,"entri":149,"number":150,"whether":151,"mani":152,"transact":153,"custom":154,"cost":155,"held":156,"contact":157,"refer":158,"personnel":159,"compani":160,"demograph":161,"packag":162,"size":163,"employe":164,"use":165,"name":166,"textual":167,"text":168,"case":169,"legal":170,"freight":171,"describ":172,"from":173,"code":174,"local":175,"level":176,"databas":177,"includ":178,"uniqu":179,"within":180,"identif":181,"biograph":182,"homepag":183,"specif":184,"state":185,"market":186,"beverag":187,"arriv":188,"internal":189,"new":190,"unit":191,"person":192,"percentag":193,"who":194,"categori":195,"be":196,"territori":197,"surnam":198,"expect":199,"flag":200,"addit":201,"repres":202,"logo":203,"carrier":204,"region":205,"hierarchi":206,"activ":207,"contain":208,"classifi":209,"home":210,"ship":211,"deliveri":212,"eastern":213,"websit":214,"stock":215,"indic":216,"birth":217,"about":218,"inventori":219,"western":220,"":221}
@@ -49,9 +49,9 @@ class LangchainGraphDescriptor(GraphDescriptor):
49
49
  def _get_semantic_aspect_column(
50
50
  self, asset: Asset, context: RDatabaseGraph
51
51
  ) -> SemanticAspect:
52
- self.markdown_renderer.render(context)
52
+ context_str = self.markdown_renderer.render(context)
53
53
  system_prompt = (
54
- self.column_system_prompt + "\n" + self.markdown_renderer.get_content()
54
+ self.column_system_prompt + "\n" + context_str
55
55
  )
56
56
  question = self.column_question_prompt + " " + asset.name
57
57
  description = self._generate(system_prompt, question)
@@ -7,6 +7,10 @@ import rustworkx as rx
7
7
 
8
8
  from dbgraph.entity.asset import Asset
9
9
  from dbgraph.entity.link import Link
10
+ from typing import TYPE_CHECKING
11
+
12
+ if TYPE_CHECKING:
13
+ from dbgraph.entity.rdbgraph import RDatabaseGraph
10
14
 
11
15
 
12
16
  @dataclass
@@ -88,7 +92,7 @@ class DatabaseGraph:
88
92
 
89
93
  def select_shortest_paths(self, src_id: str, dst_id: str) -> list[DatabaseGraph]:
90
94
  """
91
- Find shortest paths between two Assets.
95
+ Find the shortest paths between two Assets.
92
96
 
93
97
  Args:
94
98
  src_id: ID of the source asset
@@ -135,7 +139,7 @@ class DatabaseGraph:
135
139
  return [self._graph.get_node_data(i) for i in asset_indices]
136
140
 
137
141
  def find_shortest_paths(self, src_id: str, dst_id: str) -> list[list[Asset]]:
138
- """Find shortest paths between two Assets
142
+ """Find the shortest paths between two Assets
139
143
 
140
144
  Args:
141
145
  src_id: ID of the source asset
@@ -150,3 +154,7 @@ class DatabaseGraph:
150
154
  paths = rx.all_shortest_paths(self._graph, src_idx, dst_idx)
151
155
 
152
156
  return [[self._graph.get_node_data(i) for i in path] for path in paths]
157
+
158
+ def to_relational(self) -> "RDatabaseGraph":
159
+ """Return the RDatabaseGraph"""
160
+ return RDatabaseGraph.from_graph(self)
@@ -7,5 +7,5 @@ class GraphRenderer(ABC):
7
7
  """Interface for rendering the graph"""
8
8
 
9
9
  @abstractmethod
10
- def render(self, graph: DatabaseGraph):
11
- """Render the graph, store data inside the class"""
10
+ def render(self, graph: DatabaseGraph) -> str:
11
+ """Render the graph to text-based format"""
@@ -13,11 +13,11 @@ from dbgraph.entity.asset import Asset
13
13
  from dbgraph.entity.dbgraph import DatabaseGraph
14
14
  from dbgraph.entity.link import Link
15
15
  from dbgraph.entity.rdbgraph import RDatabaseGraph
16
- from dbgraph.render.text_renderer import TextRenderer
16
+ from dbgraph.render.graph_renderer import GraphRenderer
17
17
 
18
18
 
19
19
  @dataclass
20
- class MarkdownRenderer(TextRenderer):
20
+ class MarkdownRenderer(GraphRenderer):
21
21
  """Render the graph to Markdown format"""
22
22
 
23
23
  categorical_value_max_char: int = 50
@@ -89,7 +89,7 @@ class MarkdownRenderer(TextRenderer):
89
89
 
90
90
  return answer
91
91
 
92
- def render(self, graph: DatabaseGraph):
92
+ def render(self, graph: DatabaseGraph) -> str:
93
93
  graph = RDatabaseGraph.from_graph(graph)
94
94
  tables = graph.get_tables()
95
95
  answer = ""
@@ -103,9 +103,4 @@ class MarkdownRenderer(TextRenderer):
103
103
  answer += "\n# List of Foreign Key Constraints"
104
104
  for fk in foreign_keys:
105
105
  answer += f"\n{self._dump_fk(fk, graph)}"
106
- self.content = answer
107
-
108
- def get_content(self) -> str:
109
- if not self.content:
110
- raise RuntimeError("Content is empty. Please run `render()` first!")
111
- return self.content
106
+ return answer
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "dbgraph"
7
- version = "0.2.1"
7
+ version = "0.2.3"
8
8
  description = "dbgraph is a database profiling tool which model the database as a graph"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
@@ -19,7 +19,7 @@ class TestJSONGraphLoader(unittest.TestCase):
19
19
  "601fca0f-9c27-4833-86d0-48f8383437a0",
20
20
  "29fb86b7-13f6-4a23-ab24-26d68881624f",
21
21
  )
22
- self.assertIsInstance(subgraphs, DatabaseGraph)
22
+ self.assertIsInstance(subgraphs, list)
23
23
 
24
24
  def test_get_neighbors_sub_graph(self):
25
25
  graph = self.graph_loader.load()
@@ -12,8 +12,8 @@ class TestMarkdownRenderer(unittest.TestCase):
12
12
  self.renderer = MarkdownRenderer()
13
13
 
14
14
  def test_render(self):
15
- self.renderer.render(self.graph)
16
- self.assertIsInstance(self.renderer.get_content(), str)
15
+ markdown = self.renderer.render(self.graph)
16
+ self.assertIsInstance(markdown, str)
17
17
 
18
18
 
19
19
  if __name__ == "__main__":
@@ -284,7 +284,7 @@ wheels = [
284
284
 
285
285
  [[package]]
286
286
  name = "dbgraph"
287
- version = "0.2.1"
287
+ version = "0.2.2"
288
288
  source = { editable = "." }
289
289
  dependencies = [
290
290
  { name = "bm25s" },
@@ -1 +0,0 @@
1
- [0,136,354,497,658,857,1053,1255,1436,1680,1856,2006,2188,2329,2513,2640,2789,2942,3150,3353,3507,3668,3767,3871,3979,4102,4200,4291,4413,4515,4609,4707,4797,4903,5000,5101,5228,5361,5451,5559,5648,5740,5846,5966,6064,6162,6271,6392,6516,6632,6741,6869,6990,7120,7238,7369,7489,7628,7727,7846,7975,8075,8196,8320,8454,8580,8707,8822,8922,9037,9141,9244,9361,9450,9593,9737,9896,9994,10121,10279,10428,10589,10778,10938,11035,11135,11237,11343,11443,11569,11699,11810,11905,12022,12129,12236,12345,12464,12580,12685,12819]
@@ -1 +0,0 @@
1
- {"type":0,"identifi":1,"shipper":2,"hierarchi":3,"categor":4,"status":5,"path":6,"physic":7,"inventori":8,"current":9,"primari":10,"photograph":11,"carrier":12,"discontinu":13,"demograph":14,"held":15,"25":16,"name":17,"ship":18,"job":19,"profil":20,"often":21,"weight":22,"base":23,"local":24,"stock":25,"first":26,"group":27,"manag":28,"destin":29,"entiti":30,"referenc":31,"about":32,"id":33,"categori":34,"deliv":35,"territori":36,"actual":37,"facilit":38,"cost":39,"price":40,"citi":41,"activ":42,"tabl":43,"serv":44,"whom":45,"provid":46,"logist":47,"parent":48,"date":49,"relationship":50,"level":51,"courtesi":52,"legal":53,"area":54,"surnam":55,"extens":56,"yet":57,"master":58,"geograph":59,"size":60,"use":61,"contact":62,"databas":63,"appli":64,"packag":65,"internal":66,"each":67,"file":68,"transact":69,"integ":70,"ani":71,"address":72,"websit":73,"imag":74,"url":75,"ms":76,"characterist":77,"specif":78,"binari":79,"locat":80,"it":81,"number":82,"last":83,"person":84,"homepag":85,"rang":86,"who":87,"explain":88,"singl":89,"associ":90,"note":91,"segment":92,"assign":93,"system":94,"label":95,"textual":96,"scope":97,"quantiti":98,"lookup":99,"metadata":100,"home":101,"provinc":102,"be":103,"definit":104,"custom":105,"between":106,"eastern":107,"order":108,"text":109,"object":110,"expect":111,"mani":112,"beverag":113,"logo":114,"dr":115,"store":116,"when":117,"all":118,"code":119,"process":120,"biograph":121,"record":122,"sale":123,"data":124,"charg":125,"per":126,"item":127,"personnel":128,"organiz":129,"given":130,"countri":131,"descript":132,"from":133,"postal":134,"birth":135,"zip":136,"regard":137,"foreign":138,"southern":139,"hire":140,"telephon":141,"percentag":142,"junction":143,"employe":144,"classifi":145,"which":146,"where":147,"state":148,"uniqu":149,"visual":150,"has":151,"product":152,"addit":153,"entri":154,"arriv":155,"phone":156,"place":157,"deliveri":158,"indic":159,"contain":160,"salut":161,"fax":162,"correspond":163,"threshold":164,"facsimil":165,"detail":166,"confect":167,"profession":168,"unit":169,"map":170,"case":171,"handl":172,"region":173,"pack":174,"sold":175,"customerdemograph":176,"refer":177,"freight":178,"whether":179,"role":180,"dispatch":181,"discount":182,"time":183,"line":184,"content":185,"titl":186,"posit":187,"busi":188,"link":189,"inform":190,"minimum":191,"avail":192,"should":193,"resid":194,"respons":195,"identif":196,"photo":197,"market":198,"includ":199,"mr":200,"have":201,"larg":202,"employeeid":203,"northern":204,"within":205,"western":206,"repres":207,"describ":208,"full":209,"been":210,"supplier":211,"key":212,"act":213,"street":214,"establish":215,"purchas":216,"flag":217,"compani":218,"new":219,"report":220,"":221}
@@ -1,20 +0,0 @@
1
- from dataclasses import dataclass
2
-
3
-
4
- @dataclass
5
- class Event:
6
- """Base event used in DBGraph"""
7
-
8
- message: str
9
-
10
-
11
- @dataclass
12
- class ProgressEvent(Event):
13
- """Event with progress"""
14
-
15
- target: float
16
- current: float
17
-
18
- def get_percentage(self) -> float:
19
- """Return the progress of the task in percentage"""
20
- return self.current / self.target
@@ -1,61 +0,0 @@
1
- import queue
2
- import threading
3
-
4
- from dbgraph.event.event import Event
5
- from dbgraph.event.event_handler import EventHandler
6
-
7
-
8
- class EventBus:
9
- """Store events in a queue and manage a background thread to distribute events"""
10
-
11
- def __init__(self) -> None:
12
- self.queue = queue.Queue()
13
- self.handlers: dict[type[Event], set[EventHandler]] = {}
14
- self._thread: threading.Thread | None = None
15
- self._stop_event = threading.Event()
16
-
17
- def subscribe(self, event_type: type[Event], handler: EventHandler):
18
- """Subscribe a handler to specific type of event"""
19
- if event_type in self.handlers:
20
- self.handlers[event_type].add(handler)
21
- else:
22
- self.handlers[event_type] = {handler}
23
-
24
- def unsubscribe(self, event_type: type[Event], handler: EventHandler):
25
- """Unsubscribe a handler from listening to specific event type"""
26
- self.handlers[event_type].remove(handler)
27
-
28
- def publish(self, event: Event):
29
- """Push an event into the event queue"""
30
- self.queue.put(event)
31
-
32
- def _dispatch(self):
33
- """Get the latest event and let the appropriate handler process it"""
34
- event = self.queue.get()
35
- for handler in self.handlers[type(event)]:
36
- handler.handle(event)
37
-
38
- def _run(self):
39
- """Run the event loop"""
40
- while not self._stop_event.is_set():
41
- try:
42
- self._dispatch()
43
- except queue.Empty:
44
- continue
45
-
46
- def start(self):
47
- """Start the event background thread"""
48
- if self._thread is not None and self._thread.is_alive():
49
- return
50
- self._stop_event.clear()
51
- self._thread = threading.Thread(
52
- target=self._run, name="dbgraph-event-bus", daemon=True
53
- )
54
- self._thread.start()
55
-
56
- def stop(self):
57
- """Stop the event background thread"""
58
- self._stop_event.set()
59
- if self._thread is not None:
60
- self._thread.join()
61
- self._thread = None
@@ -1,11 +0,0 @@
1
- from abc import ABC, abstractmethod
2
-
3
- from dbgraph.event.event import Event
4
-
5
-
6
- class EventHandler(ABC):
7
- """Interface for event handler"""
8
-
9
- @abstractmethod
10
- def handle(self, event: Event):
11
- """Handle the event"""
@@ -1,11 +0,0 @@
1
- from abc import ABC, abstractmethod
2
-
3
- from dbgraph.render.graph_renderer import GraphRenderer
4
-
5
-
6
- class TextRenderer(GraphRenderer, ABC):
7
- """Render the graph to text-based representation"""
8
-
9
- @abstractmethod
10
- def get_content(self) -> str:
11
- """Get the text data"""
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