Hi, Does anybody using rails with firebird database? I found suppose that controller should be here http://moriq.tdiary.net/20050330.html but for born slav it''s litlle bit mysterious :) interbase controller is not in default installation (rails-0.11.0-r1 on gentoo linux) BTW Can I compile the controller without having firebird installled on same machine (just copy required lib from second computer?) Thank you :) _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
That adapeter doesn''t work. It''s a good start and I''m using it to build my own - probably a couple of weeks away from being finished (not enough hours in the day). Firebird has a few unique issues that need to be dealt with. I''m also updating the Interbase driver to work better with Rails (specifically adding in a rows_affected function to get the number of rows added/updated/deleted by a query, also fixing a nasty time/date issue in the driver). The interbase driver (and my update one) requires at least the client libraries to be built. Probably could be statically linked in order to remove that requirement but I''ve never tried to find out. John W Higgins develop-U23jnKMpDSxBDgjK7y7TUQ@public.gmane.org On Mon, 2005-04-18 at 22:53 +0000, Michal Koudelka wrote:> Hi, > > Does anybody using rails with firebird database? I found suppose that > controller should be here http://moriq.tdiary.net/20050330.html but > for born slav it''s litlle bit mysterious :) > > interbase controller is not in default installation (rails-0.11.0-r1 > on gentoo linux) > > BTW Can I compile the controller without having firebird installled on > same machine (just copy required lib from second computer?) > > Thank you :) > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails
Hi, Thank you for your message, I am looking foreward annoucnment about new adapter ;-) Mike On 4/19/05, John W Higgins <develop-U23jnKMpDSxBDgjK7y7TUQ@public.gmane.org> wrote:> > That adapeter doesn''t work. It''s a good start and I''m using it to build > my own - probably a couple of weeks away from being finished (not enough > hours in the day). Firebird has a few unique issues that need to be > dealt with. I''m also updating the Interbase driver to work better with > Rails (specifically adding in a rows_affected function to get the number > of rows added/updated/deleted by a query, also fixing a nasty time/date > issue in the driver). > > The interbase driver (and my update one) requires at least the client > libraries to be built. Probably could be statically linked in order to > remove that requirement but I''ve never tried to find out. > > John W Higgins > develop-U23jnKMpDSxBDgjK7y7TUQ@public.gmane.org > > On Mon, 2005-04-18 at 22:53 +0000, Michal Koudelka wrote: > > Hi, > > > > Does anybody using rails with firebird database? I found suppose that > > controller should be here http://moriq.tdiary.net/20050330.html but > > for born slav it''s litlle bit mysterious :) > > > > interbase controller is not in default installation (rails-0.11.0-r1 > > on gentoo linux) > > > > BTW Can I compile the controller without having firebird installled on > > same machine (just copy required lib from second computer?) > > > > Thank you :) > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Hi, John W Higgins <develop-U23jnKMpDSxBDgjK7y7TUQ@public.gmane.org> wrote:> That adapeter doesn''t work. It''s a good start and I''m using it to build > my own - probably a couple of weeks away from being finished (not enough > hours in the day). Firebird has a few unique issues that need to be > dealt with. I''m also updating the Interbase driver to work better with > Rails (specifically adding in a rows_affected function to get the number > of rows added/updated/deleted by a query, also fixing a nasty time/date > issue in the driver).I wrote rows_affected function. http://www.moriq.com/ruby/archive/ruby-interbase-0.07-rows_affected.patch (thanks Ed!) passed base_test.rb now: ruby -I connections\native_interbase base_test.rb ... 79 tests, 169 assertions, 0 failures, 0 errors but need to fix a nasty time/date issue. Thanks, ---- Kazuhiro Yoshida moriq-g2rar0VqK2oAvxtiuMwx3w@public.gmane.org
Hello, Kazuhiro Yoshida <moriq-g2rar0VqK2oAvxtiuMwx3w@public.gmane.org> wrote:> but need to fix a nasty time/date issue.I think that I cannot avoid using the dummy date value. I would like to ask your advice. interbase_adapter.rb (in my working): def quote(value, column = nil) # p [:quote, value.class, value, column && column.type] case value when String if column case column.type when :date value, timestr = value.split(/ /, 2) when :time datestr, value = value.split(/ /, 2) end end "''#{quote_string(value)}''" # '' (for ruby-mode) when NilClass "NULL" when TrueClass (column && column.type == :boolean) ? "''t''" : "1" when FalseClass (column && column.type == :boolean) ? "''f''" : "0" when Float, Fixnum, Bignum "''#{value.to_s}''" when Date, Time, DateTime format = if column case column.type when :date "%Y-%m-%d" when :time "%H:%M:%S" else "%Y-%m-%d %H:%M:%S" end else case value when Date "%Y-%m-%d" when Time if value.year == 2000 && value.month == 1 && value.day == 1 "%H:%M:%S" else "%Y-%m-%d %H:%M:%S" end else "%Y-%m-%d %H:%M:%S" end end "''#{value.strftime(format)}''" else "''#{quote_string(value.to_yaml)}''" end end ---- Kazuhiro Yoshida moriq-g2rar0VqK2oAvxtiuMwx3w@public.gmane.org
Yeah, it can be avoided - I''ve got it working at the moment. On the time side there are other issues like daylight savings time and such that are also needing to be dealt with. Datatypes like blob, decimal, numeric, (is null) vs (= null) are also not at 100%. I''d rather not try to parse the fixes one by one - I''m just going to post the entire adapter and patches when it''s ready (like I said hopefully within a couple of weeks). I''m really unhappy with timestamp storage (lack of timezone information is difficult) so I want to add better timestamping to the adapter/driver as well. John W Higgins develop-U23jnKMpDSxBDgjK7y7TUQ@public.gmane.org Quoting Kazuhiro Yoshida <moriq-g2rar0VqK2oAvxtiuMwx3w@public.gmane.org>:> Hello, > > Kazuhiro Yoshida <moriq-g2rar0VqK2oAvxtiuMwx3w@public.gmane.org> wrote: > > but need to fix a nasty time/date issue. > > I think that I cannot avoid using the dummy date value. > I would like to ask your advice. > > interbase_adapter.rb (in my working): > def quote(value, column = nil) > # p [:quote, value.class, value, column && column.type] > case value > when String > if column > case column.type > when :date > value, timestr = value.split(/ /, 2) > when :time > datestr, value = value.split(/ /, 2) > end > end > "''#{quote_string(value)}''" # '' (for ruby-mode) > when NilClass > "NULL" > when TrueClass > (column && column.type == :boolean) ? "''t''" : "1" > when FalseClass > (column && column.type == :boolean) ? "''f''" : "0" > when Float, Fixnum, Bignum > "''#{value.to_s}''" > when Date, Time, DateTime > format > if column > case column.type > when :date > "%Y-%m-%d" > when :time > "%H:%M:%S" > else > "%Y-%m-%d %H:%M:%S" > end > else > case value > when Date > "%Y-%m-%d" > when Time > if value.year == 2000 && value.month == 1 && value.day == 1 > "%H:%M:%S" > else > "%Y-%m-%d %H:%M:%S" > end > else > "%Y-%m-%d %H:%M:%S" > end > end > "''#{value.strftime(format)}''" > else > "''#{quote_string(value.to_yaml)}''" > end > end > > ---- > Kazuhiro Yoshida moriq-g2rar0VqK2oAvxtiuMwx3w@public.gmane.org > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program.
Hello, John W Higgins <develop-U23jnKMpDSxBDgjK7y7TUQ@public.gmane.org> wrote:> Yeah, it can be avoided - I''ve got it working at the moment. On the time side > there are other issues like daylight savings time and such that are also > needing to be dealt with. Datatypes like blob, decimal, numeric, (is null) vs > (= null) are also not at 100%. > > I''d rather not try to parse the fixes one by one - I''m just going to post the > entire adapter and patches when it''s ready (like I said hopefully within a > couple of weeks). I''m really unhappy with timestamp storage (lack of timezone > information is difficult) so I want to add better timestamping to the > adapter/driver as well.Now I see your point. Thank you for your help. ---- Kazuhiro Yoshida moriq-g2rar0VqK2oAvxtiuMwx3w@public.gmane.org