Skip to content

Commit 7d9d0b2

Browse files
committed
docs: update README with pdodb init as fastest way to start
- Add Quick Setup section with pdodb init wizard - Update 5-Minute Tutorial to mention pdodb init as fastest start - Update Quick Example section to highlight pdodb init - Add example output showing interactive wizard flow
1 parent 7ee6ed8 commit 7d9d0b2

File tree

1 file changed

+65
-2
lines changed

1 file changed

+65
-2
lines changed

README.md

Lines changed: 65 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,54 @@ composer require tommyknocker/pdo-database-class:^1.0
197197
composer require tommyknocker/pdo-database-class:dev-master
198198
```
199199

200+
### Quick Setup with `pdodb init`
201+
202+
**Fastest way to get started:** Use the interactive wizard to configure your project:
203+
204+
```bash
205+
vendor/bin/pdodb init
206+
```
207+
208+
The wizard will guide you through:
209+
- Database connection settings (MySQL, PostgreSQL, SQLite, MSSQL)
210+
- Configuration file format (`.env` or `config/db.php`)
211+
- Directory structure creation (migrations, models, repositories, services)
212+
- Connection testing
213+
- Advanced options (caching, table prefix, multiple connections)
214+
215+
**Example output:**
216+
```
217+
Welcome to PDOdb Project Initialization Wizard!
218+
219+
Database driver [1]:
220+
1) MySQL
221+
2) PostgreSQL
222+
3) SQLite
223+
4) MSSQL
224+
Select driver: 1
225+
226+
Database host [localhost]:
227+
Database port [3306]:
228+
Database name: myapp
229+
Username: root
230+
Password: ********
231+
232+
Testing connection... ✓ Connection successful!
233+
234+
Configuration format [1]:
235+
1) .env file
236+
2) config/db.php
237+
Select format: 1
238+
239+
Create directory structure? (y/n) [y]: y
240+
241+
✓ Configuration saved to .env
242+
✓ Directory structure created
243+
✓ Project initialized successfully!
244+
```
245+
246+
See [CLI Tools Documentation](documentation/05-advanced-features/21-cli-tools.md#project-initialization-pdodb-init) for more details.
247+
200248
---
201249

202250
## 📖 Documentation
@@ -272,7 +320,7 @@ If config file is missing, falls back to SQLite.
272320

273321
## Quick Example
274322

275-
**Get started in 30 seconds:**
323+
**Fastest start:** Run `vendor/bin/pdodb init` for interactive setup, or get started manually:
276324

277325
```php
278326
use tommyknocker\pdodb\PdoDb;
@@ -322,7 +370,22 @@ $db->find()
322370
composer require tommyknocker/pdo-database-class
323371
```
324372

325-
### Step 2: Connect
373+
### Step 2: Initialize Project (Fastest Start)
374+
375+
Use the interactive wizard to set up your project configuration:
376+
377+
```bash
378+
vendor/bin/pdodb init
379+
```
380+
381+
This will:
382+
- ✅ Create `.env` or `config/db.php` configuration file
383+
- ✅ Set up directory structure
384+
- ✅ Create directory structure (migrations, models, repositories, services)
385+
- ✅ Test database connection
386+
- ✅ Generate basic configuration
387+
388+
**Alternative:** Manual configuration (see [Configuration](#configuration) section)
326389

327390
```php
328391
use tommyknocker\pdodb\PdoDb;

0 commit comments

Comments
 (0)