Sha256: c7edce4d2e6d79b558b2961e5c8ebf42f7b98cdb14f4cfc63fe7c4461384cc51
Contents?: true
Size: 1.13 KB
Versions: 2
Compression:
Stored size: 1.13 KB
Contents
# arel-mysql-index-hint Add index hint to MySQL query in Arel. [![Gem Version](https://badge.fury.io/rb/arel-mysql-index-hint.svg)](http://badge.fury.io/rb/arel-mysql-index-hint) [![Build Status](https://travis-ci.org/winebarrel/arel-mysql-index-hint.svg?branch=master)](https://travis-ci.org/winebarrel/arel-mysql-index-hint) [![Coverage Status](https://img.shields.io/coveralls/winebarrel/arel-mysql-index-hint.svg)](https://coveralls.io/r/winebarrel/arel-mysql-index-hint?branch=master) ## Installation Add this line to your application's Gemfile: ```ruby gem 'arel-mysql-index-hint' ``` And then execute: $ bundle Or install it yourself as: $ gem install arel-mysql-index-hint ## Usage ```ruby Article.hint(idx_article: :force) # => "SELECT `articles`.* FROM `articles` force INDEX (idx_article)" Article.joins(:comments).hint(articles: {idx_article: :use}) # => "SELECT `articles`.* FROM `articles` use INDEX (idx_article) INNER JOIN `comments` ON `comments` Article.joins(:comments).hint(comments: {idx_comment: :force}) # => "SELECT `articles`.* FROM `articles` INNER JOIN `comments` force INDEX (idx_comment) ON `comments" ```
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
arel-mysql-index-hint-0.1.2 | README.md |
arel-mysql-index-hint-0.1.1 | README.md |