sqlpkg 0.1.1-x86_64-linux → 0.2.1-x86_64-linux
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +16 -0
- data/lib/sqlpkg/generators/sqlpkg/install_generator.rb +23 -0
- data/lib/sqlpkg/generators/sqlpkg/templates/initializer.rb +15 -0
- data/lib/sqlpkg/railtie.rb +12 -0
- data/lib/sqlpkg/version.rb +1 -1
- data/lib/sqlpkg.rb +5 -3
- metadata +33 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b50c25e12a5b29109cf0829c7561af05c5d7877641f52f1404dcd81682e1c0fe
|
4
|
+
data.tar.gz: c7e1be3b1b9b28bcd3bff1babd041414fb0f86560b37ea1bad623a6f1464b008
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4db35128494a68ccafab1a2c99ad3ae0ede1aa6a0845f617464fa1527da4d63719e2e77e3c38757d7e50ea268e83e50bdd53998394413ac2bd0be7fe823bc003
|
7
|
+
data.tar.gz: '08d6c8a5fce8f1dfc82da6fbed35c2a1aea87e0ef2c2317841312b4dbd751ec583544cb77c2c23e1139a26db1d2cf0c9f2082a17be5a26f06f076a9606d6266b'
|
data/README.md
CHANGED
@@ -12,6 +12,22 @@ If bundler is not being used to manage dependencies, install the gem by executin
|
|
12
12
|
|
13
13
|
$ gem install sqlpkg
|
14
14
|
|
15
|
+
After installing the gem, run the installer:
|
16
|
+
|
17
|
+
$ rails generate sqlpkg:install
|
18
|
+
|
19
|
+
The installer does three things:
|
20
|
+
|
21
|
+
1. creates an empty `.sqlpkg/` directory, which ensures that `sqlpkg` will run in "project scope" and not "global scope" (see [the `sqlpkg-cli` README](https://github.com/nalgeon/sqlpkg-cli#project-vs-global-scope) for more information)
|
22
|
+
2. creates an empty `sqlpkg.lock` file, which `sqlpkg` will use to store information about the installed packages (see [the `sqlpkg-cli` README](https://github.com/nalgeon/sqlpkg-cli#lockfile) for more information)
|
23
|
+
3. creates an initializer file at `config/initializers/sqlpkg.rb` which will patch the `SQLite3Adapter` to automatically load the extensions installed in the `.sqlpkg/` directory whenever the database is opened
|
24
|
+
|
25
|
+
Once properly integrated into your Rails application, you can install any extension listed on [the `sqlpkg` registry](https://sqlpkg.org/all/) by executing:
|
26
|
+
|
27
|
+
$ bundle exec sqlpkg install PACKAGE_IDENTIFIER
|
28
|
+
|
29
|
+
When exploring the [the `sqlpkg` registry](https://sqlpkg.org/all/), the `PACKAGE_IDENTIFIER` needed to install an extension is the title found in the cards, always in `owner/name` format.
|
30
|
+
|
15
31
|
This gem wraps the standalone executable version of the [sqlpkg-cli](https://github.com/nalgeon/sqlpkg-cli#download-and-install-preferred-method). These executables are platform specific, so there are actually separate underlying gems per platform, but the correct gem will automatically be picked for your platform.
|
16
32
|
|
17
33
|
Supported platforms are:
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "rails/generators/base"
|
4
|
+
|
5
|
+
module Sqlpkg
|
6
|
+
module Generators
|
7
|
+
class InstallGenerator < ::Rails::Generators::Base
|
8
|
+
source_root File.expand_path("templates", __dir__)
|
9
|
+
|
10
|
+
def ensure_sqlpkg_project_scope_directory
|
11
|
+
empty_directory ".sqlpkg"
|
12
|
+
end
|
13
|
+
|
14
|
+
def create_empty_sqlpkg_lockfile
|
15
|
+
create_file "sqlpkg.lock"
|
16
|
+
end
|
17
|
+
|
18
|
+
def copy_initializer_file
|
19
|
+
template "initializer.rb", "config/initializers/sqlpkg.rb"
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module SqlpkgLoader
|
2
|
+
def configure_connection
|
3
|
+
super
|
4
|
+
|
5
|
+
@raw_connection.enable_load_extension(true)
|
6
|
+
Dir.glob(".sqlpkg/**/*.{dll,so,dylib}") do |extension_path|
|
7
|
+
@raw_connection.load_extension(extension_path)
|
8
|
+
end
|
9
|
+
@raw_connection.enable_load_extension(false)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
ActiveSupport.on_load(:active_record_sqlite3adapter) do
|
14
|
+
prepend SqlpkgLoader
|
15
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "rails/railtie"
|
4
|
+
|
5
|
+
module Sqlpkg
|
6
|
+
class Railtie < ::Rails::Railtie
|
7
|
+
# Load the `sqlpkg:install` generator into the host Rails app
|
8
|
+
generators do
|
9
|
+
require_relative "generators/sqlpkg/install_generator"
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
data/lib/sqlpkg/version.rb
CHANGED
data/lib/sqlpkg.rb
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative "sqlpkg/version"
|
4
|
-
require_relative "sqlpkg/upstream"
|
5
|
-
|
6
3
|
module Sqlpkg
|
7
4
|
end
|
5
|
+
|
6
|
+
require_relative "sqlpkg/version"
|
7
|
+
require_relative "sqlpkg/upstream"
|
8
|
+
require_relative "sqlpkg/commands"
|
9
|
+
require_relative "sqlpkg/railtie" if defined?(::Rails::Railtie)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sqlpkg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: x86_64-linux
|
6
6
|
authors:
|
7
7
|
- Stephen Margheim
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-12-
|
11
|
+
date: 2023-12-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubyzip
|
@@ -24,6 +24,34 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rails
|
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
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: sqlite3
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
27
55
|
description:
|
28
56
|
email:
|
29
57
|
- stephen.margheim@gmail.com
|
@@ -40,6 +68,9 @@ files:
|
|
40
68
|
- exe/x86_64-linux/sqlpkg
|
41
69
|
- lib/sqlpkg.rb
|
42
70
|
- lib/sqlpkg/commands.rb
|
71
|
+
- lib/sqlpkg/generators/sqlpkg/install_generator.rb
|
72
|
+
- lib/sqlpkg/generators/sqlpkg/templates/initializer.rb
|
73
|
+
- lib/sqlpkg/railtie.rb
|
43
74
|
- lib/sqlpkg/upstream.rb
|
44
75
|
- lib/sqlpkg/version.rb
|
45
76
|
homepage: https://github.com/fractaledmind/sqlpkg-ruby
|