Skip to content

Commit

Permalink
change version to 1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
elengine committed Jun 14, 2020
1 parent 91092e2 commit 043916b
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 9 deletions.
10 changes: 7 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,19 @@ straightforward as possible.

### Security

## [1.1.0] - 2020-06-14

Executes any SQL statement with comments.

### Added
- Added pgpool_nlb option to AR #execute.

## [1.0.3] - 2020-05-05

for RubyGems release.

## [1.0.2] - 2020-05-05

Here we write upgrading notes for brands. It's a team effort to make them as
straightforward as possible.

### Added
- Adapter check feature. (PostgreSQLAdapterMissing exception is raised if the application is not using the Postgresql adaptor.)

Expand Down
27 changes: 22 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,28 @@ If you don't want a query that qualifies for the load balancing to be load balan

Add this line to your application's Gemfile:

```ruby
```rb
gem 'pgpool_no_load_balance'
```

And then execute:

$ bundle install
```console
$ bundle install
```

Or install it yourself as:

$ gem install pgpool_no_load_balance
```console
$ gem install pgpool_no_load_balance
```

## Usage

### pgpool_nlb method

Using the `pgpool_nlb` method will add a comment to the SQL.

```rb
irb(main):001:0> User.pgpool_nlb.all
/*NO LOAD BALANCE*/ SELECT "users".* FROM "users" LIMIT $1 [["LIMIT", 11]]
Expand All @@ -33,6 +38,7 @@ irb(main):001:0> User.pgpool_nlb.all
### unscope

Can remove the scope with the unscope method.

```rb
irb(main):001:0> user_relation = User.where(name: 'elengine').pgpool_nlb

Expand All @@ -43,10 +49,21 @@ irb(main):003:0> user_relation.unscope(:pgpool_nlb).order(:id).limit(3)
SELECT "users".* FROM "users" WHERE "users"."name" = $1 ORDER BY "users"."id" ASC LIMIT $2 [["name", "elengine"], ["LIMIT", 3]]
```

## Contributing
### Arbitrary SQL execution

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).
Using the `pgpool_nlb` option of the execute method will add a comment to the SQL.

```rb
irb(main):001:0> ActiveRecord::Base.connection.execute('SELECT 1')
SELECT 1

irb(main):002:0> ActiveRecord::Base.connection.execute('SELECT 1', pgpool_nlb: true)
/*NO LOAD BALANCE*/ SELECT 1
```

## Contributing

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).

## License

Expand Down
2 changes: 1 addition & 1 deletion lib/pgpool_no_load_balance/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module PgpoolNoLoadBalance
VERSION = "1.0.3"
VERSION = "1.1.0"
end

0 comments on commit 043916b

Please sign in to comment.