Menu

Tree [349b9d] main /
 History

HTTPS access


File Date Author Commit
 src 2025-04-25 Dscho-Delphi Dscho-Delphi [974ade] Version 1.0.8 - Updates und Fixes
 .gitattributes 2025-04-24 Dscho-Delphi Dscho-Delphi [66ba8a] Add .gitattributes to exclude non-library files...
 .gitignore 2025-04-24 Dscho-Delphi Dscho-Delphi [52a42c] Füge .gitignore hinzu
 CHANGELOG.md 2025-04-24 Dscho-Delphi Dscho-Delphi [4391f9] Release 1.0.7 – Backup, Snackbar, Fahrzeug-Demo...
 LICENSE 2025-04-24 johannes-teitge johannes-teitge [58fc5f] Initial commit
 LICENSE.html 2025-04-14 Dscho-Delphi Dscho-Delphi [c93c5c] Initial commit with full project structure and ...
 README.md 2025-04-25 Dscho-Delphi Dscho-Delphi [349b9d] Aktualisierte README mit Komplett-Download-Link
 _README.md 2025-04-24 Dscho-Delphi Dscho-Delphi [ec3d53] Initial commit
 __composer.json 2025-04-25 Dscho-Delphi Dscho-Delphi [3de820] 🔧 Update: composer.json angepasst für Composer-...
 composer.json 2025-04-25 Dscho-Delphi Dscho-Delphi [15fdd5] Initial commit
 index.php 2025-04-14 Dscho-Delphi Dscho-Delphi [c93c5c] Initial commit with full project structure and ...

Read Me

🗂️ JsonSQL

JsonSQL ist eine moderne PHP-Bibliothek für SQL-ähnliche Abfragen auf JSON-Dateien.
Sie funktioniert komplett dateibasiert – ohne MySQL, SQLite oder Datenbankserver.

Latest Stable Version
License


✅ Vorteile

  • Kein Datenbankserver notwendig
  • Läuft überall, auch in Shared-Hosting & Offline-Apps
  • Vollständig in PHP geschrieben
  • SQL-ähnliche Syntax (select, where, groupBy, join, …)
  • Transaktionen, Verschlüsselung, Statistikfunktionen
  • Erweiterbar & verständlich – ideal für Prototypen, Tools & Adminpanels

🚀 Installation

Mit Composer installieren:

composer require teitge/jsonsql

Oder manuell einbinden:

require_once 'src/JsonSQL/JsonSQL.php';

⚡ Beispiel

use JsonSQL\JsonSQL;

$db = new JsonSQL([
    'path' => __DIR__ . '/data',
    'table' => 'users',
]);

$users = $db->select(['id', 'name'])
            ->where('age', '>=', 18)
            ->orderBy('name')
            ->get();

🧰 Features

Kategorie Details
Datenquelle JSON-Dateien je Tabelle
Abfragen select, where, orderBy, groupBy, join, limit, offset
Systemlogik autoincrement, autouuid, autohash, timestamps, Validierung
Verschlüsselung Felder können automatisch ver- und entschlüsselt werden (encrypt)
Statistik sum, avg, count, median, mode, stddev, variance, …
Transaktionen transact(), commit() – sicher & verzögert schreiben
Import/Export CSV & MySQL (CREATE/INSERT) aus .system.json generieren
Modularer Code PSR-4, eigene Traits & Klassen je Bereich

📁 Struktur

src/
├── JsonSQL.php          // Hauptklasse
├── JS_Base.php          // Gemeinsame Methoden
├── JS_Select.php        // SELECT-Logik
├── JS_Insert.php        // INSERT-Logik
├── JS_System.php        // Automatische Felder, Validierung, Timestamps, ...
└── ...

🔎 Systemfelder (system.json)

Typ Bedeutung
autoincrement Zählt IDs automatisch hoch
autouuid Generiert UUIDs bei jedem Insert
autohash Erzeugt Hash (z. B. md5, sha256)
timestamp:create Zeitstempel bei Erstellung
timestamp:update Zeitstempel bei Änderung
encrypt / decrypt Feldinhalt verschlüsseln / entschlüsseln

🧪 Demos

👉 Vollständige Demos findest du unter /examples/demos:

  • 🔐 Passwortmanager
  • 🚗 Fahrzeugdatenbank mit n:m-Kategorien
  • 📦 Produktverwaltung mit Bildern & CSV-Export
  • 📊 Statistiken & Charts
  • 🧾 MiniShop mit JSON-Daten und Bestellung

📌 Roadmap

  • Systemfelder & Validierung
  • MySQL- & CSV-Export aus JSON
  • Transaktionen
  • Aggregatfunktionen
  • Admin-UI zur Datenbearbeitung
  • JsonSQL Plugin-API
  • Dokumentationsgenerator aus system.json
  • Visual Query Builder

🔐 Lizenz

MIT – kostenlos & offen für private oder kommerzielle Nutzung.


🤝 Mitwirken

Du hast Ideen, willst mithelfen oder Fehler melden?
→ Issues & Pull Requests sind willkommen!


🗂️ Komplett-Download

Du kannst auch den vollständigen Download inklusive Demo von https://www.teitge.de/JsonSQL/JsonSQL.zip herunterladen.


© 2024–2025 JsonSQL Team
🔗 Projektseite: https://teitge.de
🔧 GitHub: https://github.com/johannes-teitge/JsonSQL

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.