Skip to content

Commit

Permalink
Return OCI8::CLOB values as ruby Strings in the Oracle adapter
Browse files Browse the repository at this point in the history
This makes them treated similarly to blobs, which are returned
as instances of Sequel::SQL::Blob (a String subclass).
  • Loading branch information
jeremyevans committed Sep 24, 2012
1 parent d2167dc commit a828c78
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
=== HEAD

* Return OCI8::CLOB values as ruby Strings in the Oracle adapter (jeremyevans)

* Use clob for String :text=>true types on Oracle, DB2, HSQLDB, and Derby (jeremyevans) (#555)

* Allowing marshalling of Sequel::Postgres::HStore (jeremyevans) (#556)
Expand Down
5 changes: 4 additions & 1 deletion lib/sequel/adapters/oracle.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ class Database < Sequel::Database
# ORA-03114: not connected to ORACLE
CONNECTION_ERROR_CODES = [ 28, 1012, 3113, 3114 ]

ORACLE_TYPES = {:blob=>lambda{|b| Sequel::SQL::Blob.new(b.read)}}
ORACLE_TYPES = {
:blob=>lambda{|b| Sequel::SQL::Blob.new(b.read)},
:clob=>lambda{|b| b.read}
}

# Hash of conversion procs for this database.
attr_reader :conversion_procs
Expand Down

0 comments on commit a828c78

Please sign in to comment.