DEV Community

yd-shomer
yd-shomer

Posted on

Introducing YD Shomer (י שומר) - Runtime SQL Guardian for PHP

🛡️ Introducing YD Shomer - The Guardian's Hand for PHP

I just released YD Shomer, a runtime SQL validator that catches security issues during development and teaches developers secure coding practices.

🔤 The Name

  • YD (י) - Yod, the Hebrew letter symbolizing divine protection
  • Shomer (שומר) - Guardian in Hebrew
  • The Guardian's Hand - Protection through vigilance

⚡ Quick Example

use Shomer\QueryValidator;

define('SHOMER_ENABLED', true);

// This will trigger a warning
$report = QueryValidator::validate([
    'sql' => "DELETE FROM users",  // Missing WHERE!
    'params' => []
], $verbose = true);

// Shomer provides:
// ❌ Error detected
// 📍 Exact location: file.php line 42
// 💡 Suggested fix: "DELETE FROM users WHERE id = ?"
// 📧 Email alert sent
Enter fullscreen mode Exit fullscreen mode

✨ Key Features

Security First:

  • Detects SQL injection vulnerabilities
  • Validates prepared statements
  • Checks parameter counts and types

Developer Experience:

  • Auto-captures execution context (file, line, URL)
  • Provides secure query suggestions
  • Educational approach

Production Ready:

  • Zero overhead when disabled
  • Instant bypass
  • No performance impact

🎯 Perfect For

  • Learning secure SQL practices
  • Code reviews
  • Onboarding junior developers
  • Refactoring legacy code
  • Development environments

📦 Installation

composer require yd-shomer/php-shomer
Enter fullscreen mode Exit fullscreen mode

🔗 Links

💬 Feedback Welcome!

This is my first open-source project. I'd love to hear your thoughts, suggestions, and contributions!


Protected by the Guardian's Hand 🛡️


Enter fullscreen mode Exit fullscreen mode

Top comments (0)