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 +4 -4
- data/CHANGELOG +4 -0
- data/lib/mini_sql/builder.rb +7 -5
- data/lib/mini_sql/postgres/connection.rb +1 -1
- data/lib/mini_sql/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df275ffff82e8f6fc97b466178d50bcb8e3d5af55167f811abce10356e248770
|
4
|
+
data.tar.gz: 7b943e8a2dca0d546c0140d0957d4712d4f11610f169caefcd01aa7ea8e75e9a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5fda186dcae83e032b1f120782edd86c8d1d7e276afeb040479fca4e5cc6a52e40499f45df5c9a3303c7823e0e9fed128c17b422bdd12903fa50c4198732c25b
|
7
|
+
data.tar.gz: affcf46e3c8cfffd001fbef3c5d49f938c694a7b85412df7855938fb1326330a386d0557021bd2b1156f7e0bd10a6c1c560cc171190e0ff21e5a06e3375ee984
|
data/CHANGELOG
CHANGED
data/lib/mini_sql/builder.rb
CHANGED
@@ -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
|
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["
|
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 :
|
87
|
+
joined = (+"LIMIT :mq_auto_limit")
|
86
88
|
when :offset
|
87
|
-
joined = (+"OFFSET :
|
89
|
+
joined = (+"OFFSET :mq_auto_offset")
|
88
90
|
when :order_by
|
89
91
|
joined = (+"ORDER BY ") << v.join(" , ")
|
90
92
|
when :group_by
|
data/lib/mini_sql/version.rb
CHANGED