dhanikk started a new conversation+100 XP
3d ago
π DBStan Update: Static Analysis + Schema Checks for Laravel
Hi everyone π
I wanted to share an update on DBStan, a package focused on improving the reliability and quality of database interactions in Laravel applications.
π The Problem
Even with Laravel, itβs still easy to:
- Write inefficient queries
- Miss issues before runtime
- Lack visibility into database structure
π‘ The Solution
DBStan brings static analysis for database queries + schema insights, similar to what Larastan does for code quality.
βοΈ Whatβs New (Enhancements)
DBStan now includes 9 schema checks to catch silent database issues early:
1. Storage Engine Check
users β InnoDB
orders β MyISAM β
2. Charset & Collation Issues
utf8 vs utf8mb4 β
3. Auto-Increment Limit Risk
INT nearing max β οΈ
4. Low-Cardinality Index Detection
INDEX(status) β
5. Composite Index Suggestions
WHERE user_id = 10 AND status = 'paid'
β INDEX(user_id, status)
6. Database Size Monitoring
7. Large Table Detection
orders = 80% of DB β
8. Missing Primary Key Check
CREATE TABLE logs (
message TEXT
); β
9. Smart Data Type Detection
- price β DECIMAL
- created_at β DATETIME
π οΈ Installation
composer require itpathsolutions/dbstan
βΆοΈ Demo
https://www.youtube.com/watch?v=Xv5m10R3wmc
π Update: DBStan reached 1,000+ downloads shortly after release. Really appreciate the community support!
π― Goal
Help Laravel developers catch database issues early, improve schema quality, and avoid production surprises.
dhanikk wrote a reply+100 XP
3w ago
Thanks a lot, really appreciate the feedback! π Right now, the package is primarily focused on analyzing the database structure and raw SQL queries to ensure correctness and consistency. Static analysis for complex Eloquent relationships (like nested relations, polymorphic relations, and dynamic scopes) is still a work in progress.
If you have any specific use cases or edge cases in mind, Iβd love to hear themβit would really help shape the next improvements!
dhanikk started a new conversation+100 XP
3w ago
Hi everyone π
Iβd like to share a package Iβve been working on called DBStan, designed to improve the reliability and quality of database interactions in Laravel applications.
π Problem
While Laravel provides excellent tools for working with databases, itβs still easy to:
Write inefficient or problematic queries
Miss potential issues before runtime
Lack visibility into query structure during development
π‘ Solution
DBStan aims to bring static analysis for database queries, similar to what Larastan does for code quality.
βοΈ What DBStan Does
Analyzes database queries in your Laravel application
Helps detect potential issues early
Encourages better query practices
Improves overall application performance and stability
π οΈ Installation
composer require itpathsolutions/dbstan
Demo Video https://www.youtube.com/watch?v=Xv5m10R3wmc
π― Goal
The goal of this package is to help Laravel developers catch database-related issues early in the development cycle and promote best practices.
Iβd really appreciate any feedback, suggestions, or contributions from the community π
Thanks!