Permalink
Browse files

Don't include primary key indexes when parsing MSSQL indexes on JDBC

  • Loading branch information...
1 parent c33499b commit dac14b8689c3ffd05d739a62cebe462864915e2f @jeremyevans jeremyevans committed Sep 9, 2009
Showing with 9 additions and 0 deletions.
  1. +2 −0 CHANGELOG
  2. +7 −0 lib/sequel/adapters/jdbc/mssql.rb
View
@@ -1,5 +1,7 @@
=== HEAD
+* Don't include primary key indexes when parsing MSSQL indexes on JDBC (jeremyevans)
+
* Make Dataset#insert_select return nil on PostgreSQL if disable_insert_returning is used (jeremyevans)
* Speed up execution of prepared statements with bound variables on MySQL (ibc@aliax.net)
@@ -12,6 +12,8 @@ class Database
module MSSQL
# Database instance methods for MSSQL databases accessed via JDBC.
module DatabaseMethods
+ PRIMARY_KEY_INDEX_RE = /\Apk__/i.freeze
+
include Sequel::MSSQL::DatabaseMethods
# Return instance of Sequel::JDBC::MSSQL::Dataset with the given opts.
@@ -40,6 +42,11 @@ def last_insert_id(conn, opts={})
def schema_parse_table(table, opts={})
jdbc_schema_parse_table(table, opts)
end
+
+ # Primary key indexes appear to start with pk__ on MSSQL
+ def primary_key_index_re
+ PRIMARY_KEY_INDEX_RE
+ end
end
# Dataset class for MSSQL datasets accessed via JDBC.

0 comments on commit dac14b8

Please sign in to comment.