All Projects → plentz → Lol_dba

plentz / Lol_dba

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.

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Lol dba

Graphjin
GraphJin - Build APIs in 5 minutes with GraphQL. An instant GraphQL to SQL compiler.
Stars: ✭ 1,264 (-7.26%)
Mutual labels:  sql, database, rails, ruby-on-rails
Goose
A database migration tool. Supports SQL migrations and Go functions.
Stars: ✭ 2,112 (+54.95%)
Mutual labels:  sql, database, migrations, database-migrations
Bhf
Rails-Engine-Gem that offers an admin interface for trusted user
Stars: ✭ 81 (-94.06%)
Mutual labels:  rails, ruby-on-rails, gem
Erd
A Rails engine for drawing your app's ER diagram
Stars: ✭ 296 (-78.28%)
Mutual labels:  database-migrations, database, rails
Motion
Reactive frontend UI components for Rails in pure Ruby
Stars: ✭ 498 (-63.46%)
Mutual labels:  rails, ruby-on-rails, gem
Liquibase
Main Liquibase Source
Stars: ✭ 2,910 (+113.5%)
Mutual labels:  sql, database-migrations, database
Scenic
Scenic is maintained by Derek Prior, Caleb Hearth, and you, our contributors.
Stars: ✭ 2,856 (+109.54%)
Mutual labels:  sql, database, rails
Migrate Mongo
A database migration tool for MongoDB in Node
Stars: ✭ 481 (-64.71%)
Mutual labels:  migrations, database-migrations, database
Flyway Sbt
Flyway SBT plugin
Stars: ✭ 101 (-92.59%)
Mutual labels:  sql, database-migrations, database
Node Sqlite
SQLite client for Node.js applications with SQL-based migrations API written in Typescript
Stars: ✭ 642 (-52.9%)
Mutual labels:  sql, migrations, database
Ragtime
Database-independent migration library
Stars: ✭ 519 (-61.92%)
Mutual labels:  sql, migrations, database
Migrate
Database migrations. CLI and Golang library.
Stars: ✭ 7,712 (+465.81%)
Mutual labels:  sql, migrations, database
Migrate
Database migrations. CLI and Golang library.
Stars: ✭ 2,315 (+69.85%)
Mutual labels:  sql, migrations, database
Reactive record
Generate ActiveRecord models for a pre-existing Postgres db
Stars: ✭ 132 (-90.32%)
Mutual labels:  sql, database, rails
Express Knex Objection
A simple API system on a pg database, using knex and objection to simplify connection and management
Stars: ✭ 20 (-98.53%)
Mutual labels:  sql, database-migrations, database
Devise masquerade
Extension for devise, enable login as functionality. Add link to the masquerade_path(resource) and use it.
Stars: ✭ 380 (-72.12%)
Mutual labels:  rails, ruby-on-rails, gem
Counter culture
Turbo-charged counter caches for your Rails app.
Stars: ✭ 1,397 (+2.49%)
Mutual labels:  database, rails, gem
Postgres Migrations
🐦 A Stack Overflow-inspired PostgreSQL migration library with strict ordering and immutable migrations
Stars: ✭ 161 (-88.19%)
Mutual labels:  migrations, database-migrations, database
Zero downtime migrations
Zero downtime migrations with ActiveRecord 3+ and PostgreSQL
Stars: ✭ 513 (-62.36%)
Mutual labels:  migrations, database, rails
Node Pg Migrate
Node.js database migration management for Postgresql
Stars: ✭ 838 (-38.52%)
Mutual labels:  sql, migrations, database

lol_dba travis 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 and Rails 3.x, 4.x, 5.x, and 6.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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].