Preserving order of select on a dataset

2009-11-23 Thread Xavier Lange
I am generating SQL for use with Postgres' tablefunc plugin to create pivoted/cross tabulated result sets and I have run into a problem with the ordering of the columns. Here is the documentation for tablefunc, if you're curious, http://www.postgresql.org/docs/current/static/tablefunc.html . I am

Re: Problems with import on postgres

2009-07-17 Thread Xavier Lange
Yeah, it's an array of hashes with the values listed in the import list. Any ideas what else I should try? Xavier On Jul 17, 6:50 am, Jeremy Evans jeremyeva...@gmail.com wrote: On Jul 16, 12:47 am, Xavier Lange xrla...@gmail.com wrote: I am writing a migration script and I need to use

Problems with import on postgres

2009-07-16 Thread Xavier Lange
I am writing a migration script and I need to use the import function but it seems to be generating bad SQL for postgres (8.3.7). I am using sequel 3.2.0. The script is messing up on the first set it tries to import, all the values in the SQL statement make sense for the table. I'm trying to

Re: InnoDB by default when using migrations in Merb.

2009-02-16 Thread Xavier Lange
I don't know about any Merb::Plugins.config[:sequel] type of interface, but you can interact directly with Sequel once the code has been loaded by Merb and before the classes in app/models have been loaded. In config/init.rb I have added Sequel::Model.raise_on_save_failure = false to change that

Re: Update Model's Schema For Migrations

2009-01-10 Thread Xavier Lange
I forgot to mention that I am using merb to perform the migrations through a rake task. The entire merb environment is loaded before the migrations are applied. But yes, thank you for the help! Xavier On Jan 10, 12:33 pm, Jeremy Evans jeremyeva...@gmail.com wrote: On Jan 9, 11:55 pm, Xavier

Update Model's Schema For Migrations

2009-01-09 Thread Xavier Lange
Hi, How can a model's schema be updated once a migration has been applied to its table? I am adding a column to a table and then I want to update all the records to use this column appropriately but I cannot do this in one migration because Sequel does not reload the schema. I could not find

Re: Ruby 1.9.1 Compatibility

2009-01-08 Thread Xavier Lange
That's great news! What modifications did you have to make to pg to install it? Xavier On Jan 6, 6:53 pm, Jeremy Evans jeremyeva...@gmail.com wrote: I recently updated the Ruby 1.9 version on my test server from 1.9.0 svn revision 18194 to 1.9.1rc1, and all of the specs still pass.

Behavior of Sequel::Model#set_with_params changed?

2008-07-16 Thread Xavier Lange
I upgraded from 2.0.2 to 2.2.0 and I noticed that Sequel::Model#set_with_params returns a hash and not a model whereas, I believe, before it returned the instance of the model (that's how my webapp code worked, at least). Is this the proper behavior? To me it makes sense that set_with_params

Re: Inherited Model Attributes

2008-07-13 Thread Xavier Lange
I understand the problem with setting global variables before subclassing but it seems like this is just a known 'ruby' thing for programmers to handle themselves. The subclassing behavior is a part of the ruby language and programmers will be aware of it and able to handle it themselves. My web

Re: Using Sequel::Model with namespaced classes

2008-05-16 Thread Xavier Lange
}] and then when accessing from the EvenDistributionSurvey instance I get a bad table look up eds.item_containers Mysql::Error: Table 'survey_development.even_distribution_surveys_item_containers' doesn't exist Any ideas on how I can whip this into shape? Thanks, Xavier On May 15, 10:35 pm, Xavier Lange

Re: MySQL adapter problem

2008-05-15 Thread Xavier Lange
] wrote: On May 15, 1:06 pm, Xavier Lange [EMAIL PROTECTED] wrote: I'm trying to get sequel to use the native c mysql adapter on OS X. gem list | grep mysql mysql (2.7) and the command I use to connect to the db (a local one) sequel mysql://me:[EMAIL PROTECTED]/db db_opts = {} Could

Re: Implementing directed graphs

2008-03-28 Thread Xavier Lange
, whereas Animal.each_of_type will loop over Dog/Cat/etc objects. Aman Gupta On Mar 28, 9:57 am, Xavier Lange [EMAIL PROTECTED] wrote: That's very interesting syntax. But how does sequel record the type when saving the record? Do you need to specify a before_save hook for each subclass

Re: Implementing directed graphs

2008-03-28 Thread Xavier Lange
To further clarify. shouldn't those filter values be applied when saving a new record? should have been shouldn't those filter values be used as defaults for the fields when instantiating that object? On Mar 28, 3:14 pm, Xavier Lange [EMAIL PROTECTED] wrote: Hmm, that's very interesting. I