migration_queries 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 356aa56fbb9c867de2ff9a1ec41c1d4305031f65ba10e8ea50ea523b70896046
4
- data.tar.gz: ec60f761a3f8a81aa4247ff3b4305843cde952951780e5a2c99cbc15b2b8c46a
3
+ metadata.gz: 4ff997e1ebe254c3fd23a538365fa0cafbcfc010c3e5199054202ed6bd1b2851
4
+ data.tar.gz: 70bef9fc0517130bc9158cc1f48c32b38c098ab9f93248de3957da1ea52ae87a
5
5
  SHA512:
6
- metadata.gz: d2572cb64efab92fcda737c55dda35c7cc1ce8b0786f23435538335d45dc5631663a89f1fba5f2a49b6d20b647ecfff6190309d04750f775bbd6a0d4ec2adb05
7
- data.tar.gz: da96b269d7049e01c2289a8cbaae3ca7789eb78961bbb0fd6d3d233577d038ebb862545c7cf6b7dfd9d8b58fa1a07e4c78bf2cc51ad2dca3676a28fe663297de
6
+ metadata.gz: 55526a659e9ea130374069cc062a9895ffe8734845f91490514a64ad24ae11b3b574c7ccdc2011364585a2d63ec4037596a3d31c33e5e6724036714695b59f6a
7
+ data.tar.gz: f80f52f70194dd955c697d931ac42cc6c08b85cdd67e2ffb717ec5c1dc1b307e1d5b40f383117774c769a2630aec96777ac6cb75076fdf0db16dec7a8ee244ab
data/README.md CHANGED
@@ -1,28 +1,46 @@
1
1
  # MigrationQueries
2
2
 
3
- TODO: Delete this and the text below, and describe your gem
4
-
5
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/migration_queries`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ The `migration_queries` gem improves tracking of migration queries in Ruby on Rails applications. It provides a simple way to log and analyze the SQL queries generated by ActiveRecord migrations, helping developers optimize their database interactions.
6
4
 
7
5
  ## Installation
8
6
 
9
- TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
10
-
11
- Install the gem and add to the application's Gemfile by executing:
7
+ Add this gem to development dependencies in your `Gemfile`:
12
8
 
13
- ```bash
14
- bundle add UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
9
+ ```ruby
10
+ group :development do
11
+ gem 'migration_queries'
12
+ end
15
13
  ```
16
14
 
17
- If bundler is not being used to manage dependencies, install the gem by executing:
15
+ Then, run `bundle install` to install the gem.
16
+
17
+ And then execute:
18
18
 
19
19
  ```bash
20
- gem install UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
20
+ bundle exec rake migration_queries:install
21
21
  ```
22
22
 
23
23
  ## Usage
24
24
 
25
- TODO: Write usage instructions here
25
+ The gem is going to automatically track migration queries executed by ActiveRecord. You can view the logged queries in your Rails console or in the log files.
26
+
27
+ Example migration file after running migration and logging queries:
28
+
29
+ ```ruby
30
+ class AddExampleTable < ActiveRecord::Migration[6.0]
31
+ def change
32
+ create_table :example do |t|
33
+ t.string :name
34
+ t.timestamps
35
+ end
36
+ end
37
+ end
38
+ =begin Migration Queries
39
+ CREATE TABLE "example" ("id" bigserial primary key, "name" character varying, "created_at" timestamp(6) NOT NULL, "updated_at" timestamp(6) NOT NULL)
40
+
41
+ # Migration Queries written on 2025-07-04 12:36:54 +0200
42
+ =end
43
+ ```
26
44
 
27
45
  ## Development
28
46
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MigrationQueries
4
- VERSION = "0.3.0"
4
+ VERSION = "0.4.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: migration_queries
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Szymon Lipka