pgpool_no_load_balance 1.0.3 → 1.1.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 140d4448dd6fb7939e899a8ce16a612a2464dd71a74d07e385de89f77a8cc592
|
4
|
+
data.tar.gz: ae1a1c76853f41b66905635040a6e2f5bb99cc37d87d003bef3d7dbebbd16038
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b7ce67970675febfe3e2c132c3e333d8aaf67c4cbfc036fe2614579885168dc1bc43eaf7696ba171d1c97a4bb82d4f70dde280d8da61e7da9a4cee885005a030
|
7
|
+
data.tar.gz: d10ede5d40c35c54c37e8c134b439f1df197069d5c936bf564fdd3c6b7deab6c9c120772b20a4017888ed56d67b57e7b79eaf394f0c0bab11b3942f121ece399
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
@@ -22,15 +22,19 @@ straightforward as possible.
|
|
22
22
|
|
23
23
|
### Security
|
24
24
|
|
25
|
+
## [1.1.0] - 2020-06-14
|
26
|
+
|
27
|
+
Executes any SQL statement with comments.
|
28
|
+
|
29
|
+
### Added
|
30
|
+
- Added pgpool_nlb option to AR #execute.
|
31
|
+
|
25
32
|
## [1.0.3] - 2020-05-05
|
26
33
|
|
27
34
|
for RubyGems release.
|
28
35
|
|
29
36
|
## [1.0.2] - 2020-05-05
|
30
37
|
|
31
|
-
Here we write upgrading notes for brands. It's a team effort to make them as
|
32
|
-
straightforward as possible.
|
33
|
-
|
34
38
|
### Added
|
35
39
|
- Adapter check feature. (PostgreSQLAdapterMissing exception is raised if the application is not using the Postgresql adaptor.)
|
36
40
|
|
data/README.md
CHANGED
@@ -8,24 +8,29 @@ If you don't want a query that qualifies for the load balancing to be load balan
|
|
8
8
|
|
9
9
|
Add this line to your application's Gemfile:
|
10
10
|
|
11
|
-
```
|
11
|
+
```rb
|
12
12
|
gem 'pgpool_no_load_balance'
|
13
13
|
```
|
14
14
|
|
15
15
|
And then execute:
|
16
16
|
|
17
|
-
|
17
|
+
```console
|
18
|
+
$ bundle install
|
19
|
+
```
|
18
20
|
|
19
21
|
Or install it yourself as:
|
20
22
|
|
21
|
-
|
23
|
+
```console
|
24
|
+
$ gem install pgpool_no_load_balance
|
25
|
+
```
|
22
26
|
|
23
27
|
## Usage
|
24
28
|
|
25
29
|
### pgpool_nlb method
|
26
30
|
|
27
31
|
Using the `pgpool_nlb` method will add a comment to the SQL.
|
28
|
-
|
32
|
+
|
33
|
+
```rb
|
29
34
|
irb(main):001:0> User.pgpool_nlb.all
|
30
35
|
/*NO LOAD BALANCE*/ SELECT "users".* FROM "users" LIMIT $1 [["LIMIT", 11]]
|
31
36
|
```
|
@@ -33,18 +38,32 @@ irb(main):001:0> User.pgpool_nlb.all
|
|
33
38
|
### unscope
|
34
39
|
|
35
40
|
Can remove the scope with the unscope method.
|
36
|
-
|
41
|
+
|
42
|
+
```rb
|
37
43
|
irb(main):001:0> user_relation = User.where(name: 'elengine').pgpool_nlb
|
44
|
+
|
38
45
|
irb(main):002:0> user_relation.count
|
39
46
|
/*NO LOAD BALANCE*/ SELECT COUNT(*) FROM "users" WHERE "users"."name" = $1 [["name", "elengine"]]
|
47
|
+
|
40
48
|
irb(main):003:0> user_relation.unscope(:pgpool_nlb).order(:id).limit(3)
|
41
49
|
SELECT "users".* FROM "users" WHERE "users"."name" = $1 ORDER BY "users"."id" ASC LIMIT $2 [["name", "elengine"], ["LIMIT", 3]]
|
42
50
|
```
|
43
51
|
|
44
|
-
|
52
|
+
### Arbitrary SQL execution
|
53
|
+
|
54
|
+
Using the `pgpool_nlb` option of the execute method will add a comment to the SQL.
|
55
|
+
|
56
|
+
```rb
|
57
|
+
irb(main):001:0> ActiveRecord::Base.connection.execute('SELECT 1')
|
58
|
+
SELECT 1
|
45
59
|
|
46
|
-
|
60
|
+
irb(main):002:0> ActiveRecord::Base.connection.execute('SELECT 1', pgpool_nlb: true)
|
61
|
+
/*NO LOAD BALANCE*/ SELECT 1
|
62
|
+
```
|
63
|
+
|
64
|
+
## Contributing
|
47
65
|
|
66
|
+
Bug reports and pull requests are welcome on GitHub at <https://github.com/elengine/pgpool_no_load_balance>. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/elengine/pgpool_no_load_balance/blob/master/CODE_OF_CONDUCT.md).
|
48
67
|
|
49
68
|
## License
|
50
69
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pgpool_no_load_balance
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- elengine
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-06-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|