=== 0.3 (2007-10-20) * Added stock transforms to Dataset#transform. Refactored Model.serialize. * Added Database#logger= method for setting the database logger object. * Fixed Model.[] to act as shortcut to Model.find when a hash is given (#71). * Added support for old and new decimal types in MySQL adapter, and updated MYSQL_TYPES with MySQL 5.0 constants (#72). * Implemented Database#disconnect method for all adapters. * Fixed small bug in ArrayKeys module. * Implemented model caching by primary key. * Separated Model.find and Model.[] functionality. Model.find takes a filter. Model.[] is strictly for finding by primary keys. * Enhanced Dataset#first to accept a filter block. Model#find can also now accept a filter block. * Changed Database#[] to act as shortcut to #fetch if a string is given. * Renamed Database#each to #fetch. If no block is given, the method returns an enumerator. * Changed Dataset#join methods to correctly literalize values in join conditions (#70). * Fixed #filter with ranges to correctly literalize field names (#69). * Implemented Database#each method for quickly retrieving records with arbitrary SQL (thanks Aman Gupta). * Fixed bug in postgres adapter where a LiteralString would be literalized as a regular String. * Fixed SQLite insert with subquery (#68). * Reverted back to hashes as default mode. Added Sequel.use_array_tuples and Sequel.use_hash_tuples methods. * Fixed problem with arrays with keys when using #delete. * Implemented ArrayKeys as substitute for ArrayFields. * Added Dataset#each_hash method. * Rewrote SQLite::Database#transaction to use sqlite3-ruby library implementation of transactions. * Fixed Model.destroy_all to work correctly in cases where no before_destroy hook is defined and an after_destroy hook is defined. * Restored Model.has_hooks? implementation. * Changed Database#<< to strip comments and whitespace only when an array is given. * Changed Schema::Generator#primary_key to accept calls with the type argument omitted. * Hooks can now be prepended or appended by choice. * Changed Model.subset to define filter method on the underlying dataset instead of the model class. * Fixed Dataset#transform to work with array fields. * Added Dataset#to_csv method. * PrettyTable can now extract column names from arrayfields. * Converted ado, dbi, odbc adapters to use arrayfields instead of hashes. * Fixed composite key support. * Fixed Dataset#insert_sql, update_sql to support array fields. * Converted sqlite, mysql, postgres adapters to use arrayfields instead of hashes. * Extended Dataset#from to auto alias sub-queries. * Extended Dataset#from to accept hash for aliasing tables. * Added before_update, after_update hooks. === 0.2.1.1 (2007-10-07) * Added Date literalization to sqlite adapter (#60). * Changed Model.serialize to allow calling it after the class is defined (#59). * Fixed after_create hooks to allow calling save inside the hook (#58). * Fixed MySQL quoting of sql functions (#57). * Implemented rollback! global method for cancelling transactions in progress. * Fixed =~ operator in Sequelizer. * Fixed ODBC::Dataset#fetch_rows (thanks Dusty). * Renamed Model.recreate_table to create_table!. recreate_table is deprecated and will issue a warning (#56). === 0.2.1 (2007-09-24) * Added default implementation of Model.primary_key_hash. * Fixed Sequel::Model() to set dataset for inherited classes. * Rewrote Model.serialize to use Dataset#transform. * Implemented Dataset#transform. * Added gem spec for Windows (without ParseTree dependency). * Added support for dynamic strings in Sequelizer (#49). * Query branch merged into trunk. * Implemented self-changing methods. * Add support for ternary operator to Sequelizer. * Fixed sequelizer to evaluate expressions if they don't involve symbols or literal strings. * Added protection against using #each, #delete, #insert, #update inside query blocks. * Improved Model#method_missing to deal with invalid attributes. * Implemented Dataset#query. * Added Dataset#group_by as alias for Dataset#group. * Added Dataset#order_by as alias for Dataset#order. * More model refactoring. Added support for composite keys. * Added Dataset#empty? method (#46). * Fixed Symbol#to_field_name to support names with numbers and upper-case characters (#45). * Added install_no_doc rake task. * Partial refactoring of model code. * Refactored dataset-model association and added Dataset#set_row_filter method. * Added support for case-sensitive regexps to mysql adapter. * Changed mysql adapter to support encoding option as well. * Added charset/encoding option to postgres adapter. * Implemented Model.serialize (thanks Aman Gupta.) * Changed Model.create to INSERT DEFAULT VALUES instead of (id) VALUES (null) (brings back #41.) * Fixed Model.new to work without arguments. * Added Model.no_primary_key method to allow models without primary keys. * Added Model#this method (#42 thanks Duane Johnson). * Fixed Dataset#insert_sql to use DEFAULT VALUES clause if argument is an empty hash. * Fixed Model.create to work correctly when no argument is passed (#41). === 0.2.0.2 (2007-09-07) * Dataset#insert can now accept subqueries. * Changed Migrator.apply to return the version. * Changed Sequel::Model() to cache intermediate classes so descendant classes can be reopened (#39). * Added :charset option to MySQL adapter (#40). * Fixed Dataset#exclude to add parens around NOT expression (#38). * Fixed use of sub-queries with all comparison operators in block filters (#38). * Fixed arithmetic expressions in block filters to not be literalized. * Changed Symbol#method_missing to return LiteralString. * Changed PrettyTable to right-align numbers. * Fixed Model.create_table (thanks Duane Johnson.) === 0.2.0.1 (2007-09-04) * Improved support for invoking methods with inline procs inside block filters. === 0.2.0 (2007-09-02) * Fixed Model.drop_table (thanks Duane Johnson.) * Dataset#each can now return rows for arbitrary SQL by specifying :sql option. * Added spec for postgres adapter. * Fixed Model.method_missing to work with new SQL generation. * Fixed #compare_expr to support regexps. * Fixed postgres, mysql adapters to support regexps. * More specs for block filters. Updated README. * Added support for globals and $X macros in block filters. * Fixed Sequelizer to not fail if ParseTree or Ruby2Ruby gems are missing. * Renamed String#expr into String#lit (#expr should be deprecated in future versions). * Renamed Sequel::ExpressionString into LiteralString. * Fixed Symbol#[] to return an ExpressionString, so as not to be literalized. * Renamed Dataset::Expressions to Dataset::Sequelizer. * Renamed Expressions#format_re_expression to match_expr. * Renamed Expressions#format_eq_expression to compare_expr. * Added support for Regexp in MySQL adapter. * Refactored Regexp expressions into a separate #format_re_expression method. * Added support for arithmetic in proc filters. * Added support for nested proc expressions, more specs. * Added support for SQL function using symbols, e.g. :sum[:x]. * Fixed deadlock bug in ConnectionPool. * Removed deprecated old expressions.rb. * Rewrote Proc filter feature using ParseTree. * Added support for additional functions on columns using Symbol#method_missing. * Added support for supplying filter block to DB#[] method, to allow stuff like DB[:nodes] {:path =~ /^icex1/}. === 0.1.9.12 (2007-08-26) * Added spec for PrettyTable. * Added specs for Schema::Generator and Model (#36 thanks technoweenie). * Fixed Sequel::Model.set_schema (#36 thanks technoweenie.) * Added support for no options on Schema::Generator#foreign_key (#36 thanks technoweenie.) * Implemented (restored?) Schema::Generator#primary_key_name (#36 thanks technoweenie.) * Better spec code coverage. === 0.1.9.11 (2007-08-24) * Changed Dataset#set_model to allow supplying additional arguments to the model's initialize method (#35). Thanks Sunny Hirai. === 0.1.9.10 (2007-08-22) * Changed schema generation code to generate separate statements for CREATE TABLE and each CREATE INDEX (#34). * Refactored Dataset::SQL#field_name for better support of different field quoting standards by specific adapters. * Added #current_page_record_count for paginated datasets. * Removed Database#literal and included Dataset::SQL instead. * Sequel::Dataset:SQL#field_name can now take a hash (as well as #select and any method that uses #field_name) for aliasing column names. E.g. DB[:test].select(:_qqa => 'Date').sql #=> 'SELECT _qqa AS Date FROM test'. * Moved SingleThreadedPool to lib/sequel/connection_pool.rb. * Changed SQLite::Dataset to return affected rows for #delete and #update (#33). * ADO adapter: Added use of Enumerable for Recordset#Fields, playing it safe and moving to the first row before getting results, and changing the auto_increment constant to work for MSSQL. === 0.1.9.9 (2007-08-18) * New ADO adapter by cdcarter (#31). * Added automatic column aliasing to #avg, #sum, #min and #max (#30). * Fixed broken Sequel::DBI::Dataset#fetch_rows (#29 thanks cdcarter.) === 0.1.9.8 (2007-08-15) * Fixed DBI adapter. === 0.1.9.7 (2007-08-15) * Added support for executing batch statements in sqlite adapter. * Changed #current_page_record_range to return 0..0 for an invalid page. * Fixed joining of aliased tables. * Improved Symbol#to_field_name to prevent false positives. * Implemented Dataset#multi_insert with :commit_every option. * More docs for Dataset#set_model. * Implemented automatic creation of convenience methods for each adapter (e.g. Sequel.sqlite etc.) === 0.1.9.6 (2007-08-13) * Refactored schema definition code. Gets rid of famous primary_key problem as well as other issues (e.g. issue #22). * Added #pagination_record_count, #page_range and #current_page_record_range for paginated datasets. * Changed MySQL adapter to automatically reconnect (issue #26). * Changed Sequel() to accept variable arity. * Added :elements option to column definition, in order to support ENUM and SET types. === 0.1.9.5 (2007-08-12) * Fixed migration docs. * Removed dependency on PGconn in Schema class. === 0.1.9.4 (2007-08-11) * Added Sequel.dbi convenience method for using DBI connection strings to open DBI databases. === 0.1.9.3 (2007-08-10) * Added support for specifying field size in schema definitions (thanks Florian Aßmann.) * Added migration code based on work by Florian Aßmann. * Reintroduced metaid dependency. No need to keep a local copy of it. === 0.1.9.2 (2007-07-24) * Removed metaid dependency. Re-factored requires in lib/sequel.rb. === 0.1.9.1 (2007-07-22) * Improved robustness of MySQL::Dataset#field_name. * Added Sequel.single_threaded= convenience method. === 0.1.9 (2007-07-21) * Fixed #update_sql and #insert_sql to support field quoting by calling #field_name. * Implemented automatic data type conversion in mysql adapter. * Added support for boolean literals in mysql adapter. * Added support for ORDER and LIMIT clauses in UPDATE statements in mysql adapter. * Implemented correct field quoting (using back-ticks) in mysql adapter. * Wrote basic MySQL spec. * Fixd MySQL::Dataset to return correct data types with symbols as hash keys. * Removed discunctional MySQL::Database#transaction. * Added support for single threaded operation. * Fixed bug in Dataset#format_eq_expression where Range objects would not be literalized correctly. * Added parens around postgres LIKE expressions using regexps. === 0.1.8 (2007-07-10) * Implemented Dataset#columns for retrieving the columns in the result set. * Updated Model with changes to how model-associated datasets work. * Beefed-up specs. Coverage is now at 95.0%. * Added support for polymorphic datasets. * The adapter dataset interface was simplified and standardized. Only four methods need be overriden: fetch_rows, update, insert and delete. * The Dataset class was refactored. The bulk of the dataset code was moved into separate modules. * Renamed Dataset#hash_column to Dataset#to_hash. * Added some common pragmas to sqlite adapter. * Added Postgres::Dataset#analyze for EXPLAIN ANALYZE queries. * Fixed broken Postgres::Dataset#explain. === 0.1.7 * Removed db.synchronize wrapping calls in sqlite adapter. * Implemented Model.join method to restrict returned columns to the model table (thanks Pedro Gutierrez). * Implemented Dataset#paginate method. * Fixed after_destroy hook. * Improved Dataset#first and #last to accept a filter hash. * Added Dataset#[]= method. * Added Sequel() convenience method. * Fixed Dataset#first to include a LIMIT clause for a single record. * Small fix to Postgres driver to return a primary_key value for the inserted record if it is specified in the insertion values (thanks Florian Aßmann and Pedro Gutierrez). * Fixed Symbol#DESC to support qualified notation (thanks Pedro Gutierrez). === 0.1.6 * Fixed Model#method_missing to raise for an invalid attribute. * Fixed PrettyTable to print model objects (thanks snok.) * Fixed ODBC timestamp conversion to return DateTime rather than Time object (thanks snok.) * Fixed Model.method_missing (thanks snok.) * Model.method_missing now creates stubs for calling Model.dataset methods. Methods like Model.each etc are removed. * Changed default join type to INNER JOIN (thanks snok.) * Added support for literal expressions, e.g. DB[:items].filter(:col1 => 'col2 - 10'.expr). * Added Dataset#and. * SQLite adapter opens a memory DB if no database is specified, e.g. Sequel.open 'sqlite:/'. * Added Dataset#or, pretty nifty. === 0.1.5 * Fixed Dataset#join to support multiple joins. Added #left_outer_join, #right_outer_join, #full_outer_join, #inner_join methods. === 0.1.4 * Added String#split_sql. * Implemented Array#to_sql and String#to_sql. Database#to_sql can now take an array of strings and convert into an SQL string. Comments and excessive white-space are removed. * Improved Schema generator to support data types as method names: DB.create_table :test do integer :abc text :def ... end * Implemented ODBC adapter. === 0.1.3 * Implemented DBI adapter. * Refactored database connection code. Now handled through Database#connect. === 0.1.2 * The first opened database is automatically assigned to to Model.db. * Removed SequelConnectionError. Exception class errors are converted to RuntimeError. * Added support for UNION, INTERSECT and EXCEPT set operations. * Fixed Dataset#single_record to return nil if no record is found. * Updated specs to conform to RSpec 1.0. * Added Model#find_or_create method. * Fixed MySQL::Dataset#query_single (thanks Dries Harnie.) * Added Model.subset method. Fixed Model.filter and Model.exclude to accept blocks. * Added Database#uri method. * Refactored and removed deprecated code in postgres adapter. ===0.1.1 * More documentation for Dataset. * Added Dataset#size as alias to Dataset#count. * Changed Database#<< to call execute (instead of being an alias). Thus it will work for descendants as well. * Fixed Sequel.open to accept variable arity. * Refactored Model#refresh, Model.create. Removed Model#reload. * Refactored Model hooks. * Cleaned up Dataset API. === 0.1.0 * Changed Database#create_table to only accept a block. Nobody's gonna use the other way. * Removed Dataset#[]= method. Too confusing and not really useful. * Fixed ConnectionPool#hold to wrap exceptions only once. * Dataset#where_list Renamed Dataset#expression_list. * Added support for qualified fields in Proc expressions (e.g. filter {items.id == 1}.) * Added like? and in? Proc expression operators. * Added require 'date' in dataset.rb. Is this a 1.8.5 thing? * Refactored Dataset to use literal strings instead of format strings (slight performance improvement and better readability.) * Added support for literalizing Date objects. * Refactored literalization of Time objects. === 0.0.20 * Refactored Dataset where clause construction to use expressions. * Implemented Proc expressions (adapted from a great idea by Sam Smoot.) * Fixed Model#map. * Documentation for ConnectionPool. * Specs for Database. === 0.0.19 * More specs for Dataset. * Fixed Dataset#invert_order to work correctly with strings. * Fixed Model#== to check equality of values. * Added Model#exclude and Model#order. * Fixed Dataset#order and Dataset#group to behave correctly when supplied with qualified field name symbols. * Removed Database#literal. Shouldn't have been there. * Added SQLite::Dataset#explain. Returns an array of opcode hashes. * Specs for ConnectionPool. === 0.0.18 * Implemented SequelError and SequelConnectionError classes. ConnectionPool#hold now catches any connection errors and reraises them SequelConnectionError. * Removed duplication in Database#[]. * :from and :select options are now always arrays (patch by Alex Bradbury.) * Fixed Dataset#exclude to work correctly (patch and specs by Alex Bradbury.) === 0.0.17 * Fixed Postgres::Database#tables to return table names as symbols (caused problem when using Database#table_exists?). * Fixed Dataset#from to have variable arity, like Dataset#select and Dataset#where (patch by Alex Bradbury.) * Added support for GROUP BY and HAVING clauses (patches by Alex Bradbury.) Refactored Dataset#filter. * More specs. * Refactored Dataset#where for better composability. * Added Dataset#[]= method. * Added support for DISTINCT and OFFSET clauses (patches by Alex Bradbury.) Dataset#limit now accepts ranges. Added Dataset#uniq and distinct methods. === 0.0.16 * More documentation. * Added support for subqueries in Dataset#literal. * Added support for Model.all_by_XXX methods through Model.method_missing. * Added basic SQL logging to Database. * Added Enumerable#send_each convenience method. * Changed Dataset#destroy to return the number of deleted records. === 0.0.15 * Improved Dataset#insert_sql to allow arrays as well as hashes. * Database#drop_table now accepts a list of table names. * Added Model#id to to return the id column. === 0.0.14 * Fixed Model's attribute accessors (hopefully for the last time). * Changed Model.db and Model.db= to allow different databases for different model classes. * Fixed bug in aggregate methods (max, min, etc) for datasets using record classes. === 0.0.13 * Fixed Model#method_missing to do both find, filter and attribute accessors. duh. * Fixed bug in Dataset#literal when quoting arrays of strings (thanks Douglas Koszerek.) === 0.0.12 * Model#save now correctly performs an INSERT for new objects. * Added Model#reload for reloading an object from the database. * Added Dataset#naked method for getting a version of a dataset that fetches records as hashes. * Implemented attribute accessors for column values ala ActiveRecord models. * Fixed filtering using nil values (e.g. dataset.filter(:parent_id => nil)). === 0.0.11 * Renamed Model.schema to Model.set_schema and Model.get_schema to Model.schema. * Improved Model class to allow descendants of model clases (thanks Pedro Gutierrez.) * Removed require 'postgres' in schema.rb (thanks Douglas Koszerek.) === 0.0.10 * Added some examples. * Added Dataset#print method for pretty-printing tables. === 0.0.9 * Fixed Postgres::Database#tables and #locks methods. * Added PGconn#last_insert_id method that should support all 7.x and 8.x versions of Postgresql. * Added Dataset#exists method for EXISTS where clauses. * Changed behavior of Dataset#literal to regard symbols as field names. * Refactored and DRY'd Dataset#literal and overrides therof. Added support for subqueries in where clause. === 0.0.8 * Fixed Dataset#reverse_order to provide chainability. This method can be called without arguments to invert the current order or with arguments to provide a descending order. * Fixed literal representation of literals in SQLite adapter (thanks Christian Neukirchen!) * Refactored insert code in Postgres adapter (in preparation for fetching the last insert id for pre-8.1 versions). === 0.0.7 * Fixed bug in Model.schema, duh! === 0.0.6 * Added Dataset#sql as alias to Dataset#select_sql. * Dataset#where and Dataset#exclude can now be used for refining dataset conditions, enabling stuff like posts.where(:title => 'abcdef').exclude(:user_id => 3). * Implemented Dataset#exclude method. * Added Sequel::Schema#auto_primary_key method for setting an automatic primary key to be added to every table definition. Changed the schema generator to not define a primary key by default. * Changed Sequel::Database#table_exists? to rely on the tables method if it is available. * Implemented SQLite::Database#tables. === 0.0.5 * Added Dataset#[] method. Refactored Model#find and Model#[]. * Renamed Pool#conn_maker to Pool#connection_proc. * Added automatic require 'sequel' to all adapters for convenience. === 0.0.4 * Added preliminary MySQL support. * Code cleanup. === 0.0.3 * Add Dataset#sum method. * Added support for exclusive ranges (thanks Christian Neukirchen.) * Added sequel console for quick'n'dirty access to databases. * Fixed small bug in Dataset#qualified_field_name for better join support. === 0.0.2 * Added Sequel.open as alias to Sequel.connect. * Refactored Dataset#where_equal_condition into Dataset#where_condition, allowing arrays and ranges, e.g. posts.filter(:stamp => (3.days.ago)..(1.day.ago)), or posts.filter(:category => ['ruby', 'postgres', 'linux']). * Added Model#[]= method for changing column values and Model#save method for saving them. * Added Dataset#destroy for deleting each record individually as support for models. Renamed Model#delete to Model#destroy (and Model#destroy_all) ala ActiveRecord. * Refactored Dataset#first and Dataset#last code. These methods can now accept the number of records to fetch. === 0.0.1 * More documentation for Dataset. * Renamed Database#query to Database#dataset. * Added Dataset#insert_multiple for inserting multiple records. * Added Dataset#<< as shorthand for inserting records. * Added Database#<< method for executing arbitrary SQL. * Imported Sequel code.