Path: | doc/release_notes/4.0.0.txt |
Last Update: | Sat Aug 17 05:34:45 +0000 2013 |
Example Code to Migrate Existing Data:
DB[:table].where(:column=>'t').update(:column=>1) DB[:table].where(:column=>'f').update(:column=>0)
dataset.eager_graph.naked.ungraphed
Switch such code to:
dataset.eager_graph.ungraphed.naked
# Database schema: # tags albums # :id (int4) <--\ :id # :name \-- :tag_ids (int4[]) # :name class Album plugin :pg_array_associations pg_array_to_many :tags end class Tag plugin :pg_array_associations many_to_pg_array :albums end
This operates similarly to a many_to_many association, but does not require a join table. All of the usual Sequel association features are supported, such as adding, removing, and clearing associations, eager loading via eager and eager_graph, filtering by associations, and dataset associations.
Note that until PostgreSQL gains the ability to enforce foreign key constraints in array columns, this plugin is not recommended for production use unless you plan on emulating referential integrity constraints via triggers.
DB.from{table_returning_function(arg)}
Sequel.deep_qualify(:table, Sequel.+(:column, 1)) # ("table"."column" + 1) Sequel.deep_qualify(:table, Sequel.like(:a, 'b')) # ("table"."a" LIKE 'b' ESCAPE '\')
Sequel.subscript(:a, 1..2) # a[1:2]