lib/og/adapter.rb in og-0.13.0 vs lib/og/adapter.rb in og-0.14.0
- old
+ new
@@ -1,16 +1,26 @@
# * George Moschovitis <gm@navel.gr>
# (c) 2004-2005 Navel, all rights reserved.
-# $Id: adapter.rb 281 2005-03-10 12:24:14Z gmosx $
+# $Id: adapter.rb 323 2005-03-24 09:43:52Z gmosx $
require 'yaml'
require 'singleton'
require 'og/connection'
module Og
+# Encapsulates a lower lever adapter SQL excpetion.
+
+class SqlException < Exception
+ attr_accessor :adapter_exception, :sql
+
+ def initialize(adapter_exception, sql = nil)
+ @adapter_exception, @sql = adapter_exception, sql
+ end
+end
+
# An adapter communicates with the backend datastore.
# The adapters for all supported datastores extend this
# class. Typically, an RDBMS is used to implement a
# datastore.
@@ -113,10 +123,11 @@
# Create the database.
def create_db(database, user = nil, password = nil)
Logger.info "Creating database '#{database}'."
+ Og.create_schema = true
end
# Drop the database.
def drop_db(database, user = nil, password = nil)
@@ -498,10 +509,10 @@
end
end
end
klass.class_eval %{
- def og_read(res, tuple = nil)
+ def og_read(res, tuple = 0)
#{pre_cb}
#{code.join('; ')}
#{post_cb}
end
}