Class: MassInsert::Builder::Adapters::SQLServerAdapter
- Defined in:
- lib/mass_insert/builder/adapters/sqlserver_adapter.rb
Instance Attribute Summary
Attributes inherited from Adapter
Instance Method Summary collapse
-
#string_columns ⇒ Object
Returns a basic part of the query with the columns definition.
-
#timestamp_format ⇒ Object
The method is overwrited because the timestamp format to SQLServer adapter needs accuracy with three nanoseconds.
-
#values_per_insertion ⇒ Object
Returns the amount of records to each query.
Methods inherited from Adapter
#columns, #initialize, #method_missing, #sanitized_columns, #timestamp, #timestamp?, #timestamp_hash
Methods included from Helpers::AbstractQuery
#begin_string, #execute, #string_rows_values, #string_single_row_values, #string_single_value, #string_values
Constructor Details
This class inherits a constructor from MassInsert::Builder::Adapters::Adapter
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class MassInsert::Builder::Adapters::Adapter
Instance Method Details
#string_columns ⇒ Object
Returns a basic part of the query with the columns definition.
7 8 9 |
# File 'lib/mass_insert/builder/adapters/sqlserver_adapter.rb', line 7 def string_columns "([#{columns.join("], [")}]) " end |
#timestamp_format ⇒ Object
The method is overwrited because the timestamp format to SQLServer adapter needs accuracy with three nanoseconds.
19 20 21 |
# File 'lib/mass_insert/builder/adapters/sqlserver_adapter.rb', line 19 def "%Y-%m-%d %H:%M:%S.%3N" end |
#values_per_insertion ⇒ Object
Returns the amount of records to each query. Tries to take the each_slice option value or 1000 due it’s a standard in SQLServer.
13 14 15 |
# File 'lib/mass_insert/builder/adapters/sqlserver_adapter.rb', line 13 def values_per_insertion each_slice || 1000 end |