Listing categories using WordPress 2.3’s new taxonomy system
I upgraded to Wordpress 2.3 today, which broke a few of my hacked plugins. The code broke as it relied on the old category system, which was replaced by a new, more flexible, taxonomy system. The new schema is well designed too, and the new queries are much cleaner as a result. Here’s an example of how to get a list of categories1:
SELECT *
FROM wp_terms AS t
JOIN wp_term_taxonomy AS tx
ON t.term_id = tx.term_id
JOIN wp_term_relationships AS tr
ON tr.term_taxonomy_id = tx.term_taxonomy_id
WHERE taxonomy = 'category'
GROUP BY t.term_id
ORDER BY count DESC, t.term_id;
The new taxonomy approach introduces the possibility of displaying better clusters of categories, by including tags in the mix. It also cleans up the SQL from the previous releases with simpler ways of getting count and a clearer relationship mechanism. The table design is clean too, a big improvement over past schemas.
- Of course, you would use the public category/taxonomy APIs if this was all you needed ↩
Rich web SQL editor
A rich web SQL editor (all in JS/HTML). A good example of a drag/drop UI for table building, including a nice view scroll widget at the bottom. Very slick.
Full text search for SQLite
A full-text extension for SQLite, found while reading Google’s use of SQLite in Google Gears.
Size isn’t everything
An interview with Richard Hipp (author of the SQLite library) at The Guardian. I’ve used SQLite for several projects now, and am very impressed.
Modeling chess in SQL
A demented, but useful way of expanding your thinking on SQL: SQLChess - A tutorial on thinking in sets.
Ruby reporting
Ruport is a Ruby reporting library that can hook into ActiveRecord, CSV, or SQL/DBI. It has a simple formatting language, can produce PDFs and graphs, and even does some code generation to make things easy.
InstantRails = Rails + MySQL + Apache
InstantRails is an all-in-one distribution of Rails, Apache, and Mysql for Windows users. It comes with a funky little console, and some demo rails applications to play with. A very quick way to hack at Rails bits when in Windows land.
SQLite talk at Google
Richard Hipp gives a Google Talk about his SQLite engine. SQLite is a small, slick SQL engine that offers most of SQL92, a small footprint (single file), and great performance on desktops and handheld systems.
Flickr architecture slides
Some slides on Flickr’s architecture. It’s all sensible stuff, with very little magic: Php4, Mysql (innodb), ImageMagick, Perl, Java (for nodes), RHEL, and so on.

RSS![No comments [Comment]](/images/comment.png)
![[>>]](/wp-content/themes/warped/images/next.png)
