sequel.rubyforge.org Archives - 25 April 2013, Thursday

Whether to raise an error when unable to typecast data for a column (default: true). This should be set to false if you want to use validations to display nice error messages to the user (e.g. most web applications). You can use the validates_not_string validations (from either the va...

and ActiveRecord use the active record pattern of database access, where model instances are objects that wrap a row in a database table or view, encapsulating the database access, and adding domain logic on that data. Just like ActiveRecord, Sequel supports both associations and inhe...

Related:

Should be a hash with keys being symbols of column aliases, and values being either symbols or arrays with one to three elements. If the value is a symbol, it is assumed to be the same as a one element array containing that symbol. The first element of the array should be the table al...

dataset_filtering.rdoc doc/dataset_filtering.rdoc Last Update: 2012-07-13 09:26:05 -0700 Dataset Filtering Sequel is very flexibile when it comes to filtering records. You can specify your conditions as a custom string, as a string with parameters, as a hash of values to compare again...

actually does internally is two separate things. It first creates a dataset representing the query, and then it executes the dataset's SQL code to retrieve the objects. Often, you want to define a dataset at some point, but not execute it till later. You can do this by leaving off the...

A pg_range extension has been added, making it easy to deal with PostgreSQL 9.2+'s range types. As ruby's Range class does not support all PostgreSQL range type values (such as empty ranges, unbounded ranges, or ranges with an exlusive beginning), range types are returned as instances...

Related:

The pg_json extension adds support for Sequel to handle PostgreSQL's json type. It is slightly more strict than the PostgreSQL json type in that the object returned must be an array or object (PostgreSQL's json type considers plain numbers and strings as valid). This is because Sequel...

Datasets are probably the thing that separate Sequel from other database libraries. While most database libraries have specific support for updating all records or only a single record, Sequel's ability to represent SQL queries themselves as objects is what gives Sequel most of its po...

Migrations are optional, you don't have to use them. You can always just create the necessary database structure manually using Sequel's schema modification methods or another database tool. However, if you are dealing with other developers, you'll have to send them all of the changes...

Note that using an adapter method forces the use of the specified adapter, not a database type, even though some adapters have the same name as the database type. So if you want to connect to SQLite, for example, you can do so using the sqlite, do, dbi, jdbc, odbc, and swift adapters....

There are two related differences here. First is the usage of "o.c" vs "c", and second is the difference between the the use of "a". In the regular proc, you couldn't call c without an explicit receiver in the proc, unless the self of the surrounding scope responded to it. For a, note...