oracle_enhanced adapter version 1.2.3 released

23 views
Skip to first unread message

Raimonds Simanovskis

unread,
Dec 9, 2009, 4:29:31 PM12/9/09
to Oracle enhanced adapter for ActiveRecord
I have released new version 1.2.3 of adapter with some bug fixes and
some new features and also tested it with Rails version 2.3.5. Full
list of changes can be found at http://github.com/rsim/oracle-enhanced/blob/master/History.txt

Here are the main new features:

* You can use ENV['TZ'] to set up both Ruby and also Oracle database
session time zone. Include e.g.
ENV['TZ'] = 'Europe/Riga'
in some initializer file and then both Time.local will be in this time
zone as well as ALTER SESSION SET time_zone='Europe/Riga' will be
executed after establishing of database session.

It is highly recommended to use it as otherwise by default database
session time zone might not be set correctly - e.g. in my case
database session time zone was set with current constant offset from
GMT and did not support daylight saving time zone.

* You can use cache_columns option to speed up request processing in
development environment. E.g. in initializer include:

if RAILS_ENV == 'development'

ActiveRecord::ConnectionAdapters::OracleEnhancedAdapter.cache_columns
= true
end

and then adapter will not select column information for all tables
from database for each request which might take some time (especially
if database is not located on local computer), column information will
be cached. But you need to remember that if you will change database
schema then you need to restart your application server (i.e. restart
script/server).

* set_integer_columns and set_string_columns model class methods

When using some legacy schema then you might have some NUMBER(1)
column which should be used as integer (and not boolean) or some
NUMBER column without precision which also should be converted to
integer and not decimal. In these cases you can override column type
in model class definition with e.g.:

set_integer_columns :short_int, :other_column

If you use
ActiveRecord::ConnectionAdapters::OracleEnhancedAdapter.emulate_booleans_from_strings
= true
then maybe you have some VARCHAR2(1) column that still should be
string and not boolean, then you can override type definition as well,
e.g.:

set_string_columns :string_flag

I remind that previously there were already similar methods for other
data types - set_date_columns, set_datetime_columns,
set_boolean_columns

* In addition I wanted to mention that I decided to stop using
Lighthouse issue tracking and also RubyForge. Now if you have some
specific bug then you can report it at http://github.com/rsim/oracle-enhanced/issues.
If there are some general questions then please use this discussion
forum.

And as you probably have heard now RubyForge is not hosting gems
anymore and therefore I have migrated gem hosting to Gemcutter (which
is default source for gems anyway).

Raimonds
Reply all
Reply to author
Forward
0 new messages