|
| 1 | +--- |
| 2 | + |
| 3 | +# **SQL Database - Windows Setup Instructions** |
| 4 | + |
| 5 | +## **Description** |
| 6 | + |
| 7 | +The **SQL Database** project provides functionality to manage databases with an interactive command-line interface. It includes features for **automatic dependency installation**, making it easy to set up. |
| 8 | + |
| 9 | +However, if the automatic installation fails, you can follow the **manual setup instructions** below to ensure all dependencies are installed properly. |
| 10 | + |
| 11 | +--- |
| 12 | + |
| 13 | +## **1. Clone the Repository** |
| 14 | + |
| 15 | +To get started, first clone the repository from GitHub. |
| 16 | + |
| 17 | +### **Prerequisites** |
| 18 | + |
| 19 | +- **Git**: Ensure Git is installed on your system. If not, download and install it from [Git Downloads](https://git-scm.com/downloads). |
| 20 | + |
| 21 | +### **Clone the Repository** |
| 22 | + |
| 23 | +1. Open **Command Prompt (cmd)** or **PowerShell**. |
| 24 | +2. Run the following command to clone the repository: |
| 25 | + |
| 26 | + ```bash |
| 27 | + git clone https://github.com/mishra9759harshit/sqldatabase.git |
| 28 | + ``` |
| 29 | + |
| 30 | +3. Navigate to the project folder: |
| 31 | + |
| 32 | + ```bash |
| 33 | + cd sqldatabase |
| 34 | + ``` |
| 35 | + |
| 36 | +--- |
| 37 | + |
| 38 | +## **2. Install Dependencies** |
| 39 | + |
| 40 | +### **Automatic Installation (Recommended)** |
| 41 | + |
| 42 | +The project includes an **automatic dependency installer**. Simply run: |
| 43 | + |
| 44 | +```bash |
| 45 | +python run.py |
| 46 | +``` |
| 47 | + |
| 48 | +If the script detects missing dependencies, it will attempt to install them automatically. |
| 49 | + |
| 50 | +### **Manual Installation (If Automatic Installation Fails)** |
| 51 | + |
| 52 | +If the automatic installation fails, follow these steps: |
| 53 | + |
| 54 | +#### **Step 1: Install Python** |
| 55 | + |
| 56 | +1. Download and install **Python 3.6 or later** from the official [Python website](https://www.python.org/downloads/). |
| 57 | +2. During installation, **check the box to add Python to PATH**. |
| 58 | + |
| 59 | +#### **Step 2: Install Git** |
| 60 | + |
| 61 | +If you haven't installed **Git**, download and install it from [Git Downloads](https://git-scm.com/downloads). |
| 62 | + |
| 63 | +#### **Step 3: Install Required Python Dependencies** |
| 64 | + |
| 65 | +Run the following command to install the necessary Python packages: |
| 66 | + |
| 67 | +```bash |
| 68 | +pip install plotext rich requests pyreadline |
| 69 | +``` |
| 70 | + |
| 71 | +If you encounter errors with `readline`, install `pyreadline3` instead: |
| 72 | + |
| 73 | +```bash |
| 74 | +pip install pyreadline3 |
| 75 | +``` |
| 76 | + |
| 77 | +This will install: |
| 78 | +- **plotext** → For terminal-based plotting. |
| 79 | +- **rich** → For beautiful CLI text formatting, tables, and progress bars. |
| 80 | +- **requests** → For handling HTTP requests. |
| 81 | +- **pyreadline3** → A readline alternative for Windows. |
| 82 | + |
| 83 | +#### **Step 4: Verify Dependencies** |
| 84 | + |
| 85 | +To ensure everything is installed correctly, run: |
| 86 | + |
| 87 | +```bash |
| 88 | +pip freeze |
| 89 | +``` |
| 90 | + |
| 91 | +If you see all the required packages listed, you're good to go! |
| 92 | + |
| 93 | +--- |
| 94 | + |
| 95 | +## **3. Running `run.py` with Interactive Visuals** |
| 96 | + |
| 97 | +### **Step 1: Run the Script** |
| 98 | + |
| 99 | +1. Ensure you're inside the project folder. |
| 100 | +2. Run: |
| 101 | + |
| 102 | + ```bash |
| 103 | + python run.py |
| 104 | + ``` |
| 105 | + |
| 106 | +### **Step 2: Interacting with the Script** |
| 107 | + |
| 108 | +When running, the script provides **interactive features** like: |
| 109 | +- **Tables & Styled Outputs** using `rich.table`. |
| 110 | +- **Progress Bars & Animated Text**. |
| 111 | +- **ASCII-Based Plots** using `plotext`. |
| 112 | + |
| 113 | +You’ll see options in the terminal like: |
| 114 | + |
| 115 | +``` |
| 116 | +[bold cyan]Welcome to the Interactive SQL Database![/bold cyan] |
| 117 | +Please select an option: |
| 118 | +1. View Data |
| 119 | +2. Generate Plot |
| 120 | +3. Exit |
| 121 | +
|
| 122 | +[bold yellow]Enter your choice:[/bold yellow] |
| 123 | +``` |
| 124 | + |
| 125 | +--- |
| 126 | + |
| 127 | +## **4. Troubleshooting** |
| 128 | + |
| 129 | +### **Issue 1: `readline` Import Error on Windows** |
| 130 | +Try installing `pyreadline3` instead: |
| 131 | + |
| 132 | +```bash |
| 133 | +pip install pyreadline3 |
| 134 | +``` |
| 135 | + |
| 136 | +### **Issue 2: Missing Dependencies** |
| 137 | +Run: |
| 138 | + |
| 139 | +```bash |
| 140 | +pip install --upgrade plotext rich requests pyreadline3 |
| 141 | +``` |
| 142 | + |
| 143 | +### **Issue 3: Python Not Found in Terminal** |
| 144 | +Ensure Python is added to the **Windows PATH**. If not, reinstall Python and **check the "Add to PATH" option during installation**. |
| 145 | + |
| 146 | +--- |
| 147 | + |
| 148 | +## **4. Try SQL Database Graphical Version** 🎨 |
| 149 | + |
| 150 | +If you prefer a **GUI version**, try our **Graphical SQL Database Manager**! |
| 151 | + |
| 152 | +### 🌟 **[](https://github.com/mishra9759harshit/SQL-DATABASE)** |
| 153 | + |
| 154 | +🔹 **Easier navigation** |
| 155 | +🔹 **Visual database operations** |
| 156 | +🔹 **Drag-and-drop support** |
| 157 | + |
| 158 | +Click the badge above to visit the **GUI repository**! 🚀 |
| 159 | + |
| 160 | +--- |
| 161 | + |
| 162 | + |
| 163 | +## **6. License & Author** |
| 164 | + |
| 165 | +📌 **Developed by**: **Harshit Mishra** |
| 166 | +📜 **License**: See [LICENSE](LICENSE) |
| 167 | + |
| 168 | +--- |
| 169 | + |
| 170 | + |
0 commit comments