Update documentation files (README.md and claude.md) based on codebase analysis

This commit is contained in:
2026-01-31 00:33:25 +03:00
parent 73c63b5d86
commit 155b1ba9d0
2 changed files with 170 additions and 5 deletions

View File

@@ -44,6 +44,9 @@ Open http://localhost:8080 in your browser.
- Edit existing rows.
- Delete rows.
- Generic, schema-agnostic behavior using `information_schema`.
- CSV import/export functionality.
- Database backup using mysqldump.
- Foreign key relationship support.
---
@@ -75,6 +78,7 @@ project/
Db.php # PDO factory based on session credentials
MetaService.php # Schema/metadata from information_schema
DataService.php # Generic SELECT/INSERT/UPDATE/DELETE
BackupService.php # Database backup functionality using mysqldump
```
---
@@ -136,7 +140,7 @@ No database name is hardcoded: the app reads available schemas from `information
## Running the App (Development)
Use PHPs built-in web server and point it to the `public` directory:
Use PHP's built-in web server and point it to the `public` directory:
```bash
cd /path/to/mariadb-grid
@@ -163,7 +167,7 @@ http://localhost:8080/
3. If the connection succeeds:
- The left sidebar will show databases and tables as a tree.
4. Click any table:
- The central Tabulator grid will load the tables data.
- The central Tabulator grid will load the table's data.
- Column header filters allow you to filter per column.
- Pagination is handled server-side.
@@ -181,15 +185,24 @@ http://localhost:8080/
- Click **“Delete”**.
- Confirm the deletion.
> Updates and deletes are performed using the tables primary key.
> Updates and deletes are performed using the table's primary key.
> If there is no primary key, it is safer to treat the table as read-only.
### CSV Operations
- **Import CSV**: Use the import button to upload CSV files for bulk data insertion
- **Export CSV**: Use the export button to download table data as CSV files
### Backup Operations
- **Database Backup**: Use the backup functionality to create database dumps using mysqldump
---
## How It Works (High Level)
- On login, the app tests a connection to MariaDB using the supplied credentials and stores them in the session.
- For all subsequent API requests, PDO is created with these credentials, so MariaDBs own permissions control what the user can see and edit.
- For all subsequent API requests, PDO is created with these credentials, so MariaDB's own permissions control what the user can see and edit.
- `MetaService` queries `information_schema` to:
- Build the schema → tables tree.
- Load column definitions and detect the primary key.
@@ -223,4 +236,9 @@ http://localhost:8080/
- Verify `DB_HOST` and `DB_PORT` environment variables.
- Confirm credentials using `mysql` client or another tool.
- Check firewall and bind-address on the MariaDB server.
- If running in Docker, use host IP or `host.docker.internal` instead of `localhost`.
- If running in Docker, use host IP or `host.docker.internal` instead of `localhost`.
- **CSV import errors**
- Check that CSV files are properly formatted
- Ensure data types match the target table schema
- Review error messages for specific issues with rows or fields