eql 0.0.1 → 0.0.2
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.
- checksums.yaml +4 -4
- data/README.md +7 -7
- data/lib/eql/proxy.rb +1 -1
- data/lib/eql/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e33f72aa2566593bd50d1c463141b7d9537b1c8
|
4
|
+
data.tar.gz: 4b3ad6517ece31d344173518e79ccd027f07e0c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea8ca0cb04bbc77c9fee071dd06baf02ec825a05987bcd8e44e2ca50cde1427d16b0d3d98296da13e0c43f73ad0a286e9ee76863d5797b9bc2504637e528ea95
|
7
|
+
data.tar.gz: b301f3a1dac9231422892b655946b92ca567f102fcc6133977f74ef38ddd892f87c5f9c20e92f8b0f1b04ab6fe8187e83109bdbea80dd028b90ddc5e5dc3c7e6
|
data/README.md
CHANGED
@@ -20,17 +20,17 @@ gem 'eql'
|
|
20
20
|
### Simple usage
|
21
21
|
|
22
22
|
```erb
|
23
|
-
# queries/
|
23
|
+
# queries/insert.sql.erb
|
24
24
|
<% each do |item| %>
|
25
25
|
INSERT INTO items (category, name)
|
26
|
-
VALUES (<%= item.values_at(:category, :name).map { |i| quote(i) }.join(', ')
|
27
|
-
ON CONFILICT (category, name) DO NOTHING
|
26
|
+
VALUES (<%= item.values_at(:category, :name).map { |i| quote(i) }.join(', ') %>)
|
27
|
+
ON CONFILICT (category, name) DO NOTHING;
|
28
28
|
<% end %>
|
29
29
|
```
|
30
30
|
|
31
31
|
```ruby
|
32
32
|
b = Eql.new('queries')
|
33
|
-
b.execute(
|
33
|
+
b.execute(:insert, [{category: 'cars', name: 'BMW'}, {category: 'cars', name: 'AUDI'}])
|
34
34
|
```
|
35
35
|
|
36
36
|
### Inline templates
|
@@ -41,7 +41,7 @@ b = Eql.template <<-ERB
|
|
41
41
|
FROM customer c
|
42
42
|
LEFT JOIN products p ON (c.id = p.customer_id)
|
43
43
|
WHERE c.id = <%= quote(id) %>
|
44
|
-
|
44
|
+
ERB
|
45
45
|
b.execute_params(id: 74)
|
46
46
|
```
|
47
47
|
|
@@ -70,7 +70,7 @@ SELECT *
|
|
70
70
|
|
71
71
|
### Create your own adapter
|
72
72
|
|
73
|
-
```
|
73
|
+
```ruby
|
74
74
|
class BashAdapter < Eql::Adapters::Base
|
75
75
|
def self.match?(conn)
|
76
76
|
conn == :my_bash
|
@@ -97,7 +97,7 @@ b.template <<-COMMAND
|
|
97
97
|
ls folder/*
|
98
98
|
COMMAND
|
99
99
|
b.execute_params(folder: 'units')
|
100
|
-
|
100
|
+
```
|
101
101
|
|
102
102
|
### Adapters
|
103
103
|
Now implemented only `ActiveRecord` adapter. Please, fill free to contribute on
|
data/lib/eql/proxy.rb
CHANGED
data/lib/eql/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eql
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Oleg Yashchuk
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -80,7 +80,7 @@ dependencies:
|
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
|
-
description:
|
83
|
+
description: Erb provides an ability to use ERB templates with your DB queries
|
84
84
|
email:
|
85
85
|
- oazoer@gmail.com
|
86
86
|
executables: []
|