Sha256: c3d5b73fea996821881f3092ec82329c2fa35e198999639f67eacb6ecda1da4d

Contents?: true

Size: 711 Bytes

Versions: 1

Compression:

Stored size: 711 Bytes

Contents

module MassInsert
  module Builder
    module Adapters
      class SQLServerAdapter < Adapter

        # Returns a basic part of the query with the columns definition.
        def string_columns
          "([#{columns.join("], [")}]) "
        end

        # 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.
        def values_per_insertion
          each_slice || 1000
        end

        # The method is overwrited because the timestamp format to SQLServer
        # adapter needs accuracy with three nanoseconds.
        def timestamp_format
          "%Y-%m-%d %H:%M:%S.%3N"
        end

      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mass_insert-0.1.2 lib/mass_insert/builder/adapters/sqlserver_adapter.rb