rails-sqlite-extras 0.1.0 → 0.1.1

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: e6d98e686e16d43b33d634d912d20a24bbe265a212ca1a634a497b577d3f13bf
4
- data.tar.gz: 5f8e86e60d4e9ac302edf9f7857293c242d03c5622a852b30bd038e20aaa6adf
3
+ metadata.gz: 3b21efc318bad2844678e1755313e97568b9f6a73783dfeafc47e39cbfa4af90
4
+ data.tar.gz: 42205a943f3f7369774e290bb9a8704ba9aef3c4af318a9c81f7a84e467c5dae
5
5
  SHA512:
6
- metadata.gz: 1e2a85241730e526e6fb4926786904b825a797aa56a7354ad6a095f0b2e7577da1a2e7539f84985b61c38fdeb62f0f30f18df5f7ec52781b5dbf20ce71d6a6e4
7
- data.tar.gz: f85072769f7c50592258f87b71fd2ef25901cdf2d310bcc4b3bf40d6174639102b4869dc5d4d06d3a3c63881f94125a511e0d9aeaa30fc2f90df2c2737362de2
6
+ metadata.gz: 6bfefeab9d245876ca4dcd55a66d795afcb483ad233b4f3a92fb2efc1c49aa39bc93c0c261dae87dfd2135d7d1c4d78b0d65d1bacc39dd18f44a85df967c9206
7
+ data.tar.gz: 3e14eaef9a495fa4838ddbb42088dad0213e272e7ba24bd2f876f348ab626da795365df70cc33a3a57dfc479cd4e3d8c894ed1722062810b4745136ef84c5700
data/README.md CHANGED
@@ -1,19 +1,27 @@
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 available in Ruby and rake tasks 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 Rails rake tasks providing insights into the Sqlite database.
4
4
 
5
5
  ## Installation
6
6
 
7
- Some queries use `dbstat` table which has to be enabled via a `SQLITE_ENABLE_DBSTAT_VTAB` compile flag:
8
-
7
+ `Gemfile`
9
8
  ```bash
10
- bundle config set force_ruby_platform true
11
- bundle config set build.sqlite3 "--with-sqlite-cflags='-DSQLITE_ENABLE_DBSTAT_VTAB=1'"
9
+ gem "rails-sqlite-extras"
12
10
  ```
13
11
 
12
+ Some queries use `dbstat` table. You have to use [sqlite3 gem](https://github.com/sparklemotion/sqlite3-ruby) with version `>= 2.3.0` because it has this feature enabled by default:
13
+
14
14
  `Gemfile`
15
+
16
+ ```ruby
17
+ gem "sqlite3", "~> 2.3"
18
+ ```
19
+
20
+ Alternatively, if you're stuck on lower version, you have to enable `dbstat` by setting a `SQLITE_ENABLE_DBSTAT_VTAB` compile flag:
21
+
15
22
  ```bash
16
- gem 'rails-sqlite-extras'
23
+ bundle config set force_ruby_platform true
24
+ bundle config set build.sqlite3 "--with-sqlite-cflags='-DSQLITE_ENABLE_DBSTAT_VTAB=1'"
17
25
  ```
18
26
 
19
27
  ## Available queries
@@ -52,7 +52,7 @@ module RailsSqliteExtras
52
52
  puts Terminal::Table.new(
53
53
  title: title,
54
54
  headings: headings,
55
- rows: result.values,
55
+ rows: result.map(&:values),
56
56
  )
57
57
  else
58
58
  raise "Invalid in_format option"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsSqliteExtras
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
@@ -2,6 +2,7 @@
2
2
  lib = File.expand_path("../lib", __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
  require "rails_sqlite_extras/version"
5
+ require "terminal-table"
5
6
 
6
7
  Gem::Specification.new do |s|
7
8
  s.name = "rails-sqlite-extras"
@@ -17,9 +18,11 @@ Gem::Specification.new do |s|
17
18
  s.license = "MIT"
18
19
  s.add_dependency "rails"
19
20
  s.add_dependency "sqlite3"
21
+ s.add_dependency "terminal-table"
20
22
  s.add_development_dependency "rake"
21
23
  s.add_development_dependency "rspec"
22
24
  s.add_development_dependency "rufo"
25
+ s.add_development_dependency "dbg-rb"
23
26
 
24
27
  if s.respond_to?(:metadata=)
25
28
  s.metadata = { "rubygems_mfa_required" => "true" }
data/spec/smoke_spec.rb CHANGED
@@ -19,7 +19,7 @@ describe RailsSqliteExtras do
19
19
  expect do
20
20
  RailsSqliteExtras.run_query(
21
21
  query_name: query_name,
22
- in_format: :hash,
22
+ in_format: :display_table,
23
23
  )
24
24
  end.not_to raise_error
25
25
  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.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - pawurb
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-12-09 00:00:00.000000000 Z
11
+ date: 2024-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: terminal-table
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: rake
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -80,6 +94,20 @@ dependencies:
80
94
  - - ">="
81
95
  - !ruby/object:Gem::Version
82
96
  version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: dbg-rb
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
83
111
  description: " Helper queries providing insights into the Sqlite database for Rails
84
112
  apps. "
85
113
  email: