DBIC for SQL hackers

Assumption:

This is for people that know Perl, and usually use DBI to connect to databases.

  1. Intro:

    • Rationale for using dbic over dbi.
  2. 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
  3. Basic usage

    • Schema files
    • How to connect, when reconnect is done
    • Mention AutoCommit/on_connect
    • What is ResultSet, how to get one
  4. Data entry

    • Compare INSERT statements with create()
    • Multi-level create
    • Populate (insert_bulk)
    • find_or* (UPSERT/etc)
    • UPDATE / update
    • update_or*
  5. 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
  6. 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:

@draft

Last modified: 2009-12-16T13:03:17

Home