DBIC for SQL hackers
Assumption:
This is for people that know Perl, and usually use DBI to connect to databases.
Intro:
- Rationale for using dbic over dbi.
Database layout definitions
- Introduce Schema::Loader (aka use existing layout/maintain in DB).
- Explain Result classes + ResultSources compared to table/view/index definitions.
- Explain relationships/contraints etc in DBIC.
- Importance of Primary Keys for DBIC
Basic usage
- Schema files
- How to connect, when reconnect is done
- Mention AutoCommit/on_connect
- What is ResultSet, how to get one
Data entry
- Compare INSERT statements with create()
- Multi-level create
- Populate (insert_bulk)
- find_or* (UPSERT/etc)
- UPDATE / update
- update_or*
Data fetching
- Simple SELECTs with WHERE clauses (find/search)
- JOINing
- Aggregation (plus column ops ala ResultSetColumn)
- Subselects
- Literal sql / bind params
- Related objects
- Multiple (related) objects at once
Extras/Optimisation
- Inflation/Deflation
- HashRefInflator
- ??
DBIC Tutorial
DBIx::Class::Tutorial v0.01 has been on CPAN for sometime (and in the DBIC repo). v0.02 is a work in progress (for a while) on http://desert-island.me.uk/~castaway/web/.
TODO:
- Clean up existing pages with regard to current DBIC best practices.
- Complete with subselects, binds etc #TBD.
- Roll the above docs into the tutorial
@draft
Last modified: 2012-02-06T11:36:23
Home