zaturn 0.1.6__tar.gz → 0.1.7__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.
@@ -1,3 +1,6 @@
1
+ #### v0.1.7 (2025-05-06)
2
+ - Ensured Read-Only For SQLite and MySQL
3
+
1
4
  #### v0.1.6 (2025-04-25)
2
5
  - Added Clickhouse Support
3
6
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: zaturn
3
- Version: 0.1.6
3
+ Version: 0.1.7
4
4
  Summary: AI Data Analysis MCP
5
5
  Author-email: Karthik Devan <krtdvn@gmail.com>
6
6
  Maintainer-email: Karthik Devan <krtdvn@gmail.com>
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "zaturn"
3
- version = "0.1.6"
3
+ version = "0.1.7"
4
4
  description = "AI Data Analysis MCP"
5
5
  authors = [
6
6
  {name = "Karthik Devan", email = "krtdvn@gmail.com"},
@@ -1455,7 +1455,7 @@ wheels = [
1455
1455
 
1456
1456
  [[package]]
1457
1457
  name = "zaturn"
1458
- version = "0.1.5"
1458
+ version = "0.1.6"
1459
1459
  source = { editable = "." }
1460
1460
  dependencies = [
1461
1461
  { name = "clickhouse-connect" },
@@ -59,8 +59,9 @@ for s in source_list:
59
59
  elif source.startswith('postgresql://'):
60
60
  source_type = 'postgresql'
61
61
  source_name = source.split('/')[-1].split('?')[0]
62
- elif source.startswith("mysql+pymysql://"):
62
+ elif source.startswith("mysql://") or source.startswith("mysql+pymysql://"):
63
63
  source_type = 'mysql'
64
+ s = s.replace('mysql://', 'mysql+pymysql://')
64
65
  source_name = source.split('/')[-1].split('?')[0]
65
66
  elif source.startswith('clickhouse://'):
66
67
  source_type = 'clickhouse'
@@ -86,7 +86,7 @@ def describe_table(source_id: str, table_name: str) -> str:
86
86
  match source['type']:
87
87
  case 'sqlite':
88
88
  result = query_utils.execute_query(source,
89
- f"PRAGMA table_info({table_name});"
89
+ f'PRAGMA table_info({table_name});'
90
90
  )
91
91
  return result.to_markdown(index=False)
92
92
 
@@ -13,16 +13,11 @@ from zaturn import config
13
13
  def execute_query(source: dict, query: str):
14
14
  """Run the query using the appropriate engine and read only config"""
15
15
  url = source['url']
16
-
16
+
17
17
  match source['type']:
18
18
  case "sqlite":
19
- if "mode=ro" in url:
20
- pass
21
- elif '?' in url:
22
- url += '&mode=ro'
23
- else:
24
- url += '?mode=ro'
25
19
  with sqlalchemy.create_engine(url).connect() as conn:
20
+ conn.execute(sqlalchemy.text('PRAGMA query_only = ON;'))
26
21
  result = conn.execute(sqlalchemy.text(query))
27
22
  return pd.DataFrame(result)
28
23
 
@@ -32,6 +27,7 @@ def execute_query(source: dict, query: str):
32
27
  session.autoflush = False
33
28
  session.autocommit = False
34
29
  session.flush = lambda *args: None
30
+ session.execute(sqlalchemy.text('SET SESSION TRANSACTION READ ONLY;'))
35
31
  result = session.execute(sqlalchemy.text(query))
36
32
  return pd.DataFrame(result)
37
33
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: zaturn
3
- Version: 0.1.6
3
+ Version: 0.1.7
4
4
  Summary: AI Data Analysis MCP
5
5
  Author-email: Karthik Devan <krtdvn@gmail.com>
6
6
  Maintainer-email: Karthik Devan <krtdvn@gmail.com>
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