0
- attr_reader :
text, :timeout, :connection
0
+ attr_reader :
connection
0
# initialize creates a new Command object
0
def initialize(connection, text)
0
@@ -9,125 +9,21 @@ module DataObjects
0
def execute_non_query(*args)
0
- raise
LostConnectionError, "the connection to the database has been lost" if @connection.closed?0
+ raise
NotImplementedError.new0
def execute_reader(*args)
0
- raise
LostConnectionError, "the connection to the database has been lost" if @connection.closed?0
+ raise
NotImplementedError.new0
- raise NotImplementedError
0
+ def set_types(column_types)
0
+ raise NotImplementedError.new
0
- # Escape a string of SQL with a set of arguments.
0
- # The first argument is assumed to be the SQL to escape,
0
- # the remaining arguments (if any) are assumed to be
0
- # values to escape and interpolate.
0
- # escape_sql("SELECT * FROM zoos")
0
- # # => "SELECT * FROM zoos"
0
- # escape_sql("SELECT * FROM zoos WHERE name = ?", "Dallas")
0
- # # => "SELECT * FROM zoos WHERE name = `Dallas`"
0
- # escape_sql("SELECT * FROM zoos WHERE name = ? AND acreage > ?", "Dallas", 40)
0
- # # => "SELECT * FROM zoos WHERE name = `Dallas` AND acreage > 40"
0
- # This method is meant mostly for adapters that don't support
0
- sql.gsub!(/\?/) do |x|
0
- quote_value(args.shift)
0
- def quote_value(value)
0
- return 'NULL' if value.nil?
0
- when Numeric then quote_numeric(value)
0
- when String then quote_string(value)
0
- when Class then quote_class(value)
0
- when Time then quote_time(value)
0
- when DateTime then quote_datetime(value)
0
- when Date then quote_date(value)
0
- when TrueClass, FalseClass then quote_boolean(value)
0
- when Array then quote_array(value)
0
- when Symbol then quote_symbol(value)
0
- if value.respond_to?(:to_sql)
0
- raise "Don't know how to quote #{value.inspect}"
0
- def quote_symbol(value)
0
- quote_string(value.to_s)
0
- def quote_numeric(value)
0
- def quote_string(value)
0
- "'#{value.gsub("'", "''")}'"
0
- def quote_class(value)
0
- "'#{value.xmlschema}'"
0
- def quote_datetime(value)
0
- "'#{value.strftime("%Y-%m-%d")}'"
0
- def quote_boolean(value)
0
- def quote_array(value)
0
- "(#{value.map { |entry| quote_value(entry) }.join(', ')})"
0
- class NotImplementedError < StandardError; end
0
- class ConnectionFailed < StandardError; end
0
- class ReaderClosed < StandardError; end
0
- class ReaderError < StandardError; end
0
- class QueryError < StandardError; end
0
- class NoInsertError < StandardError; end
0
- class LostConnectionError < StandardError; end
0
- class UnknownError < StandardError; end
0
\ No newline at end of file
Comments
No one has commented yet.