sqlsaber 0.10.0__tar.gz → 0.11.0__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.

Potentially problematic release.


This version of sqlsaber might be problematic. Click here for more details.

Files changed (68) hide show
  1. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/CHANGELOG.md +6 -0
  2. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/PKG-INFO +1 -1
  3. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/pyproject.toml +1 -1
  4. sqlsaber-0.11.0/src/sqlsaber/__init__.py +1 -0
  5. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/src/sqlsaber/cli/display.py +1 -6
  6. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/src/sqlsaber/database/schema.py +41 -53
  7. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/uv.lock +1 -1
  8. sqlsaber-0.10.0/src/sqlsaber/__init__.py +0 -3
  9. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/.github/workflows/publish.yml +0 -0
  10. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/.gitignore +0 -0
  11. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/.python-version +0 -0
  12. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/AGENT.md +0 -0
  13. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/CLAUDE.md +0 -0
  14. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/LICENSE +0 -0
  15. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/README.md +0 -0
  16. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/pytest.ini +0 -0
  17. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/sqlsaber.svg +0 -0
  18. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/src/sqlsaber/__main__.py +0 -0
  19. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/src/sqlsaber/agents/__init__.py +0 -0
  20. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/src/sqlsaber/agents/anthropic.py +0 -0
  21. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/src/sqlsaber/agents/base.py +0 -0
  22. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/src/sqlsaber/agents/mcp.py +0 -0
  23. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/src/sqlsaber/agents/streaming.py +0 -0
  24. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/src/sqlsaber/cli/__init__.py +0 -0
  25. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/src/sqlsaber/cli/auth.py +0 -0
  26. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/src/sqlsaber/cli/commands.py +0 -0
  27. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/src/sqlsaber/cli/completers.py +0 -0
  28. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/src/sqlsaber/cli/database.py +0 -0
  29. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/src/sqlsaber/cli/interactive.py +0 -0
  30. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/src/sqlsaber/cli/memory.py +0 -0
  31. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/src/sqlsaber/cli/models.py +0 -0
  32. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/src/sqlsaber/cli/streaming.py +0 -0
  33. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/src/sqlsaber/clients/__init__.py +0 -0
  34. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/src/sqlsaber/clients/anthropic.py +0 -0
  35. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/src/sqlsaber/clients/base.py +0 -0
  36. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/src/sqlsaber/clients/exceptions.py +0 -0
  37. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/src/sqlsaber/clients/models.py +0 -0
  38. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/src/sqlsaber/clients/streaming.py +0 -0
  39. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/src/sqlsaber/config/__init__.py +0 -0
  40. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/src/sqlsaber/config/api_keys.py +0 -0
  41. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/src/sqlsaber/config/auth.py +0 -0
  42. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/src/sqlsaber/config/database.py +0 -0
  43. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/src/sqlsaber/config/oauth_flow.py +0 -0
  44. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/src/sqlsaber/config/oauth_tokens.py +0 -0
  45. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/src/sqlsaber/config/settings.py +0 -0
  46. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/src/sqlsaber/database/__init__.py +0 -0
  47. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/src/sqlsaber/database/connection.py +0 -0
  48. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/src/sqlsaber/mcp/__init__.py +0 -0
  49. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/src/sqlsaber/mcp/mcp.py +0 -0
  50. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/src/sqlsaber/memory/__init__.py +0 -0
  51. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/src/sqlsaber/memory/manager.py +0 -0
  52. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/src/sqlsaber/memory/storage.py +0 -0
  53. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/src/sqlsaber/models/__init__.py +0 -0
  54. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/src/sqlsaber/models/events.py +0 -0
  55. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/src/sqlsaber/models/types.py +0 -0
  56. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/tests/__init__.py +0 -0
  57. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/tests/conftest.py +0 -0
  58. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/tests/test_agents/test_anthropic_oauth.py +0 -0
  59. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/tests/test_cli/__init__.py +0 -0
  60. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/tests/test_cli/test_commands.py +0 -0
  61. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/tests/test_clients/test_anthropic_client.py +0 -0
  62. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/tests/test_clients/test_streaming.py +0 -0
  63. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/tests/test_config/__init__.py +0 -0
  64. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/tests/test_config/test_database.py +0 -0
  65. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/tests/test_config/test_oauth.py +0 -0
  66. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/tests/test_config/test_settings.py +0 -0
  67. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/tests/test_database/__init__.py +0 -0
  68. {sqlsaber-0.10.0 → sqlsaber-0.11.0}/tests/test_database/test_connection.py +0 -0
@@ -4,6 +4,12 @@ All notable changes to SQLSaber will be documented in this file.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.11.0] - 2025-07-09
8
+
9
+ ### Changed
10
+
11
+ - Removed row counting from `list_tables` tool for all database types
12
+
7
13
  ## [0.10.0] - 2025-07-08
8
14
 
9
15
  ### Added
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sqlsaber
3
- Version: 0.10.0
3
+ Version: 0.11.0
4
4
  Summary: SQLSaber - Agentic SQL assistant like Claude Code
5
5
  License-File: LICENSE
6
6
  Requires-Python: >=3.12
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "sqlsaber"
3
- version = "0.10.0"
3
+ version = "0.11.0"
4
4
  description = "SQLSaber - Agentic SQL assistant like Claude Code"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.12"
@@ -0,0 +1 @@
1
+ """SQLSaber CLI - Agentic SQL assistant like Claude Code but for SQL."""
@@ -125,7 +125,6 @@ class DisplayManager:
125
125
  {"name": "Schema", "style": "cyan"},
126
126
  {"name": "Table Name", "style": "white"},
127
127
  {"name": "Type", "style": "yellow"},
128
- {"name": "Row Count", "justify": "right", "style": "magenta"},
129
128
  ]
130
129
  table = self._create_table(columns)
131
130
 
@@ -134,12 +133,8 @@ class DisplayManager:
134
133
  schema = table_info.get("schema", "")
135
134
  name = table_info.get("name", "")
136
135
  table_type = table_info.get("type", "")
137
- row_count = table_info.get("row_count", 0)
138
136
 
139
- # Format row count with commas for readability
140
- formatted_count = f"{row_count:,}" if row_count else "0"
141
-
142
- table.add_row(schema, name, table_type, formatted_count)
137
+ table.add_row(schema, name, table_type)
143
138
 
144
139
  self.console.print(table)
145
140
 
@@ -42,7 +42,7 @@ class BaseSchemaIntrospector(ABC):
42
42
  pass
43
43
 
44
44
  @abstractmethod
45
- async def list_tables_info(self, connection) -> dict[str, Any]:
45
+ async def list_tables_info(self, connection) -> list[dict[str, Any]]:
46
46
  """Get list of tables with basic information."""
47
47
  pass
48
48
 
@@ -182,32 +182,31 @@ class PostgreSQLSchemaIntrospector(BaseSchemaIntrospector):
182
182
  """
183
183
  return await conn.fetch(pk_query)
184
184
 
185
- async def list_tables_info(self, connection) -> dict[str, Any]:
185
+ async def list_tables_info(self, connection) -> list[dict[str, Any]]:
186
186
  """Get list of tables with basic information for PostgreSQL."""
187
187
  pool = await connection.get_pool()
188
188
  async with pool.acquire() as conn:
189
- # Get tables with row counts
189
+ # Get tables without row counts for better performance
190
190
  tables_query = """
191
- WITH table_stats AS (
192
- SELECT
193
- schemaname,
194
- relname as tablename,
195
- n_live_tup as approximate_row_count
196
- FROM pg_stat_user_tables
197
- )
198
191
  SELECT
199
192
  t.table_schema,
200
193
  t.table_name,
201
- t.table_type,
202
- COALESCE(ts.approximate_row_count, 0) as row_count
194
+ t.table_type
203
195
  FROM information_schema.tables t
204
- LEFT JOIN table_stats ts
205
- ON t.table_schema = ts.schemaname
206
- AND t.table_name = ts.tablename
207
196
  WHERE t.table_schema NOT IN ('pg_catalog', 'information_schema')
208
197
  ORDER BY t.table_schema, t.table_name;
209
198
  """
210
- return await conn.fetch(tables_query)
199
+ records = await conn.fetch(tables_query)
200
+
201
+ # Convert asyncpg.Record objects to dictionaries
202
+ return [
203
+ {
204
+ "table_schema": record["table_schema"],
205
+ "table_name": record["table_name"],
206
+ "table_type": record["table_type"],
207
+ }
208
+ for record in records
209
+ ]
211
210
 
212
211
 
213
212
  class MySQLSchemaIntrospector(BaseSchemaIntrospector):
@@ -353,24 +352,33 @@ class MySQLSchemaIntrospector(BaseSchemaIntrospector):
353
352
  await cursor.execute(pk_query)
354
353
  return await cursor.fetchall()
355
354
 
356
- async def list_tables_info(self, connection) -> dict[str, Any]:
355
+ async def list_tables_info(self, connection) -> list[dict[str, Any]]:
357
356
  """Get list of tables with basic information for MySQL."""
358
357
  pool = await connection.get_pool()
359
358
  async with pool.acquire() as conn:
360
359
  async with conn.cursor() as cursor:
361
- # Get tables with row counts
360
+ # Get tables without row counts for better performance
362
361
  tables_query = """
363
362
  SELECT
364
363
  t.table_schema,
365
364
  t.table_name,
366
- t.table_type,
367
- COALESCE(t.table_rows, 0) as row_count
365
+ t.table_type
368
366
  FROM information_schema.tables t
369
367
  WHERE t.table_schema NOT IN ('information_schema', 'performance_schema', 'mysql', 'sys')
370
368
  ORDER BY t.table_schema, t.table_name;
371
369
  """
372
370
  await cursor.execute(tables_query)
373
- return await cursor.fetchall()
371
+ rows = await cursor.fetchall()
372
+
373
+ # Convert rows to dictionaries
374
+ return [
375
+ {
376
+ "table_schema": row["table_schema"],
377
+ "table_name": row["table_name"],
378
+ "table_type": row["table_type"],
379
+ }
380
+ for row in rows
381
+ ]
374
382
 
375
383
 
376
384
  class SQLiteSchemaIntrospector(BaseSchemaIntrospector):
@@ -496,9 +504,9 @@ class SQLiteSchemaIntrospector(BaseSchemaIntrospector):
496
504
 
497
505
  return primary_keys
498
506
 
499
- async def list_tables_info(self, connection) -> dict[str, Any]:
507
+ async def list_tables_info(self, connection) -> list[dict[str, Any]]:
500
508
  """Get list of tables with basic information for SQLite."""
501
- # First get the table names
509
+ # Get table names without row counts for better performance
502
510
  tables_query = """
503
511
  SELECT
504
512
  'main' as table_schema,
@@ -512,34 +520,15 @@ class SQLiteSchemaIntrospector(BaseSchemaIntrospector):
512
520
 
513
521
  tables = await self._execute_query(connection, tables_query)
514
522
 
515
- # Now get row counts for each table
516
- result = []
517
- for table in tables:
518
- table_name = table["table_name"]
519
- table_type = table["table_type"]
520
-
521
- # Only count rows for tables, not views
522
- if table_type.lower() == "table":
523
- try:
524
- count_query = f"SELECT COUNT(*) as count FROM [{table_name}]"
525
- count_result = await self._execute_query(connection, count_query)
526
- row_count = count_result[0]["count"] if count_result else 0
527
- except Exception:
528
- # If count fails (e.g., table locked), default to 0
529
- row_count = 0
530
- else:
531
- # For views, we don't count rows as it could be expensive
532
- row_count = 0
533
-
534
- result.append(
535
- {
536
- "table_schema": table["table_schema"],
537
- "table_name": table_name,
538
- "table_type": table_type,
539
- "row_count": row_count,
540
- }
541
- )
542
- return result
523
+ # Convert to expected format
524
+ return [
525
+ {
526
+ "table_schema": table["table_schema"],
527
+ "table_name": table["table_name"],
528
+ "table_type": table["table_type"],
529
+ }
530
+ for table in tables
531
+ ]
543
532
 
544
533
 
545
534
  class SchemaManager:
@@ -682,7 +671,7 @@ class SchemaManager:
682
671
  )
683
672
 
684
673
  async def list_tables(self) -> dict[str, Any]:
685
- """Get a list of all tables with basic information like row counts."""
674
+ """Get a list of all tables with basic information."""
686
675
  # Check cache first
687
676
  cache_key = "list_tables"
688
677
  cached_data = self._get_cached_tables(cache_key)
@@ -702,7 +691,6 @@ class SchemaManager:
702
691
  "name": table["table_name"],
703
692
  "full_name": f"{table['table_schema']}.{table['table_name']}",
704
693
  "type": table["table_type"],
705
- "row_count": table["row_count"],
706
694
  }
707
695
  )
708
696
 
@@ -918,7 +918,7 @@ wheels = [
918
918
 
919
919
  [[package]]
920
920
  name = "sqlsaber"
921
- version = "0.10.0"
921
+ version = "0.11.0"
922
922
  source = { editable = "." }
923
923
  dependencies = [
924
924
  { name = "aiomysql" },
@@ -1,3 +0,0 @@
1
- """SQLSaber CLI - SQL like Claude Code."""
2
-
3
- __version__ = "0.1.0"
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