sqlshell 0.2.3__py3-none-any.whl → 0.3.0__py3-none-any.whl
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.
Potentially problematic release.
This version of sqlshell might be problematic. Click here for more details.
- sqlshell/__init__.py +34 -4
- sqlshell/db/__init__.py +2 -1
- sqlshell/db/database_manager.py +336 -23
- sqlshell/db/export_manager.py +188 -0
- sqlshell/editor_integration.py +127 -0
- sqlshell/execution_handler.py +421 -0
- sqlshell/main.py +570 -140
- sqlshell/query_tab.py +592 -7
- sqlshell/ui/filter_header.py +22 -1
- sqlshell/utils/profile_column.py +1586 -170
- sqlshell/utils/profile_foreign_keys.py +103 -11
- sqlshell/utils/profile_ohe.py +631 -0
- {sqlshell-0.2.3.dist-info → sqlshell-0.3.0.dist-info}/METADATA +126 -7
- {sqlshell-0.2.3.dist-info → sqlshell-0.3.0.dist-info}/RECORD +17 -13
- {sqlshell-0.2.3.dist-info → sqlshell-0.3.0.dist-info}/WHEEL +1 -1
- {sqlshell-0.2.3.dist-info → sqlshell-0.3.0.dist-info}/entry_points.txt +0 -0
- {sqlshell-0.2.3.dist-info → sqlshell-0.3.0.dist-info}/top_level.txt +0 -0
sqlshell/ui/filter_header.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from PyQt6.QtWidgets import (QHeaderView, QMenu, QCheckBox, QWidgetAction,
|
|
2
|
-
QWidget, QVBoxLayout, QLineEdit, QHBoxLayout, QPushButton, QTableWidget)
|
|
2
|
+
QWidget, QVBoxLayout, QLineEdit, QHBoxLayout, QPushButton, QTableWidget, QMessageBox)
|
|
3
3
|
from PyQt6.QtCore import Qt, QRect, QPoint
|
|
4
4
|
from PyQt6.QtGui import QColor, QFont, QPolygon, QPainterPath, QBrush
|
|
5
5
|
|
|
@@ -90,9 +90,15 @@ class FilterHeader(QHeaderView):
|
|
|
90
90
|
sort_desc_action = context_menu.addAction("Sort Descending")
|
|
91
91
|
context_menu.addSeparator()
|
|
92
92
|
|
|
93
|
+
# Add count rows action
|
|
94
|
+
count_rows_action = context_menu.addAction("Count Rows")
|
|
95
|
+
|
|
93
96
|
# Add explain column action
|
|
94
97
|
explain_action = context_menu.addAction("Explain Column")
|
|
95
98
|
|
|
99
|
+
# Add encode text action
|
|
100
|
+
encode_action = context_menu.addAction("Encode Text")
|
|
101
|
+
|
|
96
102
|
context_menu.addSeparator()
|
|
97
103
|
filter_action = context_menu.addAction("Filter...")
|
|
98
104
|
|
|
@@ -141,6 +147,21 @@ class FilterHeader(QHeaderView):
|
|
|
141
147
|
if logical_index < len(current_tab.current_df.columns):
|
|
142
148
|
column_name = current_tab.current_df.columns[logical_index]
|
|
143
149
|
self.main_window.explain_column(column_name)
|
|
150
|
+
elif action == encode_action:
|
|
151
|
+
# Call the encode_text method on the main window
|
|
152
|
+
if self.main_window and hasattr(self.main_window, "encode_text"):
|
|
153
|
+
# Get the column name from the table (if it has a current dataframe)
|
|
154
|
+
current_tab = self.main_window.get_current_tab()
|
|
155
|
+
if current_tab and hasattr(current_tab, "current_df") and current_tab.current_df is not None:
|
|
156
|
+
if logical_index < len(current_tab.current_df.columns):
|
|
157
|
+
column_name = current_tab.current_df.columns[logical_index]
|
|
158
|
+
self.main_window.encode_text(column_name)
|
|
159
|
+
elif action == count_rows_action:
|
|
160
|
+
# Get the current tab and show row count
|
|
161
|
+
current_tab = self.main_window.get_current_tab()
|
|
162
|
+
if current_tab and hasattr(current_tab, "current_df") and current_tab.current_df is not None:
|
|
163
|
+
row_count = len(current_tab.current_df)
|
|
164
|
+
QMessageBox.information(self, "Row Count", f"Total rows: {row_count:,}")
|
|
144
165
|
|
|
145
166
|
def set_main_window(self, window):
|
|
146
167
|
"""Set the reference to the main window"""
|