solid_litequeen 0.1.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 +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +28 -0
- data/Rakefile +8 -0
- data/app/assets/stylesheets/solid_litequeen/application.css +15 -0
- data/app/controllers/solid_litequeen/application_controller.rb +4 -0
- data/app/controllers/solid_litequeen/databases_controller.rb +31 -0
- data/app/helpers/solid_litequeen/application_helper.rb +4 -0
- data/app/helpers/solid_litequeen/databases_helper.rb +4 -0
- data/app/jobs/solid_litequeen/application_job.rb +4 -0
- data/app/mailers/solid_litequeen/application_mailer.rb +6 -0
- data/app/models/solid_litequeen/application_record.rb +5 -0
- data/app/views/layouts/solid_litequeen/application.html.erb +17 -0
- data/app/views/solid_litequeen/databases/index.html.erb +21 -0
- data/app/views/solid_litequeen/databases/show.html.erb +13 -0
- data/config/routes.rb +4 -0
- data/lib/solid_litequeen/engine.rb +5 -0
- data/lib/solid_litequeen/version.rb +3 -0
- data/lib/solid_litequeen.rb +6 -0
- data/lib/tasks/solid_litequeen_tasks.rake +4 -0
- metadata +94 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 7a1986f6f70b9d1ed579372a38005ef34a66cb6e751a02fa8a0ea644c35ce4e8
|
4
|
+
data.tar.gz: aeec92326bfd1562c92ed24107aa11ad800b3c92f41e6251947eedb5aa86645f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 5fbd12be3f354d0ca48756f32e9c946e752686c7f71755277f88ed1b81814e25360dc4dc91bdb511522758a1dc73f75cf171335fec5c396dfb2ae437173dfc3e
|
7
|
+
data.tar.gz: d5f2449c21f17b5b728d9f7faf1608eea7866e66b224fc3c2c66340496bcd137c0f762a621271da605327962a2bc8e36162cee32f47f09a3964360778f5bc392
|
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright Vik Borges
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
# SolidLitequeen
|
2
|
+
Short description and motivation.
|
3
|
+
|
4
|
+
## Usage
|
5
|
+
How to use my plugin.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
Add this line to your application's Gemfile:
|
9
|
+
|
10
|
+
```ruby
|
11
|
+
gem "solid_litequeen"
|
12
|
+
```
|
13
|
+
|
14
|
+
And then execute:
|
15
|
+
```bash
|
16
|
+
$ bundle
|
17
|
+
```
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
```bash
|
21
|
+
$ gem install solid_litequeen
|
22
|
+
```
|
23
|
+
|
24
|
+
## Contributing
|
25
|
+
Contribution directions go here.
|
26
|
+
|
27
|
+
## License
|
28
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
+
* listed below.
|
4
|
+
*
|
5
|
+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
+
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
|
7
|
+
*
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
9
|
+
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
|
10
|
+
* files in this directory. Styles in this file should be added after the last require_* statement.
|
11
|
+
* It is generally better to create a new file per style scope.
|
12
|
+
*
|
13
|
+
*= require_tree .
|
14
|
+
*= require_self
|
15
|
+
*/
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module SolidLitequeen
|
2
|
+
class DynamicDatabase < ActiveRecord::Base
|
3
|
+
self.abstract_class = true
|
4
|
+
end
|
5
|
+
|
6
|
+
class DatabasesController < ApplicationController
|
7
|
+
def index
|
8
|
+
@databases = ActiveRecord::Base.configurations.configurations.select do |config|
|
9
|
+
config.adapter == "sqlite3" && config.env_name == Rails.env && config.database.present?
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def show
|
14
|
+
db_id = params.expect(:id)
|
15
|
+
database_location = Base64.urlsafe_decode64(db_id)
|
16
|
+
|
17
|
+
DynamicDatabase.establish_connection(
|
18
|
+
adapter: "sqlite3",
|
19
|
+
database: database_location
|
20
|
+
)
|
21
|
+
|
22
|
+
tables = DynamicDatabase.connection.tables
|
23
|
+
|
24
|
+
|
25
|
+
@tables = tables.map do |table|
|
26
|
+
row_count = DynamicDatabase.connection.select_value("SELECT COUNT(*) FROM #{table}").to_i
|
27
|
+
{ name: table, row_count: row_count }
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Solid litequeen</title>
|
5
|
+
<%= csrf_meta_tags %>
|
6
|
+
<%= csp_meta_tag %>
|
7
|
+
|
8
|
+
<%= yield :head %>
|
9
|
+
|
10
|
+
<%= stylesheet_link_tag "solid_litequeen/application", media: "all" %>
|
11
|
+
</head>
|
12
|
+
<body>
|
13
|
+
|
14
|
+
<%= yield %>
|
15
|
+
|
16
|
+
</body>
|
17
|
+
</html>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<div>
|
2
|
+
|
3
|
+
<%= console %>
|
4
|
+
<h1>Solid Lite Queen</h1>
|
5
|
+
|
6
|
+
|
7
|
+
<div>
|
8
|
+
<p>Found <%= pluralize(@databases.count, "SQLite database") %></p>
|
9
|
+
</div>
|
10
|
+
|
11
|
+
<ul>
|
12
|
+
<% @databases.each do |db| %>
|
13
|
+
<li>
|
14
|
+
<p><%= db.env_name %> - <%= db.name %></p>
|
15
|
+
<p><%= db.database %></p>
|
16
|
+
<a href="<%= database_path(Base64.urlsafe_encode64(db.database)) %>">Open</a>
|
17
|
+
</li>
|
18
|
+
<% end %>
|
19
|
+
</ul>
|
20
|
+
|
21
|
+
</div>
|
data/config/routes.rb
ADDED
metadata
ADDED
@@ -0,0 +1,94 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: solid_litequeen
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Vik Borges
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2025-02-24 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rails
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 8.0.1
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 8.0.1
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: web-console
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
description: Lite Queen is an open-source SQLite database management software for
|
42
|
+
Ruby on Rails projects
|
43
|
+
email:
|
44
|
+
- kiv.d.dev@gmail.com
|
45
|
+
executables: []
|
46
|
+
extensions: []
|
47
|
+
extra_rdoc_files: []
|
48
|
+
files:
|
49
|
+
- MIT-LICENSE
|
50
|
+
- README.md
|
51
|
+
- Rakefile
|
52
|
+
- app/assets/stylesheets/solid_litequeen/application.css
|
53
|
+
- app/controllers/solid_litequeen/application_controller.rb
|
54
|
+
- app/controllers/solid_litequeen/databases_controller.rb
|
55
|
+
- app/helpers/solid_litequeen/application_helper.rb
|
56
|
+
- app/helpers/solid_litequeen/databases_helper.rb
|
57
|
+
- app/jobs/solid_litequeen/application_job.rb
|
58
|
+
- app/mailers/solid_litequeen/application_mailer.rb
|
59
|
+
- app/models/solid_litequeen/application_record.rb
|
60
|
+
- app/views/layouts/solid_litequeen/application.html.erb
|
61
|
+
- app/views/solid_litequeen/databases/index.html.erb
|
62
|
+
- app/views/solid_litequeen/databases/show.html.erb
|
63
|
+
- config/routes.rb
|
64
|
+
- lib/solid_litequeen.rb
|
65
|
+
- lib/solid_litequeen/engine.rb
|
66
|
+
- lib/solid_litequeen/version.rb
|
67
|
+
- lib/tasks/solid_litequeen_tasks.rake
|
68
|
+
homepage: https://solid.litequeen.com
|
69
|
+
licenses:
|
70
|
+
- MIT
|
71
|
+
metadata:
|
72
|
+
homepage_uri: https://solid.litequeen.com
|
73
|
+
source_code_uri: https://github.com/kivS/solid_litequeen
|
74
|
+
changelog_uri: https://solid.litequeen.com
|
75
|
+
post_install_message:
|
76
|
+
rdoc_options: []
|
77
|
+
require_paths:
|
78
|
+
- lib
|
79
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - ">="
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '0'
|
84
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '0'
|
89
|
+
requirements: []
|
90
|
+
rubygems_version: 3.5.21
|
91
|
+
signing_key:
|
92
|
+
specification_version: 4
|
93
|
+
summary: Manage SQLite databases on your server with ease
|
94
|
+
test_files: []
|