Module: Sequel::MSSQL::DatasetMethods

Module | Sequel::MSSQL::DatasetMethods
In: | lib/sequel_core/adapters/shared/mssql.rb

### Methods

complex_expression_sql full_text_search literal multi_insert_sql nolock quoted_identifier

### Included Modules

Dataset::UnsupportedIntersectExcept

### Constants

SELECT_CLAUSE_ORDER | = | %w'limit distinct columns from with join where group order having compounds'.freeze

### Public Instance methods

complex_expression_sql(op, args)

[Source]

        # File lib/sequel_core/adapters/shared/mssql.rb, line 42
    42:       def complex_expression_sql(op, args)
    43:         case op
    44:         when '||''||'
    45:           super(:+, args)
    46:         else
    47:           super(op, args)
    48:         end
    49:       end

full_text_search(cols, terms, opts = {})

[Source]

        # File lib/sequel_core/adapters/shared/mssql.rb, line 51
    51:       def full_text_search(cols, terms, opts = {})
    52:         filter("CONTAINS (#{literal(cols)}, #{literal(terms)})")
    53:       end

literal(v)

[Source]

        # File lib/sequel_core/adapters/shared/mssql.rb, line 55
    55:       def literal(v)
    56:         case v
    57:         when LiteralString
    58:           v
    59:         when String
    60:           "N#{super}"
    61:         when Time
    62:           literal(v.iso8601)
    63:         when Date, DateTime
    64:           literal(v.to_s)
    65:         else
    66:           super
    67:         end
    68:       end

multi_insert_sql(columns, values)

[Source]

        # File lib/sequel_core/adapters/shared/mssql.rb, line 70
    70:       def multi_insert_sql(columns, values)
    71:         values = values.map {|r| "SELECT #{expression_list(r)}" }.join(" UNION ALL ")
    72:         ["INSERT INTO #{source_list(@opts[:from])} (#{identifier_list(columns)}) #{values}"]
    73:       end

nolock()

Allows you to do .nolock on a query

[Source]

        # File lib/sequel_core/adapters/shared/mssql.rb, line 76
    76:       def nolock
    77:         clone(:with => "(NOLOCK)")
    78:       end

quoted_identifier(name)

[Source]

        # File lib/sequel_core/adapters/shared/mssql.rb, line 80
    80:       def quoted_identifier(name)
    81:         "[#{name}]"
    82:       end

[Validate]