py-dbms-cli 2.1.2__tar.gz → 2.5.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.
- py_dbms_cli-2.5.0/PKG-INFO +143 -0
- py_dbms_cli-2.5.0/README.md +114 -0
- py_dbms_cli-2.5.0/py_dbms_cli.egg-info/PKG-INFO +143 -0
- {py_dbms_cli-2.1.2 → py_dbms_cli-2.5.0}/pydbms/config.py +16 -2
- {py_dbms_cli-2.1.2 → py_dbms_cli-2.5.0}/pydbms/core.py +151 -51
- py_dbms_cli-2.5.0/pydbms/dependencies.py +10 -0
- {py_dbms_cli-2.1.2 → py_dbms_cli-2.5.0}/pydbms/pydbms_mysql.py +10 -4
- {py_dbms_cli-2.1.2 → py_dbms_cli-2.5.0}/pyproject.toml +1 -1
- py_dbms_cli-2.1.2/PKG-INFO +0 -151
- py_dbms_cli-2.1.2/README.md +0 -122
- py_dbms_cli-2.1.2/py_dbms_cli.egg-info/PKG-INFO +0 -151
- py_dbms_cli-2.1.2/pydbms/dependencies.py +0 -19
- {py_dbms_cli-2.1.2 → py_dbms_cli-2.5.0}/LICENSE +0 -0
- {py_dbms_cli-2.1.2 → py_dbms_cli-2.5.0}/MANIFEST.in +0 -0
- {py_dbms_cli-2.1.2 → py_dbms_cli-2.5.0}/py_dbms_cli.egg-info/SOURCES.txt +0 -0
- {py_dbms_cli-2.1.2 → py_dbms_cli-2.5.0}/py_dbms_cli.egg-info/dependency_links.txt +0 -0
- {py_dbms_cli-2.1.2 → py_dbms_cli-2.5.0}/py_dbms_cli.egg-info/entry_points.txt +0 -0
- {py_dbms_cli-2.1.2 → py_dbms_cli-2.5.0}/py_dbms_cli.egg-info/requires.txt +0 -0
- {py_dbms_cli-2.1.2 → py_dbms_cli-2.5.0}/py_dbms_cli.egg-info/top_level.txt +0 -0
- {py_dbms_cli-2.1.2 → py_dbms_cli-2.5.0}/pydbms/Global.py +0 -0
- {py_dbms_cli-2.1.2 → py_dbms_cli-2.5.0}/pydbms/__init__.py +0 -0
- {py_dbms_cli-2.1.2 → py_dbms_cli-2.5.0}/pydbms/cli.py +0 -0
- {py_dbms_cli-2.1.2 → py_dbms_cli-2.5.0}/pydbms/pydbms_path.py +0 -0
- {py_dbms_cli-2.1.2 → py_dbms_cli-2.5.0}/setup.cfg +0 -0
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: py-dbms-cli
|
|
3
|
+
Version: 2.5.0
|
|
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
|
+
Author-email: Anish Sethi <sethi.dynasty123@gmail.com>
|
|
6
|
+
License: Copyright 2025 Anish Sethi
|
|
7
|
+
|
|
8
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
9
|
+
|
|
10
|
+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
11
|
+
|
|
12
|
+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
13
|
+
|
|
14
|
+
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
|
15
|
+
|
|
16
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
17
|
+
Project-URL: Homepage, https://github.com/Anish-Sethi-12122/py-dbms-cli
|
|
18
|
+
Project-URL: Source, https://github.com/Anish-Sethi-12122/py-dbms-cli
|
|
19
|
+
Project-URL: Issues, https://github.com/Anish-Sethi-12122/py-dbms-cli/issues
|
|
20
|
+
Requires-Python: >=3.10
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
License-File: LICENSE
|
|
23
|
+
Requires-Dist: mysql-connector-python
|
|
24
|
+
Requires-Dist: rich
|
|
25
|
+
Requires-Dist: pyfiglet
|
|
26
|
+
Requires-Dist: sqlparse
|
|
27
|
+
Requires-Dist: pwinput
|
|
28
|
+
Dynamic: license-file
|
|
29
|
+
|
|
30
|
+
# PY DBMS — A Modern, Secure MySQL CLI Client
|
|
31
|
+
|
|
32
|
+
**Stable Release — v2.5.0**
|
|
33
|
+
|
|
34
|
+
PY DBMS is a modern, developer-focused command-line client for MySQL, built with Python.
|
|
35
|
+
It provides a clean terminal UI, readable query output, and powerful helper commands—without sacrificing safety or simplicity.
|
|
36
|
+
|
|
37
|
+
Designed for developers who live in the terminal but want a more structured, reliable experience than the default MySQL CLI.
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Key Features
|
|
42
|
+
|
|
43
|
+
### Terminal UX
|
|
44
|
+
- Rich-based terminal interface with structured panels and tables
|
|
45
|
+
- Clean, readable formatting for query results
|
|
46
|
+
- Typewriter-style text rendering for status messages
|
|
47
|
+
- ASCII startup banner and session dashboard
|
|
48
|
+
|
|
49
|
+
### Query Execution
|
|
50
|
+
- Multi-line SQL query support
|
|
51
|
+
- Accurate execution feedback (success, warnings, errors)
|
|
52
|
+
- Execution time reporting for SELECT queries
|
|
53
|
+
- Separate handling for SELECT vs DML / DDL operations
|
|
54
|
+
|
|
55
|
+
### Configuration & Control
|
|
56
|
+
- Persistent JSON-based configuration system (`config.json`)
|
|
57
|
+
- Session-level configuration for runtime behavior changes
|
|
58
|
+
- Inline query flags (e.g. `--expand`) for per-query output overrides
|
|
59
|
+
- Interactive configuration inspection and modification via meta-commands
|
|
60
|
+
|
|
61
|
+
### Security
|
|
62
|
+
- Masked password input
|
|
63
|
+
- Safe defaults for local development
|
|
64
|
+
- No credential persistence
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Installation
|
|
69
|
+
|
|
70
|
+
### Prerequisites
|
|
71
|
+
- Python **3.10+** (recommended)
|
|
72
|
+
- A running MySQL Server
|
|
73
|
+
|
|
74
|
+
### Install via pip
|
|
75
|
+
```bash
|
|
76
|
+
pip install py-dbms-cli
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Usage
|
|
80
|
+
|
|
81
|
+
**1. Run from your terminal**
|
|
82
|
+
```bash
|
|
83
|
+
pydbms
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
**2. When prompted, enter credentials to establish connection with MySQL**
|
|
87
|
+
You will be prompted for:
|
|
88
|
+
- Host
|
|
89
|
+
- Username
|
|
90
|
+
- Password (masked)
|
|
91
|
+
|
|
92
|
+
**3. Begin querying**
|
|
93
|
+
|
|
94
|
+
Enter SQL commands as you normally would.
|
|
95
|
+
Multi-line queries are supported and executed once terminated with ;.
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## Meta Commands
|
|
100
|
+
|
|
101
|
+
PY DBMS includes several helper commands for interactive usage:
|
|
102
|
+
|
|
103
|
+
| Command | Description |
|
|
104
|
+
|------|-----------|
|
|
105
|
+
| `.help` | Show all helper commands |
|
|
106
|
+
| `.databases` | List all databases |
|
|
107
|
+
| `.tables` | List tables in the current database |
|
|
108
|
+
| `.schema <table>` | Show CREATE TABLE definition |
|
|
109
|
+
| `.clear` | Clear the terminal screen |
|
|
110
|
+
| `.version` | Show build and version information |
|
|
111
|
+
| `.config` | Show persistent configuration |
|
|
112
|
+
| `.config set <section>.<key> <value>` | Update a config value |
|
|
113
|
+
| `.config reset <section>.<key>` | Reset a config value |
|
|
114
|
+
| `.session-config` | Show session-level configuration |
|
|
115
|
+
| `.session-config set <key> <value>` | Update session-only settings |
|
|
116
|
+
| `.session-config reset <key>` | Reset a session setting |
|
|
117
|
+
| `.exit` | Exit the CLI |
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## Roadmap
|
|
122
|
+
|
|
123
|
+
Planned future improvements include:
|
|
124
|
+
|
|
125
|
+
- Exporting query results to CSV and JSON
|
|
126
|
+
- Extended output formatting options
|
|
127
|
+
- Support for additional database engines
|
|
128
|
+
- Improved extensibility for plugins and integrations
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## Author
|
|
133
|
+
|
|
134
|
+
Anish Sethi
|
|
135
|
+
B.Tech Computer Science & Engineering
|
|
136
|
+
Delhi Technological University (Class of 2029)
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## License
|
|
141
|
+
|
|
142
|
+
This project is licensed under the BSD 3-Clause License.
|
|
143
|
+
Visit the [BSD 3-Clause License page](https://opensource.org/license/bsd-3-clause) for more information.
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# PY DBMS — A Modern, Secure MySQL CLI Client
|
|
2
|
+
|
|
3
|
+
**Stable Release — v2.5.0**
|
|
4
|
+
|
|
5
|
+
PY DBMS is a modern, developer-focused command-line client for MySQL, built with Python.
|
|
6
|
+
It provides a clean terminal UI, readable query output, and powerful helper commands—without sacrificing safety or simplicity.
|
|
7
|
+
|
|
8
|
+
Designed for developers who live in the terminal but want a more structured, reliable experience than the default MySQL CLI.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Key Features
|
|
13
|
+
|
|
14
|
+
### Terminal UX
|
|
15
|
+
- Rich-based terminal interface with structured panels and tables
|
|
16
|
+
- Clean, readable formatting for query results
|
|
17
|
+
- Typewriter-style text rendering for status messages
|
|
18
|
+
- ASCII startup banner and session dashboard
|
|
19
|
+
|
|
20
|
+
### Query Execution
|
|
21
|
+
- Multi-line SQL query support
|
|
22
|
+
- Accurate execution feedback (success, warnings, errors)
|
|
23
|
+
- Execution time reporting for SELECT queries
|
|
24
|
+
- Separate handling for SELECT vs DML / DDL operations
|
|
25
|
+
|
|
26
|
+
### Configuration & Control
|
|
27
|
+
- Persistent JSON-based configuration system (`config.json`)
|
|
28
|
+
- Session-level configuration for runtime behavior changes
|
|
29
|
+
- Inline query flags (e.g. `--expand`) for per-query output overrides
|
|
30
|
+
- Interactive configuration inspection and modification via meta-commands
|
|
31
|
+
|
|
32
|
+
### Security
|
|
33
|
+
- Masked password input
|
|
34
|
+
- Safe defaults for local development
|
|
35
|
+
- No credential persistence
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Installation
|
|
40
|
+
|
|
41
|
+
### Prerequisites
|
|
42
|
+
- Python **3.10+** (recommended)
|
|
43
|
+
- A running MySQL Server
|
|
44
|
+
|
|
45
|
+
### Install via pip
|
|
46
|
+
```bash
|
|
47
|
+
pip install py-dbms-cli
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Usage
|
|
51
|
+
|
|
52
|
+
**1. Run from your terminal**
|
|
53
|
+
```bash
|
|
54
|
+
pydbms
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
**2. When prompted, enter credentials to establish connection with MySQL**
|
|
58
|
+
You will be prompted for:
|
|
59
|
+
- Host
|
|
60
|
+
- Username
|
|
61
|
+
- Password (masked)
|
|
62
|
+
|
|
63
|
+
**3. Begin querying**
|
|
64
|
+
|
|
65
|
+
Enter SQL commands as you normally would.
|
|
66
|
+
Multi-line queries are supported and executed once terminated with ;.
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Meta Commands
|
|
71
|
+
|
|
72
|
+
PY DBMS includes several helper commands for interactive usage:
|
|
73
|
+
|
|
74
|
+
| Command | Description |
|
|
75
|
+
|------|-----------|
|
|
76
|
+
| `.help` | Show all helper commands |
|
|
77
|
+
| `.databases` | List all databases |
|
|
78
|
+
| `.tables` | List tables in the current database |
|
|
79
|
+
| `.schema <table>` | Show CREATE TABLE definition |
|
|
80
|
+
| `.clear` | Clear the terminal screen |
|
|
81
|
+
| `.version` | Show build and version information |
|
|
82
|
+
| `.config` | Show persistent configuration |
|
|
83
|
+
| `.config set <section>.<key> <value>` | Update a config value |
|
|
84
|
+
| `.config reset <section>.<key>` | Reset a config value |
|
|
85
|
+
| `.session-config` | Show session-level configuration |
|
|
86
|
+
| `.session-config set <key> <value>` | Update session-only settings |
|
|
87
|
+
| `.session-config reset <key>` | Reset a session setting |
|
|
88
|
+
| `.exit` | Exit the CLI |
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Roadmap
|
|
93
|
+
|
|
94
|
+
Planned future improvements include:
|
|
95
|
+
|
|
96
|
+
- Exporting query results to CSV and JSON
|
|
97
|
+
- Extended output formatting options
|
|
98
|
+
- Support for additional database engines
|
|
99
|
+
- Improved extensibility for plugins and integrations
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## Author
|
|
104
|
+
|
|
105
|
+
Anish Sethi
|
|
106
|
+
B.Tech Computer Science & Engineering
|
|
107
|
+
Delhi Technological University (Class of 2029)
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## License
|
|
112
|
+
|
|
113
|
+
This project is licensed under the BSD 3-Clause License.
|
|
114
|
+
Visit the [BSD 3-Clause License page](https://opensource.org/license/bsd-3-clause) for more information.
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: py-dbms-cli
|
|
3
|
+
Version: 2.5.0
|
|
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
|
+
Author-email: Anish Sethi <sethi.dynasty123@gmail.com>
|
|
6
|
+
License: Copyright 2025 Anish Sethi
|
|
7
|
+
|
|
8
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
9
|
+
|
|
10
|
+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
11
|
+
|
|
12
|
+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
13
|
+
|
|
14
|
+
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
|
15
|
+
|
|
16
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
17
|
+
Project-URL: Homepage, https://github.com/Anish-Sethi-12122/py-dbms-cli
|
|
18
|
+
Project-URL: Source, https://github.com/Anish-Sethi-12122/py-dbms-cli
|
|
19
|
+
Project-URL: Issues, https://github.com/Anish-Sethi-12122/py-dbms-cli/issues
|
|
20
|
+
Requires-Python: >=3.10
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
License-File: LICENSE
|
|
23
|
+
Requires-Dist: mysql-connector-python
|
|
24
|
+
Requires-Dist: rich
|
|
25
|
+
Requires-Dist: pyfiglet
|
|
26
|
+
Requires-Dist: sqlparse
|
|
27
|
+
Requires-Dist: pwinput
|
|
28
|
+
Dynamic: license-file
|
|
29
|
+
|
|
30
|
+
# PY DBMS — A Modern, Secure MySQL CLI Client
|
|
31
|
+
|
|
32
|
+
**Stable Release — v2.5.0**
|
|
33
|
+
|
|
34
|
+
PY DBMS is a modern, developer-focused command-line client for MySQL, built with Python.
|
|
35
|
+
It provides a clean terminal UI, readable query output, and powerful helper commands—without sacrificing safety or simplicity.
|
|
36
|
+
|
|
37
|
+
Designed for developers who live in the terminal but want a more structured, reliable experience than the default MySQL CLI.
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Key Features
|
|
42
|
+
|
|
43
|
+
### Terminal UX
|
|
44
|
+
- Rich-based terminal interface with structured panels and tables
|
|
45
|
+
- Clean, readable formatting for query results
|
|
46
|
+
- Typewriter-style text rendering for status messages
|
|
47
|
+
- ASCII startup banner and session dashboard
|
|
48
|
+
|
|
49
|
+
### Query Execution
|
|
50
|
+
- Multi-line SQL query support
|
|
51
|
+
- Accurate execution feedback (success, warnings, errors)
|
|
52
|
+
- Execution time reporting for SELECT queries
|
|
53
|
+
- Separate handling for SELECT vs DML / DDL operations
|
|
54
|
+
|
|
55
|
+
### Configuration & Control
|
|
56
|
+
- Persistent JSON-based configuration system (`config.json`)
|
|
57
|
+
- Session-level configuration for runtime behavior changes
|
|
58
|
+
- Inline query flags (e.g. `--expand`) for per-query output overrides
|
|
59
|
+
- Interactive configuration inspection and modification via meta-commands
|
|
60
|
+
|
|
61
|
+
### Security
|
|
62
|
+
- Masked password input
|
|
63
|
+
- Safe defaults for local development
|
|
64
|
+
- No credential persistence
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Installation
|
|
69
|
+
|
|
70
|
+
### Prerequisites
|
|
71
|
+
- Python **3.10+** (recommended)
|
|
72
|
+
- A running MySQL Server
|
|
73
|
+
|
|
74
|
+
### Install via pip
|
|
75
|
+
```bash
|
|
76
|
+
pip install py-dbms-cli
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Usage
|
|
80
|
+
|
|
81
|
+
**1. Run from your terminal**
|
|
82
|
+
```bash
|
|
83
|
+
pydbms
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
**2. When prompted, enter credentials to establish connection with MySQL**
|
|
87
|
+
You will be prompted for:
|
|
88
|
+
- Host
|
|
89
|
+
- Username
|
|
90
|
+
- Password (masked)
|
|
91
|
+
|
|
92
|
+
**3. Begin querying**
|
|
93
|
+
|
|
94
|
+
Enter SQL commands as you normally would.
|
|
95
|
+
Multi-line queries are supported and executed once terminated with ;.
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## Meta Commands
|
|
100
|
+
|
|
101
|
+
PY DBMS includes several helper commands for interactive usage:
|
|
102
|
+
|
|
103
|
+
| Command | Description |
|
|
104
|
+
|------|-----------|
|
|
105
|
+
| `.help` | Show all helper commands |
|
|
106
|
+
| `.databases` | List all databases |
|
|
107
|
+
| `.tables` | List tables in the current database |
|
|
108
|
+
| `.schema <table>` | Show CREATE TABLE definition |
|
|
109
|
+
| `.clear` | Clear the terminal screen |
|
|
110
|
+
| `.version` | Show build and version information |
|
|
111
|
+
| `.config` | Show persistent configuration |
|
|
112
|
+
| `.config set <section>.<key> <value>` | Update a config value |
|
|
113
|
+
| `.config reset <section>.<key>` | Reset a config value |
|
|
114
|
+
| `.session-config` | Show session-level configuration |
|
|
115
|
+
| `.session-config set <key> <value>` | Update session-only settings |
|
|
116
|
+
| `.session-config reset <key>` | Reset a session setting |
|
|
117
|
+
| `.exit` | Exit the CLI |
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## Roadmap
|
|
122
|
+
|
|
123
|
+
Planned future improvements include:
|
|
124
|
+
|
|
125
|
+
- Exporting query results to CSV and JSON
|
|
126
|
+
- Extended output formatting options
|
|
127
|
+
- Support for additional database engines
|
|
128
|
+
- Improved extensibility for plugins and integrations
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## Author
|
|
133
|
+
|
|
134
|
+
Anish Sethi
|
|
135
|
+
B.Tech Computer Science & Engineering
|
|
136
|
+
Delhi Technological University (Class of 2029)
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## License
|
|
141
|
+
|
|
142
|
+
This project is licensed under the BSD 3-Clause License.
|
|
143
|
+
Visit the [BSD 3-Clause License page](https://opensource.org/license/bsd-3-clause) for more information.
|
|
@@ -1,14 +1,28 @@
|
|
|
1
1
|
#config options for pydbms
|
|
2
|
-
#NOTE: If config.json file generated by the program is deleted or
|
|
2
|
+
#NOTE: If config.json file generated by the program is deleted or currupted, it will safely restore to defaults.
|
|
3
3
|
|
|
4
4
|
from .pydbms_path import pydbms_path
|
|
5
5
|
from .dependencies import json, os, copy
|
|
6
6
|
|
|
7
|
+
DEFAULT_SESSION_CONFIG = {
|
|
8
|
+
"wrap_line": True,
|
|
9
|
+
|
|
10
|
+
"wrap_line_dict": {
|
|
11
|
+
True: "ellipsis",
|
|
12
|
+
False: "fold"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
SESSION_CONFIG = copy.deepcopy(DEFAULT_SESSION_CONFIG)
|
|
17
|
+
|
|
7
18
|
DEFAULT_CONFIG = {
|
|
8
19
|
"config_version": 1,
|
|
20
|
+
|
|
9
21
|
"ui": {
|
|
10
22
|
"show_banner": True,
|
|
23
|
+
"max_rows": None,
|
|
11
24
|
},
|
|
25
|
+
|
|
12
26
|
"mysql": {
|
|
13
27
|
"host": "localhost",
|
|
14
28
|
"port": 3306,
|
|
@@ -24,7 +38,7 @@ def create_config() -> None:
|
|
|
24
38
|
with open(path, "w") as f:
|
|
25
39
|
json.dump(DEFAULT_CONFIG, f, indent=4)
|
|
26
40
|
|
|
27
|
-
def validate_config_types() ->
|
|
41
|
+
def validate_config_types() -> dict:
|
|
28
42
|
cfg = load_config()
|
|
29
43
|
changed=False
|
|
30
44
|
|
|
@@ -2,32 +2,41 @@
|
|
|
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.
|
|
5
|
+
Version - 2.5.0
|
|
6
6
|
Release - Stable
|
|
7
7
|
'''
|
|
8
8
|
|
|
9
9
|
from .Global import Print, console, config
|
|
10
|
-
from .dependencies import pyfiglet, Text, Table, Align, Rule, Panel, mysql, sys
|
|
10
|
+
from .dependencies import pyfiglet, Text, Table, Align, Rule, Panel, mysql, sys, Group
|
|
11
11
|
from .pydbms_mysql import execute, execute_change, execute_select, connect, get_query_mysql
|
|
12
|
-
from .config import parse_query_config, coerce_value_config, save_config, get_default_value_config, validate_config_types
|
|
12
|
+
from .config import parse_query_config, coerce_value_config, save_config, get_default_value_config, validate_config_types, DEFAULT_SESSION_CONFIG, SESSION_CONFIG
|
|
13
|
+
|
|
14
|
+
QUERY_HANDLERS = {
|
|
15
|
+
"select": execute_select,
|
|
16
|
+
"change": execute_change,
|
|
17
|
+
"ddl": execute_change,
|
|
18
|
+
"other": execute,
|
|
19
|
+
}
|
|
13
20
|
|
|
14
21
|
def print_banner() -> None:
|
|
15
22
|
ascii_art = pyfiglet.figlet_format("PY DBMS", font="slant").rstrip()
|
|
16
23
|
|
|
17
24
|
logo = Text(ascii_art, style="bold color(57)")
|
|
18
25
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
banner_table = Table(show_header=False, box=None, expand=True)
|
|
27
|
+
banner_table.add_column("1", justify="center", ratio=1)
|
|
28
|
+
banner_table.add_column("2", justify="center", ratio=1)
|
|
29
|
+
banner_table.add_column("3", justify="center", ratio=1)
|
|
30
|
+
banner_table.add_column("4", justify="center", ratio=1)
|
|
31
|
+
|
|
32
|
+
banner_table.add_row(
|
|
33
|
+
"[bold cyan]v2.5.0[/]\n [bold white]Version[/]",
|
|
26
34
|
"[bold yellow]MySQL[/]\n[bold white]Currently Supported[/]",
|
|
27
|
-
"[bold green]Online since 2025[/]\n[bold white]Status[/]"
|
|
35
|
+
"[bold green]Online since 2025[/]\n[bold white]Status[/]",
|
|
36
|
+
"[bold magenta]Stable[/]\n[bold white]Release[/]"
|
|
28
37
|
)
|
|
29
38
|
|
|
30
|
-
author = Text("Anish Sethi • Delhi Technological University", style="bright_white")
|
|
39
|
+
author = Text("Anish Sethi • Delhi Technological University • Class of 2029", style="bright_white")
|
|
31
40
|
|
|
32
41
|
License = Text("Licensed Under BSD-3-Clause License (see .version for more info)", style="dim white")
|
|
33
42
|
|
|
@@ -36,20 +45,19 @@ def print_banner() -> None:
|
|
|
36
45
|
Text("\n"),
|
|
37
46
|
Rule(style="dim purple"),
|
|
38
47
|
Text("\n"),
|
|
39
|
-
|
|
48
|
+
banner_table,
|
|
40
49
|
Text("\n"),
|
|
41
50
|
Align(author, align="center"),
|
|
42
51
|
Align(License, align="center"),
|
|
43
52
|
]
|
|
44
53
|
|
|
45
|
-
from rich.console import Group
|
|
46
54
|
panel_content = Group(*content)
|
|
47
55
|
|
|
48
56
|
console.print(
|
|
49
57
|
Panel(
|
|
50
58
|
panel_content,
|
|
51
59
|
border_style="color(57)",
|
|
52
|
-
title="[bold white]
|
|
60
|
+
title="[bold white] PYDBMS TERMINAL [/]",
|
|
53
61
|
title_align="center",
|
|
54
62
|
padding=(1, 2),
|
|
55
63
|
expand=True
|
|
@@ -59,7 +67,7 @@ def print_banner() -> None:
|
|
|
59
67
|
|
|
60
68
|
def build_section_table(section: dict) -> Table:
|
|
61
69
|
table = Table(show_header=False, box=None)
|
|
62
|
-
table.add_column("", style="white",
|
|
70
|
+
table.add_column("", style="white", overflow="ellipsis")
|
|
63
71
|
table.add_column("", style="dim white")
|
|
64
72
|
for key, value in section.items():
|
|
65
73
|
table.add_row(key, str(value))
|
|
@@ -71,9 +79,9 @@ def meta(cmd: str, cur: object, con=None) -> None:
|
|
|
71
79
|
|
|
72
80
|
# .help
|
|
73
81
|
if cmd == ".help":
|
|
74
|
-
help_table = Table(title="Helper Commands", show_header=False,
|
|
75
|
-
help_table.add_column("Command",
|
|
76
|
-
help_table.add_column("Description", style="white",
|
|
82
|
+
help_table = Table(title="Helper Commands", show_header=False, border_style="bold magenta")
|
|
83
|
+
help_table.add_column("Command", overflow="ellipsis")
|
|
84
|
+
help_table.add_column("Description", style="white", overflow="ellipsis")
|
|
77
85
|
help_table.add_row(".help", "Show helper commands")
|
|
78
86
|
help_table.add_row(".databases", "Show databases in current connection")
|
|
79
87
|
help_table.add_row(".tables", "Show tables in current database")
|
|
@@ -83,9 +91,20 @@ def meta(cmd: str, cur: object, con=None) -> None:
|
|
|
83
91
|
help_table.add_row(".config", "Show config settings for pydbms")
|
|
84
92
|
help_table.add_row(".config set <section>.<key> <value>", "Set config to a new value")
|
|
85
93
|
help_table.add_row(".config reset <section>.<key>", "Reset config to a default value")
|
|
94
|
+
help_table.add_row(".session-config", "Show session config settings for pydbms (Resets on every run)")
|
|
95
|
+
help_table.add_row(".session-config set <key> <value>", "Set session config to a new value")
|
|
96
|
+
help_table.add_row(".session-config reset <key>", "Reset session config to a default value")
|
|
86
97
|
help_table.add_row(".exit", "Exit pydbms")
|
|
87
98
|
console.print(help_table)
|
|
88
99
|
console.print()
|
|
100
|
+
|
|
101
|
+
console.print()
|
|
102
|
+
help_table = Table(title="Helper Flags", show_header=False, border_style="bold magenta")
|
|
103
|
+
help_table.add_column("Flag Usage", overflow="ellipsis")
|
|
104
|
+
help_table.add_column("Description", style="white", overflow="ellipsis")
|
|
105
|
+
help_table.add_row("--expand", "Show full cell value without wrap")
|
|
106
|
+
console.print(help_table)
|
|
107
|
+
console.print()
|
|
89
108
|
return
|
|
90
109
|
|
|
91
110
|
# .databases
|
|
@@ -134,11 +153,11 @@ def meta(cmd: str, cur: object, con=None) -> None:
|
|
|
134
153
|
if cmd == ".version":
|
|
135
154
|
console.print()
|
|
136
155
|
info = Table(show_header=False, box=None)
|
|
137
|
-
info.add_column("", style="white",
|
|
156
|
+
info.add_column("", style="white", overflow="ellipsis")
|
|
138
157
|
info.add_column("", style="dim white")
|
|
139
158
|
|
|
140
159
|
info.add_row("Name", "[link=https://github.com/Anish-Sethi-12122/py-dbms-cli]pydbms Terminal[/link]")
|
|
141
|
-
info.add_row("Version", "v2.
|
|
160
|
+
info.add_row("Version", "v2.5.0")
|
|
142
161
|
info.add_row("Build", "Stable Release")
|
|
143
162
|
info.add_row("Python", f"[link=https://www.python.org/]{sys.version.split()[0]}[/link]")
|
|
144
163
|
info.add_row("MySQL", f"[link=https://www.mysql.com/]{con.get_server_info()}[/link]")
|
|
@@ -149,20 +168,21 @@ def meta(cmd: str, cur: object, con=None) -> None:
|
|
|
149
168
|
console.print(
|
|
150
169
|
Panel(
|
|
151
170
|
info,
|
|
152
|
-
title="[bold white]
|
|
171
|
+
title="[bold white]PYDBMS Terminal — Build Info[/]",
|
|
153
172
|
border_style="bright_magenta",
|
|
154
173
|
padding=(1, 2),
|
|
155
174
|
)
|
|
156
175
|
)
|
|
157
176
|
console.print()
|
|
158
|
-
console.print("Run `pip install -U py-dbms-cli` in terminal to check for updates
|
|
177
|
+
console.print("Run `pip install -U py-dbms-cli` in terminal to check for updates.\n\n",style="dim white")
|
|
178
|
+
console.print("NOTE: Run `pip install --upgrade py-dbms-cli` in terminal directly to install the latest version.\n",style="dim white")
|
|
159
179
|
console.print()
|
|
160
180
|
return
|
|
161
181
|
|
|
162
182
|
# .config
|
|
163
183
|
if cmd == ".config":
|
|
164
184
|
outer = Table(show_header=False, box=None)
|
|
165
|
-
outer.add_column("", style="bold white",
|
|
185
|
+
outer.add_column("", style="bold white", overflow="ellipsis")
|
|
166
186
|
outer.add_column("", style="white")
|
|
167
187
|
|
|
168
188
|
# UI section
|
|
@@ -178,7 +198,7 @@ def meta(cmd: str, cur: object, con=None) -> None:
|
|
|
178
198
|
console.print(
|
|
179
199
|
Panel(
|
|
180
200
|
outer,
|
|
181
|
-
title="[bold white]
|
|
201
|
+
title="[bold white]PYDBMS Terminal — config settings[/]",
|
|
182
202
|
border_style="bright_magenta",
|
|
183
203
|
padding=(1, 2),
|
|
184
204
|
)
|
|
@@ -192,6 +212,7 @@ def meta(cmd: str, cur: object, con=None) -> None:
|
|
|
192
212
|
parts = cmd.split(maxsplit=3)
|
|
193
213
|
|
|
194
214
|
if len(parts) != 4:
|
|
215
|
+
Print("Invalid input format.\n", "RED")
|
|
195
216
|
Print("Usage: .config set <section>.<key> <value>", "YELLOW")
|
|
196
217
|
console.print()
|
|
197
218
|
return
|
|
@@ -222,11 +243,12 @@ def meta(cmd: str, cur: object, con=None) -> None:
|
|
|
222
243
|
console.print()
|
|
223
244
|
return
|
|
224
245
|
|
|
225
|
-
# .config reset
|
|
246
|
+
# .config reset
|
|
226
247
|
if cmd.startswith(".config reset"):
|
|
227
248
|
parts = cmd.split(maxsplit=2)
|
|
228
249
|
|
|
229
250
|
if len(parts) != 3:
|
|
251
|
+
Print("Invalid config key format.\n", "RED")
|
|
230
252
|
Print("Usage: .config reset <section>.<key>", "YELLOW")
|
|
231
253
|
console.print()
|
|
232
254
|
return
|
|
@@ -255,6 +277,73 @@ def meta(cmd: str, cur: object, con=None) -> None:
|
|
|
255
277
|
Print(f"Reset {path} → {default}", "GREEN")
|
|
256
278
|
console.print()
|
|
257
279
|
return
|
|
280
|
+
|
|
281
|
+
# .session-config
|
|
282
|
+
if cmd == ".session-config":
|
|
283
|
+
outer = Table(show_header=False, box=None)
|
|
284
|
+
outer.add_column("", style="white", overflow="ellipsis")
|
|
285
|
+
|
|
286
|
+
outer.add_row(build_section_table(SESSION_CONFIG))
|
|
287
|
+
|
|
288
|
+
console.print(
|
|
289
|
+
Panel(
|
|
290
|
+
outer,
|
|
291
|
+
title="[bold white]PYDBMS Terminal — Configuration Settings for Current Session[/]",
|
|
292
|
+
border_style="bright_magenta",
|
|
293
|
+
padding=(1, 2),
|
|
294
|
+
)
|
|
295
|
+
)
|
|
296
|
+
|
|
297
|
+
console.print()
|
|
298
|
+
return
|
|
299
|
+
|
|
300
|
+
# .session-config set
|
|
301
|
+
if cmd.startswith(".session-config set"):
|
|
302
|
+
parts = cmd.split(maxsplit=3)
|
|
303
|
+
|
|
304
|
+
if len(parts) != 4:
|
|
305
|
+
Print("Invalid input format.\n", "RED")
|
|
306
|
+
Print("Usage: .session-config set <key> <value>\n", "YELLOW")
|
|
307
|
+
console.print()
|
|
308
|
+
return
|
|
309
|
+
|
|
310
|
+
_, _, key, raw_value = parts
|
|
311
|
+
key = key.lower()
|
|
312
|
+
|
|
313
|
+
if key not in SESSION_CONFIG:
|
|
314
|
+
Print(f"Unknown session config key: {key}", "RED")
|
|
315
|
+
console.print()
|
|
316
|
+
return
|
|
317
|
+
|
|
318
|
+
value = coerce_value_config(raw_value)
|
|
319
|
+
SESSION_CONFIG[key] = value
|
|
320
|
+
|
|
321
|
+
Print(f"Updated session-config {key} → {value}", "GREEN")
|
|
322
|
+
console.print()
|
|
323
|
+
return
|
|
324
|
+
|
|
325
|
+
# .session-config reset
|
|
326
|
+
if cmd.startswith(".session-config reset"):
|
|
327
|
+
parts = cmd.split(maxsplit=2)
|
|
328
|
+
|
|
329
|
+
if len(parts) != 3:
|
|
330
|
+
Print("Invalid input format.\n", "RED")
|
|
331
|
+
Print("Usage: .session-config reset <key>\n", "YELLOW")
|
|
332
|
+
console.print()
|
|
333
|
+
return
|
|
334
|
+
|
|
335
|
+
key = parts[2].lower()
|
|
336
|
+
|
|
337
|
+
if key not in DEFAULT_SESSION_CONFIG:
|
|
338
|
+
Print(f"Unknown session config key: {key}", "RED")
|
|
339
|
+
console.print()
|
|
340
|
+
return
|
|
341
|
+
|
|
342
|
+
SESSION_CONFIG[key] = DEFAULT_SESSION_CONFIG[key]
|
|
343
|
+
|
|
344
|
+
Print(f"Reset session-config {key} → {DEFAULT_SESSION_CONFIG[key]}", "GREEN")
|
|
345
|
+
console.print()
|
|
346
|
+
return
|
|
258
347
|
|
|
259
348
|
# .exit
|
|
260
349
|
if cmd == ".exit":
|
|
@@ -265,6 +354,23 @@ def meta(cmd: str, cur: object, con=None) -> None:
|
|
|
265
354
|
Print(f"Unknown command: {cmd}\nRefer to `.help` for list of commands", "YELLOW")
|
|
266
355
|
console.print()
|
|
267
356
|
|
|
357
|
+
def classify_query(query: str) -> str:
|
|
358
|
+
q = query.strip().lower()
|
|
359
|
+
|
|
360
|
+
if q.startswith("."):
|
|
361
|
+
return "meta"
|
|
362
|
+
|
|
363
|
+
if q.startswith(("select", "with", "show", "desc", "describe", "explain")):
|
|
364
|
+
return "select"
|
|
365
|
+
|
|
366
|
+
if q.startswith(("insert", "update", "delete")):
|
|
367
|
+
return "change"
|
|
368
|
+
|
|
369
|
+
if q.startswith(("create", "drop", "alter", "truncate")):
|
|
370
|
+
return "ddl"
|
|
371
|
+
|
|
372
|
+
return "other"
|
|
373
|
+
|
|
268
374
|
def main():
|
|
269
375
|
global config
|
|
270
376
|
config = validate_config_types()
|
|
@@ -279,34 +385,28 @@ def main():
|
|
|
279
385
|
meta(".help",cur)
|
|
280
386
|
|
|
281
387
|
while True:
|
|
282
|
-
query=get_query_mysql()
|
|
283
|
-
|
|
284
|
-
if query.
|
|
285
|
-
meta(query.strip(), cur, con)
|
|
286
|
-
continue
|
|
287
|
-
|
|
288
|
-
if query.lower().strip()=="exit;":
|
|
388
|
+
query = get_query_mysql()
|
|
389
|
+
|
|
390
|
+
if query.lower().strip() == "exit;":
|
|
289
391
|
Print("Session Terminated.", "RED", "bold")
|
|
290
392
|
sys.exit()
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
393
|
+
|
|
394
|
+
query_type = classify_query(query)
|
|
395
|
+
|
|
396
|
+
if query_type == "meta":
|
|
397
|
+
meta(query.strip(), cur, con)
|
|
398
|
+
continue
|
|
399
|
+
|
|
400
|
+
query_handle = QUERY_HANDLERS.get(query_type, execute)
|
|
401
|
+
|
|
402
|
+
try:
|
|
403
|
+
if query_handle is execute_change:
|
|
404
|
+
query_handle(query, con, cur)
|
|
405
|
+
else:
|
|
406
|
+
query_handle(query, cur)
|
|
304
407
|
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
execute(query,cur)
|
|
308
|
-
except mysql.Error as err:
|
|
309
|
-
console.print(f"{err.msg}",style="bold red")
|
|
408
|
+
except mysql.Error as err:
|
|
409
|
+
console.print(f"{err.msg}", style="bold red")
|
|
310
410
|
|
|
311
411
|
if __name__=="__main__":
|
|
312
412
|
main()
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#Dependencies imports
|
|
2
|
+
|
|
3
|
+
import mysql.connector as mysql, sqlparse, pwinput, time, sys, pyfiglet, re, os, json, copy
|
|
4
|
+
from rich.console import Console, Group
|
|
5
|
+
from rich.text import Text
|
|
6
|
+
from rich.panel import Panel
|
|
7
|
+
from rich import box
|
|
8
|
+
from rich.table import Table
|
|
9
|
+
from rich.align import Align
|
|
10
|
+
from rich.rule import Rule
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from .dependencies import mysql, pwinput, sys, time, sqlparse, Panel, Table, re, box
|
|
4
4
|
from .Global import Print, console, config
|
|
5
|
+
from .config import SESSION_CONFIG
|
|
5
6
|
|
|
6
7
|
def connect() -> tuple[object,object] | int:
|
|
7
8
|
try:
|
|
@@ -40,10 +41,15 @@ def print_warnings(cur: object) -> bool:
|
|
|
40
41
|
return False
|
|
41
42
|
|
|
42
43
|
def execute_select(query: str,cur: object) -> None:
|
|
43
|
-
start = time.
|
|
44
|
+
start = time.perf_counter()
|
|
44
45
|
cur.execute(query)
|
|
45
|
-
end = time.
|
|
46
|
-
|
|
46
|
+
end = time.perf_counter()
|
|
47
|
+
|
|
48
|
+
if config["ui"]["max_rows"] is None:
|
|
49
|
+
result=cur.fetchall()
|
|
50
|
+
else:
|
|
51
|
+
result=cur.fetchmany(config["ui"]["max_rows"])
|
|
52
|
+
|
|
47
53
|
num_rows=len(result)
|
|
48
54
|
columns = [desc[0] for desc in cur.description]
|
|
49
55
|
console.print()
|
|
@@ -51,7 +57,7 @@ def execute_select(query: str,cur: object) -> None:
|
|
|
51
57
|
result_table = Table(show_header=True, box=box.SIMPLE_HEAVY, padding=(0,1))
|
|
52
58
|
|
|
53
59
|
for i in columns:
|
|
54
|
-
result_table.add_column(i, style="white",
|
|
60
|
+
result_table.add_column(i, style="white", overflow=SESSION_CONFIG["wrap_line_dict"].get(SESSION_CONFIG["wrap_line"]))
|
|
55
61
|
|
|
56
62
|
for row in result:
|
|
57
63
|
row_row = []
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "py-dbms-cli"
|
|
7
|
-
version = "2.
|
|
7
|
+
version = "2.5.0"
|
|
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" }
|
py_dbms_cli-2.1.2/PKG-INFO
DELETED
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: py-dbms-cli
|
|
3
|
-
Version: 2.1.2
|
|
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
|
-
Author-email: Anish Sethi <sethi.dynasty123@gmail.com>
|
|
6
|
-
License: Copyright 2025 Anish Sethi
|
|
7
|
-
|
|
8
|
-
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
9
|
-
|
|
10
|
-
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
11
|
-
|
|
12
|
-
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
13
|
-
|
|
14
|
-
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
|
15
|
-
|
|
16
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
17
|
-
Project-URL: Homepage, https://github.com/Anish-Sethi-12122/py-dbms-cli
|
|
18
|
-
Project-URL: Source, https://github.com/Anish-Sethi-12122/py-dbms-cli
|
|
19
|
-
Project-URL: Issues, https://github.com/Anish-Sethi-12122/py-dbms-cli/issues
|
|
20
|
-
Requires-Python: >=3.10
|
|
21
|
-
Description-Content-Type: text/markdown
|
|
22
|
-
License-File: LICENSE
|
|
23
|
-
Requires-Dist: mysql-connector-python
|
|
24
|
-
Requires-Dist: rich
|
|
25
|
-
Requires-Dist: pyfiglet
|
|
26
|
-
Requires-Dist: sqlparse
|
|
27
|
-
Requires-Dist: pwinput
|
|
28
|
-
Dynamic: license-file
|
|
29
|
-
|
|
30
|
-
**STABLE RELEASE**
|
|
31
|
-
### v2.1.2
|
|
32
|
-
|
|
33
|
-
PY DBMS — A Modern, Secure, All-in-One DBMS CLI Client
|
|
34
|
-
|
|
35
|
-
PY DBMS is a lightweight, secure, and modern command-line database client built using Python.
|
|
36
|
-
It provides a clean user experience, readable output formatting, and convenient helper commands while connecting to MySQL.
|
|
37
|
-
|
|
38
|
-
This tool is designed for developers who prefer the terminal but want a more enhanced experience than the default MySQL CLI.
|
|
39
|
-
|
|
40
|
-
Features
|
|
41
|
-
Visual & UI
|
|
42
|
-
|
|
43
|
-
Rich-based terminal interface for clean, formatted output
|
|
44
|
-
|
|
45
|
-
Typewriter-style text rendering
|
|
46
|
-
|
|
47
|
-
ASCII banner and structured dashboard
|
|
48
|
-
|
|
49
|
-
Tabular display for query results
|
|
50
|
-
|
|
51
|
-
Password masking during login
|
|
52
|
-
|
|
53
|
-
Functional
|
|
54
|
-
|
|
55
|
-
Multi-line SQL query support
|
|
56
|
-
|
|
57
|
-
Built-in meta commands (.help, .tables, .schema, .version, etc.)
|
|
58
|
-
|
|
59
|
-
Execution time for SELECT queries
|
|
60
|
-
|
|
61
|
-
Graceful error handling (no session crashes)
|
|
62
|
-
|
|
63
|
-
Security
|
|
64
|
-
|
|
65
|
-
Secure password input using masked characters
|
|
66
|
-
|
|
67
|
-
Localhost defaults for safe development usage
|
|
68
|
-
|
|
69
|
-
Installation
|
|
70
|
-
|
|
71
|
-
Prerequisites
|
|
72
|
-
|
|
73
|
-
Python (3.10 or newer recommended)
|
|
74
|
-
|
|
75
|
-
A running MySQL Server
|
|
76
|
-
|
|
77
|
-
Install using pip:
|
|
78
|
-
|
|
79
|
-
pip install py-dbms-cli
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
All required dependencies are installed automatically.
|
|
83
|
-
|
|
84
|
-
Usage
|
|
85
|
-
|
|
86
|
-
1. Start the CLI
|
|
87
|
-
pydbms
|
|
88
|
-
|
|
89
|
-
2. Enter MySQL login credentials
|
|
90
|
-
|
|
91
|
-
You will be prompted for:
|
|
92
|
-
|
|
93
|
-
Host
|
|
94
|
-
|
|
95
|
-
Username
|
|
96
|
-
|
|
97
|
-
Password (masked using *)
|
|
98
|
-
|
|
99
|
-
3. Begin querying
|
|
100
|
-
|
|
101
|
-
Enter SQL commands as you normally would. The client supports multi-line queries and executes them once terminated with a ;.
|
|
102
|
-
|
|
103
|
-
Query Support
|
|
104
|
-
|
|
105
|
-
Standard SQL queries
|
|
106
|
-
|
|
107
|
-
Multi-line input
|
|
108
|
-
|
|
109
|
-
Separate behaviors for SELECT vs UPDATE/INSERT
|
|
110
|
-
|
|
111
|
-
MySQL-style syntax
|
|
112
|
-
|
|
113
|
-
Meta Commands
|
|
114
|
-
|
|
115
|
-
The tool includes additional helper commands:
|
|
116
|
-
|
|
117
|
-
Command Description
|
|
118
|
-
.help Show all helper commands
|
|
119
|
-
.databases List all databases
|
|
120
|
-
.tables List tables in the current database
|
|
121
|
-
.schema <table> Show CREATE TABLE definition
|
|
122
|
-
.clear Clear the screen
|
|
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
|
|
127
|
-
.exit Exit the CLI
|
|
128
|
-
|
|
129
|
-
Roadmap
|
|
130
|
-
|
|
131
|
-
Future planned features include:
|
|
132
|
-
|
|
133
|
-
User profile support with encrypted JSON storage
|
|
134
|
-
|
|
135
|
-
Support for additional database engines (Oracle, MongoDB, etc.)
|
|
136
|
-
|
|
137
|
-
Consistent UI formatting across engines
|
|
138
|
-
|
|
139
|
-
Exportable session history
|
|
140
|
-
|
|
141
|
-
Customizable UI themes
|
|
142
|
-
|
|
143
|
-
Author
|
|
144
|
-
|
|
145
|
-
Anish Sethi
|
|
146
|
-
B.Tech Computer Science & Engineering
|
|
147
|
-
Delhi Technological University (Class of 2029)
|
|
148
|
-
|
|
149
|
-
License
|
|
150
|
-
|
|
151
|
-
This project is licensed under the BSD 3-Clause License.
|
py_dbms_cli-2.1.2/README.md
DELETED
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
**STABLE RELEASE**
|
|
2
|
-
### v2.1.2
|
|
3
|
-
|
|
4
|
-
PY DBMS — A Modern, Secure, All-in-One DBMS CLI Client
|
|
5
|
-
|
|
6
|
-
PY DBMS is a lightweight, secure, and modern command-line database client built using Python.
|
|
7
|
-
It provides a clean user experience, readable output formatting, and convenient helper commands while connecting to MySQL.
|
|
8
|
-
|
|
9
|
-
This tool is designed for developers who prefer the terminal but want a more enhanced experience than the default MySQL CLI.
|
|
10
|
-
|
|
11
|
-
Features
|
|
12
|
-
Visual & UI
|
|
13
|
-
|
|
14
|
-
Rich-based terminal interface for clean, formatted output
|
|
15
|
-
|
|
16
|
-
Typewriter-style text rendering
|
|
17
|
-
|
|
18
|
-
ASCII banner and structured dashboard
|
|
19
|
-
|
|
20
|
-
Tabular display for query results
|
|
21
|
-
|
|
22
|
-
Password masking during login
|
|
23
|
-
|
|
24
|
-
Functional
|
|
25
|
-
|
|
26
|
-
Multi-line SQL query support
|
|
27
|
-
|
|
28
|
-
Built-in meta commands (.help, .tables, .schema, .version, etc.)
|
|
29
|
-
|
|
30
|
-
Execution time for SELECT queries
|
|
31
|
-
|
|
32
|
-
Graceful error handling (no session crashes)
|
|
33
|
-
|
|
34
|
-
Security
|
|
35
|
-
|
|
36
|
-
Secure password input using masked characters
|
|
37
|
-
|
|
38
|
-
Localhost defaults for safe development usage
|
|
39
|
-
|
|
40
|
-
Installation
|
|
41
|
-
|
|
42
|
-
Prerequisites
|
|
43
|
-
|
|
44
|
-
Python (3.10 or newer recommended)
|
|
45
|
-
|
|
46
|
-
A running MySQL Server
|
|
47
|
-
|
|
48
|
-
Install using pip:
|
|
49
|
-
|
|
50
|
-
pip install py-dbms-cli
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
All required dependencies are installed automatically.
|
|
54
|
-
|
|
55
|
-
Usage
|
|
56
|
-
|
|
57
|
-
1. Start the CLI
|
|
58
|
-
pydbms
|
|
59
|
-
|
|
60
|
-
2. Enter MySQL login credentials
|
|
61
|
-
|
|
62
|
-
You will be prompted for:
|
|
63
|
-
|
|
64
|
-
Host
|
|
65
|
-
|
|
66
|
-
Username
|
|
67
|
-
|
|
68
|
-
Password (masked using *)
|
|
69
|
-
|
|
70
|
-
3. Begin querying
|
|
71
|
-
|
|
72
|
-
Enter SQL commands as you normally would. The client supports multi-line queries and executes them once terminated with a ;.
|
|
73
|
-
|
|
74
|
-
Query Support
|
|
75
|
-
|
|
76
|
-
Standard SQL queries
|
|
77
|
-
|
|
78
|
-
Multi-line input
|
|
79
|
-
|
|
80
|
-
Separate behaviors for SELECT vs UPDATE/INSERT
|
|
81
|
-
|
|
82
|
-
MySQL-style syntax
|
|
83
|
-
|
|
84
|
-
Meta Commands
|
|
85
|
-
|
|
86
|
-
The tool includes additional helper commands:
|
|
87
|
-
|
|
88
|
-
Command Description
|
|
89
|
-
.help Show all helper commands
|
|
90
|
-
.databases List all databases
|
|
91
|
-
.tables List tables in the current database
|
|
92
|
-
.schema <table> Show CREATE TABLE definition
|
|
93
|
-
.clear Clear the screen
|
|
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
|
|
98
|
-
.exit Exit the CLI
|
|
99
|
-
|
|
100
|
-
Roadmap
|
|
101
|
-
|
|
102
|
-
Future planned features include:
|
|
103
|
-
|
|
104
|
-
User profile support with encrypted JSON storage
|
|
105
|
-
|
|
106
|
-
Support for additional database engines (Oracle, MongoDB, etc.)
|
|
107
|
-
|
|
108
|
-
Consistent UI formatting across engines
|
|
109
|
-
|
|
110
|
-
Exportable session history
|
|
111
|
-
|
|
112
|
-
Customizable UI themes
|
|
113
|
-
|
|
114
|
-
Author
|
|
115
|
-
|
|
116
|
-
Anish Sethi
|
|
117
|
-
B.Tech Computer Science & Engineering
|
|
118
|
-
Delhi Technological University (Class of 2029)
|
|
119
|
-
|
|
120
|
-
License
|
|
121
|
-
|
|
122
|
-
This project is licensed under the BSD 3-Clause License.
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: py-dbms-cli
|
|
3
|
-
Version: 2.1.2
|
|
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
|
-
Author-email: Anish Sethi <sethi.dynasty123@gmail.com>
|
|
6
|
-
License: Copyright 2025 Anish Sethi
|
|
7
|
-
|
|
8
|
-
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
9
|
-
|
|
10
|
-
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
11
|
-
|
|
12
|
-
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
13
|
-
|
|
14
|
-
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
|
15
|
-
|
|
16
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
17
|
-
Project-URL: Homepage, https://github.com/Anish-Sethi-12122/py-dbms-cli
|
|
18
|
-
Project-URL: Source, https://github.com/Anish-Sethi-12122/py-dbms-cli
|
|
19
|
-
Project-URL: Issues, https://github.com/Anish-Sethi-12122/py-dbms-cli/issues
|
|
20
|
-
Requires-Python: >=3.10
|
|
21
|
-
Description-Content-Type: text/markdown
|
|
22
|
-
License-File: LICENSE
|
|
23
|
-
Requires-Dist: mysql-connector-python
|
|
24
|
-
Requires-Dist: rich
|
|
25
|
-
Requires-Dist: pyfiglet
|
|
26
|
-
Requires-Dist: sqlparse
|
|
27
|
-
Requires-Dist: pwinput
|
|
28
|
-
Dynamic: license-file
|
|
29
|
-
|
|
30
|
-
**STABLE RELEASE**
|
|
31
|
-
### v2.1.2
|
|
32
|
-
|
|
33
|
-
PY DBMS — A Modern, Secure, All-in-One DBMS CLI Client
|
|
34
|
-
|
|
35
|
-
PY DBMS is a lightweight, secure, and modern command-line database client built using Python.
|
|
36
|
-
It provides a clean user experience, readable output formatting, and convenient helper commands while connecting to MySQL.
|
|
37
|
-
|
|
38
|
-
This tool is designed for developers who prefer the terminal but want a more enhanced experience than the default MySQL CLI.
|
|
39
|
-
|
|
40
|
-
Features
|
|
41
|
-
Visual & UI
|
|
42
|
-
|
|
43
|
-
Rich-based terminal interface for clean, formatted output
|
|
44
|
-
|
|
45
|
-
Typewriter-style text rendering
|
|
46
|
-
|
|
47
|
-
ASCII banner and structured dashboard
|
|
48
|
-
|
|
49
|
-
Tabular display for query results
|
|
50
|
-
|
|
51
|
-
Password masking during login
|
|
52
|
-
|
|
53
|
-
Functional
|
|
54
|
-
|
|
55
|
-
Multi-line SQL query support
|
|
56
|
-
|
|
57
|
-
Built-in meta commands (.help, .tables, .schema, .version, etc.)
|
|
58
|
-
|
|
59
|
-
Execution time for SELECT queries
|
|
60
|
-
|
|
61
|
-
Graceful error handling (no session crashes)
|
|
62
|
-
|
|
63
|
-
Security
|
|
64
|
-
|
|
65
|
-
Secure password input using masked characters
|
|
66
|
-
|
|
67
|
-
Localhost defaults for safe development usage
|
|
68
|
-
|
|
69
|
-
Installation
|
|
70
|
-
|
|
71
|
-
Prerequisites
|
|
72
|
-
|
|
73
|
-
Python (3.10 or newer recommended)
|
|
74
|
-
|
|
75
|
-
A running MySQL Server
|
|
76
|
-
|
|
77
|
-
Install using pip:
|
|
78
|
-
|
|
79
|
-
pip install py-dbms-cli
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
All required dependencies are installed automatically.
|
|
83
|
-
|
|
84
|
-
Usage
|
|
85
|
-
|
|
86
|
-
1. Start the CLI
|
|
87
|
-
pydbms
|
|
88
|
-
|
|
89
|
-
2. Enter MySQL login credentials
|
|
90
|
-
|
|
91
|
-
You will be prompted for:
|
|
92
|
-
|
|
93
|
-
Host
|
|
94
|
-
|
|
95
|
-
Username
|
|
96
|
-
|
|
97
|
-
Password (masked using *)
|
|
98
|
-
|
|
99
|
-
3. Begin querying
|
|
100
|
-
|
|
101
|
-
Enter SQL commands as you normally would. The client supports multi-line queries and executes them once terminated with a ;.
|
|
102
|
-
|
|
103
|
-
Query Support
|
|
104
|
-
|
|
105
|
-
Standard SQL queries
|
|
106
|
-
|
|
107
|
-
Multi-line input
|
|
108
|
-
|
|
109
|
-
Separate behaviors for SELECT vs UPDATE/INSERT
|
|
110
|
-
|
|
111
|
-
MySQL-style syntax
|
|
112
|
-
|
|
113
|
-
Meta Commands
|
|
114
|
-
|
|
115
|
-
The tool includes additional helper commands:
|
|
116
|
-
|
|
117
|
-
Command Description
|
|
118
|
-
.help Show all helper commands
|
|
119
|
-
.databases List all databases
|
|
120
|
-
.tables List tables in the current database
|
|
121
|
-
.schema <table> Show CREATE TABLE definition
|
|
122
|
-
.clear Clear the screen
|
|
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
|
|
127
|
-
.exit Exit the CLI
|
|
128
|
-
|
|
129
|
-
Roadmap
|
|
130
|
-
|
|
131
|
-
Future planned features include:
|
|
132
|
-
|
|
133
|
-
User profile support with encrypted JSON storage
|
|
134
|
-
|
|
135
|
-
Support for additional database engines (Oracle, MongoDB, etc.)
|
|
136
|
-
|
|
137
|
-
Consistent UI formatting across engines
|
|
138
|
-
|
|
139
|
-
Exportable session history
|
|
140
|
-
|
|
141
|
-
Customizable UI themes
|
|
142
|
-
|
|
143
|
-
Author
|
|
144
|
-
|
|
145
|
-
Anish Sethi
|
|
146
|
-
B.Tech Computer Science & Engineering
|
|
147
|
-
Delhi Technological University (Class of 2029)
|
|
148
|
-
|
|
149
|
-
License
|
|
150
|
-
|
|
151
|
-
This project is licensed under the BSD 3-Clause License.
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
#Dependencies imports
|
|
2
|
-
|
|
3
|
-
import mysql.connector as mysql
|
|
4
|
-
import sqlparse
|
|
5
|
-
import pwinput
|
|
6
|
-
import time
|
|
7
|
-
import sys
|
|
8
|
-
from rich.console import Console
|
|
9
|
-
from rich.text import Text
|
|
10
|
-
from rich.panel import Panel
|
|
11
|
-
from rich import box
|
|
12
|
-
import pyfiglet
|
|
13
|
-
from rich.table import Table
|
|
14
|
-
from rich.align import Align
|
|
15
|
-
from rich.rule import Rule
|
|
16
|
-
import re
|
|
17
|
-
import os
|
|
18
|
-
import json
|
|
19
|
-
import copy
|
|
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
|