A structured guide to learning PDOdb from beginner to advanced.
This learning path is designed to take you from complete beginner to advanced PDOdb user. Each section builds on the previous one, so follow them in order.
Estimated Time:
- Beginner: 1-2 hours
- Intermediate: 3-5 hours
- Advanced: 5-10 hours
Perfect for those new to PDOdb or database libraries in general.
Goal: Get PDOdb installed and verify it works.
Tasks:
- Install via Composer
- Verify PDO extensions are installed
- Create a simple test connection
Resources:
Checkpoint: Can you connect to SQLite and run a simple query?
Goal: Understand how to connect to different databases.
Tasks:
- Connect to SQLite (easiest - no setup)
- Understand connection configuration
- Test connection with
ping()
Resources:
Checkpoint: Can you connect to at least one database type?
Goal: Write your first complete application.
Tasks:
- Create tables
- Insert data
- Query data
- Update and delete records
- Understand basic CRUD operations
Resources:
- Hello World
- Quick Reference - for quick lookups
Checkpoint: Can you create a table, insert data, and query it?
Goal: Understand the fluent API and method chaining.
Tasks:
- Learn
find(),from(),where(),get() - Understand method chaining
- Practice building simple queries
Resources:
Checkpoint: Can you build queries using method chaining?
Goal: Master Create, Read, Update, Delete operations.
Tasks:
- Insert single and multiple rows
- Select with conditions
- Update records
- Delete records
- Understand affected rows
Resources:
Checkpoint: Can you perform all CRUD operations confidently?
Beginner Path Complete! 🎉
You now know the basics. Move on to intermediate topics when you're comfortable with CRUD operations.
For those comfortable with basics and ready to learn advanced query building.
Goal: Understand how to join multiple tables.
Tasks:
- Learn INNER JOIN, LEFT JOIN, RIGHT JOIN
- Understand table aliases
- Practice joining 2-3 tables
- Handle NULL values in joins
Resources:
Checkpoint: Can you join multiple tables and get correct results?
Goal: Use GROUP BY, HAVING, and aggregate functions.
Tasks:
- COUNT, SUM, AVG, MIN, MAX
- GROUP BY with single and multiple columns
- HAVING vs WHERE
- Filtering aggregated results
Resources:
Checkpoint: Can you write queries with aggregations and grouping?
Goal: Understand transaction management and data integrity.
Tasks:
- Start, commit, rollback transactions
- Use transaction callbacks
- Handle errors in transactions
- Understand when to use transactions
Resources:
Checkpoint: Can you wrap multiple operations in a transaction?
Goal: Work with JSON data across all databases.
Tasks:
- Store JSON data
- Query JSON fields
- Filter by JSON values
- Update JSON documents
Resources:
Checkpoint: Can you store and query JSON data?
Goal: Use helper functions for common operations.
Tasks:
- String helpers (concat, upper, lower)
- Date helpers (now, curDate)
- NULL helpers (coalesce, ifNull)
- Comparison helpers (like, between, in)
Resources:
Checkpoint: Can you use helpers instead of raw SQL for common operations?
Goal: Handle errors gracefully and debug issues.
Tasks:
- Understand exception hierarchy
- Catch specific exception types
- Use error diagnostics
- Log errors appropriately
Resources:
Checkpoint: Can you handle errors and debug database issues?
Intermediate Path Complete! 🎉
You're now comfortable with most common database operations. Ready for advanced topics?
For those ready to master advanced features and optimizations.
Goal: Use window functions for advanced analytics.
Tasks:
- ROW_NUMBER, RANK, DENSE_RANK
- LAG, LEAD for time-series data
- Running totals and moving averages
- Partitioning windows
Resources:
Checkpoint: Can you write queries with window functions?
Goal: Use CTEs for complex queries and recursive operations.
Tasks:
- Basic CTEs (WITH clauses)
- Recursive CTEs for hierarchical data
- Materialized CTEs for performance
- Multiple CTEs in one query
Resources:
Checkpoint: Can you write recursive CTEs for tree structures?
Goal: Use subqueries effectively.
Tasks:
- Scalar subqueries
- EXISTS and NOT EXISTS
- IN and NOT IN with subqueries
- Correlated subqueries
Resources:
Checkpoint: Can you use subqueries in SELECT, WHERE, and FROM clauses?
Goal: Optimize queries for better performance.
Tasks:
- Use EXPLAIN and EXPLAIN ANALYZE
- Create appropriate indexes
- Understand query execution plans
- Use query caching
- Batch processing for large datasets
Resources:
Checkpoint: Can you identify and fix slow queries?
Goal: Master advanced PDOdb features.
Tasks:
- Read/Write splitting
- Sharding across multiple databases
- Database migrations
- Query macros and scopes
- Plugin system
Resources:
Checkpoint: Can you set up read/write splitting or sharding?
Goal: Use the optional ORM for object-based operations.
Tasks:
- Define models
- Use relationships (hasOne, hasMany, belongsTo)
- Eager and lazy loading
- Model validation
- Query scopes
Resources:
Checkpoint: Can you build a complete model with relationships?
Advanced Path Complete! 🎉
You're now a PDOdb expert! Continue exploring advanced topics and contributing to the community.
- Quick Reference - Common tasks with code snippets
- API Reference - Complete API documentation
- Troubleshooting - Common issues and solutions
- Complete beginner? → Start with Installation
- Know SQL but new to PDOdb? → Start with Hello World
- Want to learn a specific feature? → Use the search or table of contents
- Having issues? → Check Troubleshooting
- Practice: Type out examples yourself, don't just read them
- Experiment: Modify examples to see what happens
- Build: Create a small project to practice
- Read: Check the Best Practices section regularly
- Ask: Use GitHub Issues for questions
After completing your path:
- Explore Real-World Examples
- Review Common Patterns
- Read Best Practices
- Contribute to the project!