rails-sqlite-extras 0.0.2 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 61ce5e28ddc420085b0afa20233dee41e6ae2e4201734d40f41c34945dcb6e73
4
- data.tar.gz: 722883255ff6ad48e88da3bdf555ca432e1681e79ae472ff297500e83d5d7e9d
3
+ metadata.gz: e6d98e686e16d43b33d634d912d20a24bbe265a212ca1a634a497b577d3f13bf
4
+ data.tar.gz: 5f8e86e60d4e9ac302edf9f7857293c242d03c5622a852b30bd038e20aaa6adf
5
5
  SHA512:
6
- metadata.gz: 64b83a0a0a7b00c8575ac8672b9ebc4a6d158a3720b81b707038b9e04b890f588775d516237f2aef1ce97600ae65590238c05ee6c02e73854d0aef4609dc4931
7
- data.tar.gz: 74cbff0f00743a51186f214faee86b011be071001bcb386ce869517f0b598ad8e3bce8bc666eadb71fe473c39e7fd6ddaab8bf041e9f152744f14600855db0a8
6
+ metadata.gz: 1e2a85241730e526e6fb4926786904b825a797aa56a7354ad6a095f0b2e7577da1a2e7539f84985b61c38fdeb62f0f30f18df5f7ec52781b5dbf20ce71d6a6e4
7
+ data.tar.gz: f85072769f7c50592258f87b71fd2ef25901cdf2d310bcc4b3bf40d6174639102b4869dc5d4d06d3a3c63881f94125a511e0d9aeaa30fc2f90df2c2737362de2
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Rails Sqlite Extras [![Gem Version](https://badge.fury.io/rb/rails-sqlite-extras.svg)](https://badge.fury.io/rb/rails-sqlite-extras) [![GH Actions](https://github.com/pawurb/rails-sqlite-extras/actions/workflows/ci.yml/badge.svg)](https://github.com/pawurb/rails-sqlite-extras/actions)
2
2
 
3
- Copy/paste of [ecto_sqlite3_extras](https://github.com/orsinium-labs/ecto_sqlite3_extras). Helper queries providing insights into the Sqlite database.
3
+ Copy/paste of [ecto_sqlite3_extras](https://github.com/orsinium-labs/ecto_sqlite3_extras). Helper queries available in Ruby and rake tasks providing insights into the Sqlite database.
4
4
 
5
5
  ## Installation
6
6
 
@@ -20,6 +20,10 @@ gem 'rails-sqlite-extras'
20
20
 
21
21
  ### `total_size`
22
22
 
23
+ ```bash
24
+ rake sqlite_extras:total_size
25
+ ```
26
+
23
27
  ```ruby
24
28
  RailsSqliteExtras.total_size
25
29
  ```
@@ -40,6 +44,10 @@ The total size of all tables and indices. It's a summary table, it has only 2 co
40
44
 
41
45
  ### `table_size`
42
46
 
47
+ ```bash
48
+ rake sqlite_extras:table_size
49
+ ```
50
+
43
51
  ```ruby
44
52
  RailsSqliteExtras.table_size
45
53
  ```
@@ -57,6 +65,10 @@ Information about the space used (and unused) by all tables. Based on the [dbsta
57
65
 
58
66
  ### `index_size`
59
67
 
68
+ ```bash
69
+ rake sqlite_extras:index_size
70
+ ```
71
+
60
72
  ```ruby
61
73
  RailsSqliteExtras.index_size
62
74
  ```
@@ -75,6 +87,10 @@ Size of all indices.
75
87
 
76
88
  ### `sequence_number`
77
89
 
90
+ ```bash
91
+ rake sqlite_extras:sequence_number
92
+ ```
93
+
78
94
  ```ruby
79
95
  RailsSqliteExtras.sequence_number
80
96
  ```
@@ -86,6 +102,10 @@ Sequence numbers of autoincrement columns. Generated based on the [sqlite_sequen
86
102
 
87
103
  ### `pragma`
88
104
 
105
+ ```bash
106
+ rake sqlite_extras:pragma
107
+ ```
108
+
89
109
  ```ruby
90
110
  RailsSqliteExtras.pragma
91
111
  ```
@@ -97,6 +117,10 @@ List values of PRAGMAs (settings). Only includes the ones that have an integer o
97
117
 
98
118
  ### `compile_options`
99
119
 
120
+ ```bash
121
+ rake sqlite_extras:compile_options
122
+ ```
123
+
100
124
  ```ruby
101
125
  RailsSqliteExtras.compile_options
102
126
  ```
@@ -105,6 +129,10 @@ List the [compile-time options](https://www.sqlite.org/compile.html) used when b
105
129
 
106
130
  ### `integrity_check`
107
131
 
132
+ ```bash
133
+ rake sqlite_extras:integrity_check
134
+ ```
135
+
108
136
  ```ruby
109
137
  RailsSqliteExtras.integrity_check
110
138
  ```
@@ -93,3 +93,5 @@ module RailsSqliteExtras
93
93
  @@database_url || ENV["RUBY_PG_EXTRAS_DATABASE_URL"] || ENV.fetch("DATABASE_URL")
94
94
  end
95
95
  end
96
+
97
+ require "rails_sqlite_extras/railtie" if defined?(Rails)
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class RailsSqliteExtras::Railtie < Rails::Railtie
4
+ rake_tasks do
5
+ load "rails_sqlite_extras/tasks/all.rake"
6
+ end
7
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "rails-sqlite-extras"
4
+
5
+ namespace :sqlite_extras do
6
+ RailsSqliteExtras::QUERIES.each do |query_name|
7
+ desc RailsSqliteExtras.description_for(query_name: query_name)
8
+ task query_name.to_sym => :environment do
9
+ RailsSqliteExtras.public_send(query_name)
10
+ end
11
+ end
12
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsSqliteExtras
4
- VERSION = "0.0.2"
4
+ VERSION = "0.1.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-sqlite-extras
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - pawurb
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-11-18 00:00:00.000000000 Z
11
+ date: 2024-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -102,6 +102,8 @@ files:
102
102
  - lib/rails_sqlite_extras/queries/sequence_number.sql
103
103
  - lib/rails_sqlite_extras/queries/table_size.sql
104
104
  - lib/rails_sqlite_extras/queries/total_size.sql
105
+ - lib/rails_sqlite_extras/railtie.rb
106
+ - lib/rails_sqlite_extras/tasks/all.rake
105
107
  - lib/rails_sqlite_extras/version.rb
106
108
  - rails-sqlite-extras.gemspec
107
109
  - spec/smoke_spec.rb