First page Back Continue Last page Overview Graphics


Notes:

Here's a fairly simple query.

Note how the ruby code doesn't contain any SQL.

It uses ruby symbols for SQL columns, and ruby strings for SQL strings.

This is how most Sequel code looks, rarely do people write the SQL manually, though Sequel supports that too.

See how you use select to include the id and name columns, filter to restrict records to ones where the name is jeremy, and or to also include records where paid is true.

You then order it by name and limit it to 10 records.

If you are used to SQL, it should pretty easy to translate code to Sequel. If you don't know SQL, using Sequel's API is probably easier than learning SQL syntax.