activerecord-yugabytedb-adapter 7.0.4.1 → 7.1.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,7 +12,7 @@ module ActiveRecord
12
12
  attr_reader :schema, :identifier
13
13
 
14
14
  def initialize(schema, identifier)
15
- @schema, @identifier = unquote(schema), unquote(identifier)
15
+ @schema, @identifier = Utils.unquote_identifier(schema), Utils.unquote_identifier(identifier)
16
16
  end
17
17
 
18
18
  def to_s
@@ -21,9 +21,9 @@ module ActiveRecord
21
21
 
22
22
  def quoted
23
23
  if schema
24
- YugabyteYSQL::Connection.quote_ident(schema) << SEPARATOR << YugabyteYSQL::Connection.quote_ident(identifier)
24
+ YSQL::Connection.quote_ident(schema) << SEPARATOR << YSQL::Connection.quote_ident(identifier)
25
25
  else
26
- YugabyteYSQL::Connection.quote_ident(identifier)
26
+ YSQL::Connection.quote_ident(identifier)
27
27
  end
28
28
  end
29
29
 
@@ -40,15 +40,6 @@ module ActiveRecord
40
40
  def parts
41
41
  @parts ||= [@schema, @identifier].compact
42
42
  end
43
-
44
- private
45
- def unquote(part)
46
- if part && part.start_with?('"')
47
- part[1..-2]
48
- else
49
- part
50
- end
51
- end
52
43
  end
53
44
 
54
45
  module Utils # :nodoc:
@@ -74,6 +65,14 @@ module ActiveRecord
74
65
  end
75
66
  YugabyteDB::Name.new(schema, table)
76
67
  end
68
+
69
+ def unquote_identifier(identifier)
70
+ if identifier && identifier.start_with?('"')
71
+ identifier[1..-2]
72
+ else
73
+ identifier
74
+ end
75
+ end
77
76
  end
78
77
  end
79
78
  end