py-dbms-cli 2.1.0__tar.gz → 2.1.2__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,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: py-dbms-cli
3
- Version: 2.1.0
3
+ Version: 2.1.2
4
4
  Summary: A modern, secure, aesthetic and your ultimate DBMS client. Implemented as a CLI (Command-Line Interface) tool and written 100% in Python
5
5
  Author-email: Anish Sethi <sethi.dynasty123@gmail.com>
6
6
  License: Copyright 2025 Anish Sethi
@@ -27,7 +27,8 @@ Requires-Dist: sqlparse
27
27
  Requires-Dist: pwinput
28
28
  Dynamic: license-file
29
29
 
30
- **EXPERIMENTAL RELEASE**
30
+ **STABLE RELEASE**
31
+ ### v2.1.2
31
32
 
32
33
  PY DBMS — A Modern, Secure, All-in-One DBMS CLI Client
33
34
 
@@ -120,6 +121,9 @@ Command Description
120
121
  .schema <table> Show CREATE TABLE definition
121
122
  .clear Clear the screen
122
123
  .version Show build/version info
124
+ .config Show config settings for pydbms
125
+ .config set <>.<> <> Set config to a value
126
+ .config reset <>.<> Reset config to a default
123
127
  .exit Exit the CLI
124
128
 
125
129
  Roadmap
@@ -1,4 +1,5 @@
1
- **EXPERIMENTAL RELEASE**
1
+ **STABLE RELEASE**
2
+ ### v2.1.2
2
3
 
3
4
  PY DBMS — A Modern, Secure, All-in-One DBMS CLI Client
4
5
 
@@ -91,6 +92,9 @@ Command Description
91
92
  .schema <table> Show CREATE TABLE definition
92
93
  .clear Clear the screen
93
94
  .version Show build/version info
95
+ .config Show config settings for pydbms
96
+ .config set <>.<> <> Set config to a value
97
+ .config reset <>.<> Reset config to a default
94
98
  .exit Exit the CLI
95
99
 
96
100
  Roadmap
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: py-dbms-cli
3
- Version: 2.1.0
3
+ Version: 2.1.2
4
4
  Summary: A modern, secure, aesthetic and your ultimate DBMS client. Implemented as a CLI (Command-Line Interface) tool and written 100% in Python
5
5
  Author-email: Anish Sethi <sethi.dynasty123@gmail.com>
6
6
  License: Copyright 2025 Anish Sethi
@@ -27,7 +27,8 @@ Requires-Dist: sqlparse
27
27
  Requires-Dist: pwinput
28
28
  Dynamic: license-file
29
29
 
30
- **EXPERIMENTAL RELEASE**
30
+ **STABLE RELEASE**
31
+ ### v2.1.2
31
32
 
32
33
  PY DBMS — A Modern, Secure, All-in-One DBMS CLI Client
33
34
 
@@ -120,6 +121,9 @@ Command Description
120
121
  .schema <table> Show CREATE TABLE definition
121
122
  .clear Clear the screen
122
123
  .version Show build/version info
124
+ .config Show config settings for pydbms
125
+ .config set <>.<> <> Set config to a value
126
+ .config reset <>.<> Reset config to a default
123
127
  .exit Exit the CLI
124
128
 
125
129
  Roadmap
@@ -14,4 +14,5 @@ pydbms/cli.py
14
14
  pydbms/config.py
15
15
  pydbms/core.py
16
16
  pydbms/dependencies.py
17
- pydbms/pydbms_mysql.py
17
+ pydbms/pydbms_mysql.py
18
+ pydbms/pydbms_path.py
@@ -1,6 +1,6 @@
1
1
  #Global functions and variables used across all/major files
2
2
 
3
- from .dependencies import Console, time, sys, os
3
+ from .dependencies import Console, time
4
4
  from .config import load_config
5
5
 
6
6
  console=Console()
@@ -23,18 +23,4 @@ def Print(message: str, color_key="WHITE", style="", type=True) -> None:
23
23
  continue
24
24
  console.print(char, style=f"{style} {color}", end="")
25
25
  time.sleep(delay)
26
-
27
- def pydbms_dir() -> str:
28
- if sys.platform.startswith("win"):
29
- base = os.getenv("APPDATA")
30
- elif sys.platform == "darwin":
31
- base = os.path.expanduser("~/Library/Application Support")
32
- else:
33
- base = os.path.expanduser("~/.local/share")
34
-
35
- path = os.path.join(base, "pydbms")
36
- os.makedirs(path, exist_ok=True)
37
- return path
38
-
39
- def pydbms_path(*parts) -> str:
40
- return os.path.join(pydbms_dir(), *parts)
26
+
@@ -1,7 +1,7 @@
1
1
  #config options for pydbms
2
2
  #NOTE: If config.json file generated by the program is deleted or currpoted, it will restore to defaults.
3
3
 
4
- from .Global import pydbms_path
4
+ from .pydbms_path import pydbms_path
5
5
  from .dependencies import json, os, copy
6
6
 
7
7
  DEFAULT_CONFIG = {
@@ -2,7 +2,7 @@
2
2
  PY DBMS — DB client CLI
3
3
  Copyright (C) 2025 Anish Sethi
4
4
  Licensed under - BSD-3-Clause License
5
- Version - 2.1.0
5
+ Version - 2.1.2 #NOTE: v2.1.0 had a bug while uploading to PyPI, hence v2.1.1 has been taken for stable release.
6
6
  Release - Stable
7
7
  '''
8
8
 
@@ -22,7 +22,7 @@ def print_banner() -> None:
22
22
  stats_table.add_column("3", justify="center", ratio=1)
23
23
 
24
24
  stats_table.add_row(
25
- "[bold cyan]v2.1.0[/]\n[bold white]Version[/]",
25
+ "[bold cyan]v2.1.2[/]\n [bold white]Version[/]",
26
26
  "[bold yellow]MySQL[/]\n[bold white]Currently Supported[/]",
27
27
  "[bold green]Online since 2025[/]\n[bold white]Status[/]"
28
28
  )
@@ -66,7 +66,7 @@ def build_section_table(section: dict) -> Table:
66
66
 
67
67
  return table
68
68
 
69
- def meta(cmd: str, cur: object) -> None:
69
+ def meta(cmd: str, cur: object, con=None) -> None:
70
70
  cmd = cmd.strip()
71
71
 
72
72
  # .help
@@ -138,9 +138,10 @@ def meta(cmd: str, cur: object) -> None:
138
138
  info.add_column("", style="dim white")
139
139
 
140
140
  info.add_row("Name", "[link=https://github.com/Anish-Sethi-12122/py-dbms-cli]pydbms Terminal[/link]")
141
- info.add_row("Version", "v2.1.0")
141
+ info.add_row("Version", "v2.1.2")
142
142
  info.add_row("Build", "Stable Release")
143
143
  info.add_row("Python", f"[link=https://www.python.org/]{sys.version.split()[0]}[/link]")
144
+ info.add_row("MySQL", f"[link=https://www.mysql.com/]{con.get_server_info()}[/link]")
144
145
  info.add_row("Author", "[link=https://www.linkedin.com/in/anish-sethi-dtu-cse/]Anish Sethi[/link]")
145
146
  info.add_row("Institution", "B.Tech Computer Science and Engineering @ Delhi Technological University")
146
147
  info.add_row("Licensed under", "[link=https://opensource.org/license/bsd-3-clause]BSD-3-Clause License[/link]")
@@ -192,6 +193,7 @@ def meta(cmd: str, cur: object) -> None:
192
193
 
193
194
  if len(parts) != 4:
194
195
  Print("Usage: .config set <section>.<key> <value>", "YELLOW")
196
+ console.print()
195
197
  return
196
198
 
197
199
  _, _, path, raw_value = parts
@@ -200,12 +202,16 @@ def meta(cmd: str, cur: object) -> None:
200
202
 
201
203
  if not parsed:
202
204
  Print("Invalid input format. Use <section>.<key>", "RED")
205
+ console.print()
203
206
  return
204
207
 
205
208
  section, key = parsed
209
+ section=section.lower()
210
+ key=key.lower()
206
211
 
207
212
  if section not in config or key not in config[section]:
208
213
  Print(f"Unknown config key: {path}", "RED")
214
+ console.print()
209
215
  return
210
216
 
211
217
  value = coerce_value_config(raw_value)
@@ -213,6 +219,7 @@ def meta(cmd: str, cur: object) -> None:
213
219
  save_config(config)
214
220
 
215
221
  Print(f"Updated {path} → {value}", "GREEN")
222
+ console.print()
216
223
  return
217
224
 
218
225
  # .config reset or .config -d or .config --default
@@ -221,6 +228,7 @@ def meta(cmd: str, cur: object) -> None:
221
228
 
222
229
  if len(parts) != 3:
223
230
  Print("Usage: .config reset <section>.<key>", "YELLOW")
231
+ console.print()
224
232
  return
225
233
 
226
234
  path = parts[2]
@@ -228,27 +236,34 @@ def meta(cmd: str, cur: object) -> None:
228
236
 
229
237
  if not parsed:
230
238
  Print("Invalid config key format. Use <section>.<key>", "RED")
239
+ console.print()
231
240
  return
232
241
 
233
242
  section, key = parsed
243
+ section=section.lower()
244
+ key=key.lower()
234
245
  default = get_default_value_config(section, key)
235
246
 
236
247
  if default is None:
237
248
  Print(f"No default value for {path}.", "RED")
249
+ console.print()
238
250
  return
239
251
 
240
252
  config[section][key] = default
241
253
  save_config(config)
242
254
 
243
255
  Print(f"Reset {path} → {default}", "GREEN")
256
+ console.print()
244
257
  return
245
258
 
246
259
  # .exit
247
260
  if cmd == ".exit":
248
261
  Print("Session Terminated.", "RED", "bold")
262
+ console.print()
249
263
  sys.exit()
250
264
 
251
265
  Print(f"Unknown command: {cmd}\nRefer to `.help` for list of commands", "YELLOW")
266
+ console.print()
252
267
 
253
268
  def main():
254
269
  global config
@@ -259,14 +274,15 @@ def main():
259
274
  con, cur = connect()
260
275
 
261
276
  Print("Welcome to PY DBMS. If you are unsure where to start, here are some helper commands.", "YELLOW")
262
- print("\n\n")
277
+ console.print()
278
+ console.print()
263
279
  meta(".help",cur)
264
280
 
265
281
  while True:
266
282
  query=get_query_mysql()
267
283
 
268
284
  if query.strip().startswith("."):
269
- meta(query.strip(), cur)
285
+ meta(query.strip(), cur, con)
270
286
  continue
271
287
 
272
288
  if query.lower().strip()=="exit;":
@@ -0,0 +1,16 @@
1
+ from .dependencies import sys, os
2
+
3
+ def pydbms_dir() -> str:
4
+ if sys.platform.startswith("win"):
5
+ base = os.getenv("APPDATA")
6
+ elif sys.platform == "darwin":
7
+ base = os.path.expanduser("~/Library/Application Support")
8
+ else:
9
+ base = os.path.expanduser("~/.local/share")
10
+
11
+ path = os.path.join(base, "pydbms")
12
+ os.makedirs(path, exist_ok=True)
13
+ return path
14
+
15
+ def pydbms_path(*parts) -> str:
16
+ return os.path.join(pydbms_dir(), *parts)
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "py-dbms-cli"
7
- version = "2.1.0"
7
+ version = "2.1.2"
8
8
  description = "A modern, secure, aesthetic and your ultimate DBMS client. Implemented as a CLI (Command-Line Interface) tool and written 100% in Python"
9
9
  readme = "README.md"
10
10
  license = { file = "LICENSE" }
File without changes
File without changes
File without changes
File without changes