Volver al ranking

plentz/lol_dba

Ruby

lol_dba is a small package of rake tasks that scan your application models and displays a list of columns that probably should be indexed. Also, it can generate .sql migration scripts.

railsdatabasemigrationssqlrubyruby-on-railsgemdatabase-migrations
Crecimiento de estrellas
Estrellas
1.6k
Forks
70
Crecimiento semanal
Issues
13
5001k1.5k
mar 2012dic 2016oct 2021jul 2026
ArtefactosRubyGemsgem install lol_dba
README

lol_dba ci Maintainability Test Coverage

lol_dba is a small package of rake tasks that scan your application models and displays a list of columns that probably should be indexed. Also, it can generate .sql migration scripts.

Quick example

To use lol_dba in the easiest way possible you have to do two things:

gem install lol_dba

Then run one of the following commands...

To display a migration for adding/removing all necessary indexes based on associations:

lol_dba db:find_indexes

To generate .sql files for your migrations inside db/migrate_sql folder:

lol_dba db:migrate_sql # defaults to all migrations
lol_dba db:migrate_sql[pending] # only pending migrations
lol_dba db:migrate_sql[20120221205526] # generate sql only for migration 20120221205526

Not-so-quick example

If you want to use lol_dba with rake, you should do a few more steps:

Add lol_dba to your Gemfile

gem "lol_dba"

Run the install command

bundle install

Use it the same way you use other rake commands

rake db:find_indexes
rake db:migrate_sql # defaults to all migrations
rake db:migrate_sql[pending] # only pending migrations
rake db:migrate_sql[20120221205526] # generate sql only for migration 20120221205526

Compatibility

Compatible with Ruby 2.x, Ruby 3.x and Rails 3.x, 4.x, 5.x, 6.x, 7.x and 8.x.

About primary_key

The primary key is always indexed. This is generally true for all storage engines that at all supports indexes.

For this reason, we no longer suggest to add indexes to primary keys.

Tests

To run lol_dba tests, just clone the repo and run:

bundle install && rake

Contributors

Most of the initial code came from rails_indexes and migration_sql_generator. Other people helped as well.

License

Lol DBA is released under the MIT license.

Repositorios relacionados
rails/rails

Ruby on Rails

RubyRubyGemsMIT Licenserailsmvc
rubyonrails.org
58.6k22.4k
discourse/discourse

A platform for community discussion. Free, open, simple.

RubyRubyGemsGNU General Public License v2.0discoursejavascript
discourse.org
47.5k9k
chatwoot/chatwoot

Open-source live-chat, email support, omni-channel desk. An alternative to Intercom, Zendesk, Salesforce Service Cloud etc. 🔥💬

RubyRubyGemsOthervuejsintercom
chatwoot.com/help-center
34.6k8.3k
gitlabhq/gitlabhq

GitLab CE Mirror | Please open new issues in our issue tracker on GitLab.com

RubyRubyGemsOtherrubygitlab
about.gitlab.com/getting-help/
24.5k5.9k
heartcombo/devise

Flexible authentication solution for Rails with Warden.

RubyRubyGemsMIT Licenserailsruby
24.3k5.5k
forem/forem

For empowering community 🌱

RubyRubyGemsGNU Affero General Public License v3.0feedbackdiscussion
forem.com
22.8k4.2k
diaspora/diaspora

A privacy-aware, distributed, open source social network.

RubyRubyGemsGNU Affero General Public License v3.0rubyrails
diasporafoundation.org
13.7k2.9k
activeadmin/activeadmin

The administration framework for Ruby on Rails applications.

RubyRubyGemsMIT Licenserubyactiveadmin
activeadmin.info
9.7k3.3k
primer/octicons

A scalable set of icons handcrafted with ❤️ by GitHub

JavaScriptnpmMIT Licensesvgocticons
primer.style/octicons/
8.7k838
kaminari/kaminari

⚡ A Scope & Engine based, clean, powerful, customizable and sophisticated paginator for Ruby webapps

RubyRubyGemsMIT Licenserubyrails
github.com/kaminari/kaminari/wiki
8.7k1.1k
gobuffalo/buffalo

Rapid Web Development w/ Go

GoGo ModulesMIT Licensegobuffalo
gobuffalo.io
8.4k583
heartcombo/simple_form

Forms made easy for Rails! It's tied to a simple DSL, with no opinion on markup.

RubyRubyGemsMIT Licenseform-builderrails-helper
8.2k1.3k