mini_sql 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7ce3e8b5fee8c39506de8439826252434ddce6249287bb3a74c411a41a5e5726
4
- data.tar.gz: cbab24b31bbf55e39cb824224e694e117b42c30e20189f64ffd2163cab3e12b6
3
+ metadata.gz: df275ffff82e8f6fc97b466178d50bcb8e3d5af55167f811abce10356e248770
4
+ data.tar.gz: 7b943e8a2dca0d546c0140d0957d4712d4f11610f169caefcd01aa7ea8e75e9a
5
5
  SHA512:
6
- metadata.gz: f01c57922c3ead43474e02585c365b914880ef6924f7acce041e2ee0e984217eadf4aa25f81a0c0c79ee2b9de7235311a2d7155be1a512f2f545d6fbe81ab6e5
7
- data.tar.gz: 47de031da6a0efaeded3981fa2eadefd4a5261cbef73f2fcfb998dd1e671c6c19015a2b97ef70d7311d847558934f8ec8fe6678f2d665cc8ad6dffe6d10a879d
6
+ metadata.gz: 5fda186dcae83e032b1f120782edd86c8d1d7e276afeb040479fca4e5cc6a52e40499f45df5c9a3303c7823e0e9fed128c17b422bdd12903fa50c4198732c25b
7
+ data.tar.gz: affcf46e3c8cfffd001fbef3c5d49f938c694a7b85412df7855938fb1326330a386d0557021bd2b1156f7e0bd10a6c1c560cc171190e0ff21e5a06e3375ee984
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ 2021-03-22 - 1.1.1
2
+
3
+ - FIX: compatability with ActiveRecord param encoder
4
+
1
5
  2021-03-22 - 1.1.0
2
6
 
3
7
  - FEATURE: added new APIs to support prepared statements
@@ -17,9 +17,11 @@ class MiniSql::Builder
17
17
  @args.merge!(args[0])
18
18
  else # convert simple params to hash
19
19
  args.each do |v|
20
- param = "_m_#{@count_variables += 1}"
20
+ # for compatability with AR param encoded we keep a non _
21
+ # prefix (must be [a-z])
22
+ param = "mq_auto_#{@count_variables += 1}"
21
23
  sql_part = sql_part.sub('?', ":#{param}")
22
- @args[param] = v
24
+ @args[param.to_sym] = v
23
25
  end
24
26
  end
25
27
 
@@ -31,7 +33,7 @@ class MiniSql::Builder
31
33
 
32
34
  [:limit, :offset].each do |k|
33
35
  define_method k do |value|
34
- @args["_m_#{k}"] = value
36
+ @args["mq_auto_#{k}".to_sym] = value
35
37
  @sections[k] = true
36
38
  self
37
39
  end
@@ -82,9 +84,9 @@ class MiniSql::Builder
82
84
  when :left_join
83
85
  joined = v.map { |item| (+"LEFT JOIN ") << item }.join("\n")
84
86
  when :limit
85
- joined = (+"LIMIT :_m_limit")
87
+ joined = (+"LIMIT :mq_auto_limit")
86
88
  when :offset
87
- joined = (+"OFFSET :_m_offset")
89
+ joined = (+"OFFSET :mq_auto_offset")
88
90
  when :order_by
89
91
  joined = (+"ORDER BY ") << v.join(" , ")
90
92
  when :group_by
@@ -3,7 +3,7 @@
3
3
  module MiniSql
4
4
  module Postgres
5
5
  class Connection < MiniSql::Connection
6
- attr_reader :raw_connection, :type_map, :param_encoder
6
+ attr_reader :raw_connection, :param_encoder
7
7
 
8
8
  def self.default_deserializer_cache
9
9
  @deserializer_cache ||= DeserializerCache.new
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module MiniSql
3
- VERSION = "1.1.0"
3
+ VERSION = "1.1.1"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mini_sql
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Saffron