avm-eac_postgresql_base0 0.3.0 → 0.5.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: f8c272a517744e8283d0f09ef9a1551f1270ebc0a7304bdd52545f1281b40f50
4
- data.tar.gz: ac0e819f4a3efcb8797456d2e650a9157dfd15ae4dadcadee919682b4858db3d
3
+ metadata.gz: 1aab7e7605784b3f390b287888a21436d54e471e660154540655821e21cf09b1
4
+ data.tar.gz: 10dceabd6b967e2de6de9fb82d48e42a210ea9ae8eeefdf497680e90a7c4005a
5
5
  SHA512:
6
- metadata.gz: 4354892b67aab47fd790da261be0adfdefe914225a10bd7036a056612760674082623a08b59d9036ad410703ce491216927060ff02ebcddde529e454d9003037
7
- data.tar.gz: 3e518942ed62e30b44b1f7f5178f45632591e5d1b449fd86674d1e0a37b68e65416b1204fafcf8b85ff33facf5b11cadca291e85b53dbd194e6d265071a8160c
6
+ metadata.gz: b611894476d2ec077eaddc6642960c402094628d6cb79bd4b42d11a0e32fcfdb19d0e12b0a8109a191902924986fb721dbfe40250471243c9ede02255f07b622
7
+ data.tar.gz: e5856b0c82ef4c9392dae349d16ab892a28ddb7908eac9539010f921a71d1195f7a1567567c0eb5bd5894a79be3b151168143bcf43825837c876de5479519378
@@ -12,14 +12,25 @@ module Avm
12
12
  TABLES_SQL = "select schemaname || '#{TABLE_PARTS_SEPARATOR}' || tablename from " \
13
13
  "pg_tables where schemaname = '#{SCHEMA_VAR}'"
14
14
 
15
- before_load :clear_database
15
+ before_load :clear
16
+
17
+ def clear
18
+ info 'Clearing database (Dropping all tables)...'
19
+ ts = tables
20
+ if ts.empty?
21
+ info 'Database has no tables'
22
+ else
23
+ info "Removing #{ts.count} table(s)..."
24
+ run_sql(drop_tables_sql(ts))
25
+ end
26
+ end
16
27
 
17
28
  def dump_command
18
- instance.dump_gzip_command
29
+ instance.pg.dump_gzip_command
19
30
  end
20
31
 
21
32
  def load_command
22
- instance.load_gzip_command
33
+ instance.pg.load_gzip_command
23
34
  end
24
35
 
25
36
  private
@@ -30,17 +41,6 @@ module Avm
30
41
  'drop table ' + table_list.map(&:to_s).join(', ') + ' cascade'
31
42
  end
32
43
 
33
- def clear_database
34
- info 'Clearing database (Dropping all tables)...'
35
- ts = tables
36
- if ts.empty?
37
- info 'Database has no tables'
38
- else
39
- info "Removing #{ts.count} table(s)..."
40
- run_sql(drop_tables_sql(ts))
41
- end
42
- end
43
-
44
44
  # @param parts [Array<String>, Strings]
45
45
  # @return [String]
46
46
  def join_table_parts(parts)
@@ -49,7 +49,7 @@ module Avm
49
49
  end
50
50
 
51
51
  def run_sql(sql)
52
- instance.psql_command_command(sql).execute!
52
+ instance.pg.psql_command_command(sql).execute!
53
53
  end
54
54
 
55
55
  # @return [Array<String>]
@@ -60,7 +60,7 @@ module Avm
60
60
 
61
61
  # @return [String]
62
62
  def tables_sql
63
- TABLES_SQL.gsub(SCHEMA_VAR, instance.schema)
63
+ TABLES_SQL.gsub(SCHEMA_VAR, instance.pg.schema)
64
64
  end
65
65
  end
66
66
  end
@@ -21,10 +21,6 @@ module Avm
21
21
  ::Avm::EacPostgresqlBase0::Instance::Assert.new(self).perform
22
22
  end
23
23
 
24
- def data_unit
25
- ::Avm::EacPostgresqlBase0::Instance::DataUnit.new(self)
26
- end
27
-
28
24
  def host
29
25
  connection_params[:host] || DEFAULT_HOSTNAME
30
26
  end
@@ -15,6 +15,11 @@ module Avm
15
15
  name: database_name
16
16
  )
17
17
  end
18
+
19
+ # @return [Avm::EacPostgresqlBase0::Instance::DataUnit]
20
+ def pg_data_unit
21
+ ::Avm::EacPostgresqlBase0::Instance::DataUnit.new(self)
22
+ end
18
23
  end
19
24
  end
20
25
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module EacPostgresqlBase0
5
- VERSION = '0.3.0'
5
+ VERSION = '0.5.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avm-eac_postgresql_base0
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Put here the authors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-09 00:00:00.000000000 Z
11
+ date: 2023-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: avm
@@ -16,42 +16,42 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.68'
19
+ version: '0.70'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0.68'
26
+ version: '0.70'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: eac_ruby_utils
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0.112'
33
+ version: '0.114'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0.112'
40
+ version: '0.114'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: eac_ruby_gem_support
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0.4'
47
+ version: 0.5.1
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '0.4'
54
+ version: 0.5.1
55
55
  description:
56
56
  email:
57
57
  executables: []