An ActiveRecord Firebird adapter, based on the FireRuby extension, has been submitted as a Rails patch (#1874)
This page provides instructions on how you can “beta test” the new adapter.
TIMESTAMP column type was being mapped to the ActiveRecord :timestamp type, instead of :datetime as it should be. Thanks Peter Jagielski for the catch! A fix has been posted to the ticket, and an updated zip file is available below (step 3 in next section).$ gem install rails -r -v ‘0.13.1’
$ rails path-to-your-rails-app
vendor subdirectory of your Rails application directory. You should now have an rails subdirectory directly under vendor.The Firebird Adapter depends on the FireRuby extension (>= 0.3.2) for connecting to a Firebird database from Ruby. FireRuby is available as a gem:
$ gem install fireruby -r -v ‘0.3.2’
aliases.conf file for your ActiveRecord database(s).database.yml file found in the config subdirectory of your Rails app directory. See example at the end of this page or additional example Firebird sample database.yml.your-rails-app/vendor/rails/activerecord/doc.table_name_seq. So if you have a users table, you would need to create a corresponding users_seq generator:CREATE GENERATOR users_seq;
generator CLIENTS_SEQ is not definedwhen testing my clients table so I had to use an uppercase name for the generator to work when testing. So the example should read:
CREATE GENERATOR USERS_SEQ;
database.yml for Firebirddevelopment: adapter: firebird database: rails_development host: localhost username: rails password: rails # Warning: The database defined as 'test' will be erased and # re-generated from your development database when you run 'rake'. # Do not set this db to the same as development or production. test: adapter: firebird database: rails_test host: localhost username: rails password: rails
In Windows (specifically XP, but i think correct for all NT versions)
Ruby.exe can give you error that I can not find fbclient.dll.
This file is used by clients to reach firebird. In default installation it is in
“C:\Program Files\Firebird\Firebird_1_5\bin\fbclient.dll”
C:\WINDOWS\system32.
If you forget add your database’s name to aliases.conf, found in
“C:\Program Files\Firebird\Firebird_1_5\aliases.conf”
blog_development = G:\projects\DB_files\YOUR_DATABASE.GDB
If you have questions/comments about testing the adapter, post them here or to the Rails mailing list. If you have questions/comments relating to implementation details of the adapter, please post them to the ticket.
Using Firebird to store sessions 26 Jan 2006
There is currently a problem in the Firebird adapter regarding filed lengths of blobs that stops it from being used as the store for sessions. While this is being fixed in the adapter you can use this workaround:
Do not declare the session data field as blob but rather as a varchar. Make sure it is sufficient size to hold the session.
Using autocomplete with Firebird 04 Feb 2006
text_field_with_autocomplete does not work out of the box with Firebird. This is because the script generates a select statement that user the sql command LOWER that is not part of Firebird.
There are 2 workarounds to this:
DECLARE EXTERNAL FUNCTION LOWER
CSTRING
RETURNS CSTRING FREE_IT
ENTRY_POINT ‘IB_UDF_lower’ MODULE_NAME ‘ib_udf’
def auto_complete_for_user_name
lookup = params[:user][:name]
users = User.find(:all, :conditions => [ 'UPPER(name) LIKE ?', '%' + lookup.upcase + '%' ]) render :inline => "<%= auto_complete_result(users, ’name’) %>"
end
An ActiveRecord Firebird adapter, based on the FireRuby extension, has been submitted as a Rails patch (#1874)
This page provides instructions on how you can “beta test” the new adapter.
TIMESTAMP column type was being mapped to the ActiveRecord :timestamp type, instead of :datetime as it should be. Thanks Peter Jagielski for the catch! A fix has been posted to the ticket, and an updated zip file is available below (step 3 in next section).$ gem install rails -r -v ‘0.13.1’
$ rails path-to-your-rails-app
vendor subdirectory of your Rails application directory. You should now have an rails subdirectory directly under vendor.The Firebird Adapter depends on the FireRuby extension (>= 0.3.2) for connecting to a Firebird database from Ruby. FireRuby is available as a gem:
$ gem install fireruby -r -v ‘0.3.2’
aliases.conf file for your ActiveRecord database(s).database.yml file found in the config subdirectory of your Rails app directory. See example at the end of this page or additional example Firebird sample database.yml.your-rails-app/vendor/rails/activerecord/doc.table_name_seq. So if you have a users table, you would need to create a corresponding users_seq generator:CREATE GENERATOR users_seq;
generator CLIENTS_SEQ is not definedwhen testing my clients table so I had to use an uppercase name for the generator to work when testing. So the example should read:
CREATE GENERATOR USERS_SEQ;
database.yml for Firebirddevelopment: adapter: firebird database: rails_development host: localhost username: rails password: rails # Warning: The database defined as 'test' will be erased and # re-generated from your development database when you run 'rake'. # Do not set this db to the same as development or production. test: adapter: firebird database: rails_test host: localhost username: rails password: rails
In Windows (specifically XP, but i think correct for all NT versions)
Ruby.exe can give you error that I can not find fbclient.dll.
This file is used by clients to reach firebird. In default installation it is in
“C:\Program Files\Firebird\Firebird_1_5\bin\fbclient.dll”
C:\WINDOWS\system32.
If you forget add your database’s name to aliases.conf, found in
“C:\Program Files\Firebird\Firebird_1_5\aliases.conf”
blog_development = G:\projects\DB_files\YOUR_DATABASE.GDB
If you have questions/comments about testing the adapter, post them here or to the Rails mailing list. If you have questions/comments relating to implementation details of the adapter, please post them to the ticket.
Using Firebird to store sessions 26 Jan 2006
There is currently a problem in the Firebird adapter regarding filed lengths of blobs that stops it from being used as the store for sessions. While this is being fixed in the adapter you can use this workaround:
Do not declare the session data field as blob but rather as a varchar. Make sure it is sufficient size to hold the session.
Using autocomplete with Firebird 04 Feb 2006
text_field_with_autocomplete does not work out of the box with Firebird. This is because the script generates a select statement that user the sql command LOWER that is not part of Firebird.
There are 2 workarounds to this:
DECLARE EXTERNAL FUNCTION LOWER
CSTRING
RETURNS CSTRING FREE_IT
ENTRY_POINT ‘IB_UDF_lower’ MODULE_NAME ‘ib_udf’
def auto_complete_for_user_name
lookup = params[:user][:name]
users = User.find(:all, :conditions => [ 'UPPER(name) LIKE ?', '%' + lookup.upcase + '%' ]) render :inline => "<%= auto_complete_result(users, ’name’) %>"
end