rebel 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rebel/sql.rb +12 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 484cad6b2851562dd80774e3249577df2bc3a6f4
|
4
|
+
data.tar.gz: ab2aff65c3a66184915f4fa396cc8c0d8bff42d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 82f4a246958333b03b0b201fd926dd62c18ff71d36ac8368b314f7c14d13f3f630f2cabca7ccd0ba7ace4c3f23b8a8e9e73e3ba6fb652768f50b79c4aa170de3
|
7
|
+
data.tar.gz: 2ef7487ccb43443f5167ec6260ba850573c9e3ca1109c0959d5c4b7ee27ad77a1beb7d4747234686b935b2703e374b01d85e2fe81ca4bbf4dce0efcde6188e3c
|
data/lib/rebel/sql.rb
CHANGED
@@ -13,7 +13,7 @@ module Rebel::SQL
|
|
13
13
|
exec(Rebel::SQL.drop_table(table_name))
|
14
14
|
end
|
15
15
|
|
16
|
-
def select(*fields, distinct:
|
16
|
+
def select(*fields, distinct: nil, from: nil, where: nil, inner: nil, left: nil, right: nil, group: nil, order: nil, limit: nil, offset: nil)
|
17
17
|
exec(Rebel::SQL.select(*fields,
|
18
18
|
distinct: distinct,
|
19
19
|
from: from,
|
@@ -105,10 +105,12 @@ module Rebel::SQL
|
|
105
105
|
def and(*clause)
|
106
106
|
Raw.new("#{self.parens?} AND #{Rebel::SQL.and_clause(*clause)}")
|
107
107
|
end
|
108
|
+
alias & and
|
108
109
|
|
109
110
|
def or(*clause)
|
110
111
|
Raw.new("#{self} OR #{Rebel::SQL.and_clause(*clause)}").wants_parens!
|
111
112
|
end
|
113
|
+
alias | or
|
112
114
|
|
113
115
|
def eq(n)
|
114
116
|
case n
|
@@ -130,6 +132,7 @@ module Rebel::SQL
|
|
130
132
|
end
|
131
133
|
end
|
132
134
|
alias != ne
|
135
|
+
alias is_not ne
|
133
136
|
|
134
137
|
def lt(n)
|
135
138
|
Raw.new("#{self} < #{Rebel::SQL.name_or_value(n)}")
|
@@ -155,9 +158,17 @@ module Rebel::SQL
|
|
155
158
|
Raw.new("#{self} IN (#{Rebel::SQL.values(*v)})")
|
156
159
|
end
|
157
160
|
|
161
|
+
def not_in(*v)
|
162
|
+
Raw.new("#{self} NOT IN (#{Rebel::SQL.values(*v)})")
|
163
|
+
end
|
164
|
+
|
158
165
|
def like(n)
|
159
166
|
Raw.new("#{self} LIKE #{Rebel::SQL.value(n)}")
|
160
167
|
end
|
168
|
+
|
169
|
+
def not_like(n)
|
170
|
+
Raw.new("#{self} NOT LIKE #{Rebel::SQL.value(n)}")
|
171
|
+
end
|
161
172
|
end
|
162
173
|
|
163
174
|
@identifier_quote = '"'
|