lib/sequel/adapters/odbc/mssql.rb in sequel-4.49.0 vs lib/sequel/adapters/odbc/mssql.rb in sequel-5.0.0
- old
+ new
@@ -1,8 +1,8 @@
# frozen-string-literal: true
-Sequel.require 'adapters/shared/mssql'
+require_relative '../shared/mssql'
module Sequel
module ODBC
Sequel.synchronize do
DATABASE_SETUP[:mssql] = proc do |db|
@@ -10,19 +10,14 @@
db.dataset_class = Sequel::ODBC::MSSQL::Dataset
db.send(:set_mssql_unicode_strings)
end
end
- # Database and Dataset instance methods for MSSQL specific
- # support via ODBC.
module MSSQL
module DatabaseMethods
include Sequel::MSSQL::DatabaseMethods
- LAST_INSERT_ID_SQL='SELECT SCOPE_IDENTITY()'.freeze
- Sequel::Deprecation.deprecate_constant(self, :LAST_INSERT_ID_SQL)
-
- # Return the last inserted identity value.
+
def execute_insert(sql, opts=OPTS)
synchronize(opts[:server]) do |conn|
begin
log_connection_yield(sql, conn){conn.do(sql)}
begin
@@ -41,16 +36,13 @@
end
end
class Dataset < ODBC::Dataset
include Sequel::MSSQL::DatasetMethods
- # Use ODBC format, not Microsoft format, as the ODBC layer does
- # some translation. MSSQL version is over-ridden to allow 3 millisecond decimal places
- TIMESTAMP_FORMAT="{ts '%Y-%m-%d %H:%M:%S%N'}".freeze
- Sequel::Deprecation.deprecate_constant(self, :TIMESTAMP_FORMAT)
-
private
+ # Use ODBC format, not Microsoft format, as the ODBC layer does
+ # some translation, but allow for millisecond precision.
def default_timestamp_format
"{ts '%Y-%m-%d %H:%M:%S%N'}"
end
# Use ODBC format, not Microsoft format, as the ODBC layer does