Permalink
Browse files

Add document describing the core extensions

Also, link to this document from some other documents, including
the README, so that new users can be exposed to the core extensions
early.
  • Loading branch information...
1 parent 76b71fa commit 34222ed66d43b17b32dd95358baf21c621ebf2e5 @jeremyevans committed Jul 13, 2012
Showing with 399 additions and 2 deletions.
  1. +10 −0 README.rdoc
  2. +1 −1 doc/cheat_sheet.rdoc
  3. +374 −0 doc/core_extensions.rdoc
  4. +4 −0 doc/dataset_filtering.rdoc
  5. +2 −0 doc/object_model.rdoc
  6. +3 −1 doc/querying.rdoc
  7. +4 −0 doc/sql.rdoc
  8. +1 −0 www/pages/documentation
View
@@ -296,6 +296,16 @@ You can also specify descending order:
posts.order(Sequel.desc(:stamp))
# ORDER BY stamp DESC
+=== Core Extensions
+
+Note the use of <tt>Sequel.desc(:stamp)</tt> in the above example. Much of Sequel's DSL uses this style, calling methods on the Sequel module that return SQL expression objects. Sequel also ships with a {core_extensions extension}[link:files/doc/core_extensions_rdoc.html]) that integrates Sequel's DSL better into the ruby language, allowing you to write:
+
+ :stamp.desc
+
+instead of:
+
+ Sequel.desc(:stamp)
+
=== Selecting Columns
Selecting specific columns to be returned is also simple using +select+:
@@ -64,7 +64,7 @@ Without a filename argument, the sqlite adapter will setup a new sqlite database
dataset.inject(0){|sum, r| sum + r[:value]}
dataset.sum(:value) # same as above
-== Filtering (see also doc/dataset_filtering.rdoc)
+== Filtering (see also {Dataset Filtering}[link:files/doc/dataset_filtering_rdoc.html])
=== Equality
Oops, something went wrong.

0 comments on commit 34222ed

Please sign in to comment.