Module: DataMapper::Adapters::DataObjectsAdapter::SQL

Included in:
DataMapper::Adapters::DataObjectsAdapter
Defined in:
lib/dm-do-adapter/adapter.rb

Overview

This module is just for organization. The methods are included into the Adapter below.

Constant Summary collapse

IDENTIFIER_MAX_LENGTH =

:nodoc:

128
QUESTION_MARK =
'?'.freeze
GT_OPERATOR =
'>'.freeze
LT_OPERATOR =
'<'.freeze
GTE_OPERATOR =
'>='.freeze
LTE_OPERATOR =
'<='.freeze
IS_OPERATOR =
'IS'.freeze
EQ_OPERATOR =
'='.freeze
IN_OPERATOR =
'IN'.freeze
BETWEEN_OPERATOR =
'BETWEEN'.freeze
REGEXP_OPERATOR =
'~'.freeze
LIKE_OPERATOR =
'LIKE'.freeze
NULL_KEYWORD =
'NULL'.freeze
AND_KEYWORD =
' AND '.freeze
ON_KEYWORD =
'ON'.freeze
COLUMN_SEPARATOR =
', '.freeze
SPACE =
' '.freeze
ONE_EQ_ZERO =
'1 = 0'.freeze
SINGLE_QUOTE =
/"/.freeze
DOUBLE_QUOTE =
'""'.freeze

Instance Method Summary collapse

Instance Method Details

#property_to_column_name(property, qualify) ⇒ Object



334
335
336
337
338
339
340
341
342
343
344
345
346
# File 'lib/dm-do-adapter/adapter.rb', line 334

def property_to_column_name(property, qualify)
  column_name = quote_name(property.field)

  case qualify
  when true
    "#{quote_name(property.model.storage_name(name))}.#{column_name}"
  when String
    "#{quote_name(qualify)}.#{column_name}"
  else
    column_name
  end

end