sequel_tools 0.1.13 → 0.1.14
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 +4 -4
- data/README.md +1 -1
- data/lib/sequel_tools/actions/shell_postgres.rb +2 -2
- data/lib/sequel_tools/actions_manager.rb +8 -3
- data/lib/sequel_tools/pg_helper.rb +5 -3
- data/lib/sequel_tools/version.rb +1 -1
- data/lib/sequel_tools.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 06cfd2214117b4cdfb808527ff3c611d55e3c661270460f04cf8f9b87effb60e
|
4
|
+
data.tar.gz: 0ab06e31e27d5781b820c783a10f41c9a54eb12df033611be3fdfad1fabbc896
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9a44d46447c25dfd7380286812e32725f958aac419b02a6d8d3e38a83a421186762a539e3b5ed3c61de81580ad8752de911a046ad69817395b18f63a37f0d5d
|
7
|
+
data.tar.gz: 9fd7486aae118ff74d43bb0d797778d26d7dab0b93b69c2e0dcb4f49fc986da9d5ea3913b205e7844b71f4e6f41635451cb1d4f08c1d51d4d3afb8942dc7fb4f
|
data/README.md
CHANGED
@@ -127,7 +127,7 @@ PGPASSWORD=$DBPASSWORD
|
|
127
127
|
psql
|
128
128
|
```
|
129
129
|
|
130
|
-
Then you may
|
130
|
+
Then you may set `shell_command: '~/bin/opensql'` in config.
|
131
131
|
|
132
132
|
Alternatively you can define the `shell_#{dbadapter}` action if you prefer. Take a look at
|
133
133
|
the implementation for `shell_postgres` to see how to do that. If you want to share that action
|
@@ -8,8 +8,8 @@ class SequelTools::ActionsManager
|
|
8
8
|
psql = c[:psql]
|
9
9
|
env = {
|
10
10
|
'PGDATABASE' => c[:dbname],
|
11
|
-
'PGHOST' => c[:dbhost],
|
12
|
-
'PGPORT' => c[:dbport].to_s,
|
11
|
+
'PGHOST' => c[:dbhost] || 'localhost',
|
12
|
+
'PGPORT' => (c[:dbport] || 5432).to_s,
|
13
13
|
'PGUSER' => c[:username],
|
14
14
|
'PGPASSWORD' => c[:password].to_s,
|
15
15
|
}
|
@@ -9,9 +9,14 @@ module SequelTools
|
|
9
9
|
uri_parts = []
|
10
10
|
uri_parts << 'jdbc:' if RUBY_PLATFORM == 'java'
|
11
11
|
uri_parts << "#{c[:jdbc_adapter] || c[:dbadapter]}://"
|
12
|
-
|
13
|
-
|
14
|
-
|
12
|
+
host = c[:dbhost]
|
13
|
+
host ||= 'localhost' unless (c[:dbadapter] == 'sqlite') || c[:no_dbhost]
|
14
|
+
if host
|
15
|
+
uri_parts << host
|
16
|
+
uri_parts << ':' << c[:dbport] if c[:dbport]
|
17
|
+
uri_parts << '/'
|
18
|
+
end
|
19
|
+
uri_parts << dbname
|
15
20
|
if user = c[:username]
|
16
21
|
uri_parts << '?user=' << user
|
17
22
|
uri_parts << '&password=' << c[:password] if c[:password]
|
@@ -7,12 +7,14 @@ class PgHelper
|
|
7
7
|
Tempfile.open 'pgpass' do |file|
|
8
8
|
c = config
|
9
9
|
file.chmod 0600
|
10
|
-
|
10
|
+
host = c[:dbhost] || 'localhost'
|
11
|
+
port = c[:dbport] || '5432'
|
12
|
+
file.write "#{host}:#{port}:#{c[:dbname]}:#{c[:username]}:#{c[:password]}"
|
11
13
|
file.close
|
12
14
|
env = {
|
13
15
|
'PGDATABASE' => connect_database || c[:dbname],
|
14
|
-
'PGHOST' =>
|
15
|
-
'PGPORT' =>
|
16
|
+
'PGHOST' => host,
|
17
|
+
'PGPORT' => port.to_s,
|
16
18
|
'PGUSER' => c[:username],
|
17
19
|
'PGPASSFILE' => file.path
|
18
20
|
}
|
data/lib/sequel_tools/version.rb
CHANGED
data/lib/sequel_tools.rb
CHANGED
@@ -12,7 +12,7 @@ module SequelTools
|
|
12
12
|
schema_location: 'db/migrations/schema.sql',
|
13
13
|
seeds_location: 'db/seeds.rb',
|
14
14
|
dbname: nil,
|
15
|
-
dbhost:
|
15
|
+
dbhost: nil,
|
16
16
|
dbadapter: 'postgres',
|
17
17
|
dbport: nil,
|
18
18
|
username: nil,
|
@@ -24,7 +24,7 @@ module SequelTools
|
|
24
24
|
extra_tables_in_dump: nil,
|
25
25
|
} # unfrozen on purpose so that one might want to update the defaults
|
26
26
|
|
27
|
-
REQUIRED_KEYS = [ :dbadapter, :dbname
|
27
|
+
REQUIRED_KEYS = [ :dbadapter, :dbname ]
|
28
28
|
class MissingConfigError < StandardError; end
|
29
29
|
def self.base_config(extra_config = {})
|
30
30
|
config = DEFAULT_CONFIG.merge extra_config
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sequel_tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rodrigo Rosenfeld Rosas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-10-
|
11
|
+
date: 2022-10-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sequel
|