Class: OrientDB::SQL::Insert

Inherits:
Object
  • Object
show all
Includes:
ClassClusterParametersMixin, FieldsValuesParametersMixin, UtilsMixin
Defined in:
lib/orientdb/sql/insert.rb

Instance Method Summary collapse

Methods included from FieldsValuesParametersMixin

#fields, #fields!, #values, #values!

Methods included from ClassClusterParametersMixin

#cluster, #oclass

Methods included from UtilsMixin

#field_name, #quote, #quote_regexp, #quote_string, #select_single_string

Constructor Details

#initializeInsert

Returns a new instance of Insert.



8
9
10
11
12
13
# File 'lib/orientdb/sql/insert.rb', line 8

def initialize
  @oclass  = nil
  @cluster = nil
  @fields  = []
  @values  = []
end

Instance Method Details

#to_sObject



15
16
17
# File 'lib/orientdb/sql/insert.rb', line 15

def to_s
  (target_sql(:insert_into) + fields_sql + values_sql).strip
end

#to_sql_commandObject



19
20
21
# File 'lib/orientdb/sql/insert.rb', line 19

def to_sql_command
  OrientDB::SQLCommand.new to_s
end