postspec 0.2.5 → 0.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d9e60d04517c544252ab66c95f0b5d19a5e8fa303673d0252ac4e47f3303d719
4
- data.tar.gz: 69555a09052ceebd4046dda3e7dda73446c1272dcbc59f3d2cc6080b99e9cc6e
3
+ metadata.gz: ca6e04e0de0967bafaba5c3eb7072f56e72574e4344f65ced4f3b87f1330f6ca
4
+ data.tar.gz: e71ade1a64158703302b6ee982b1861e6a936010adb9d354c74a2994fe151f3c
5
5
  SHA512:
6
- metadata.gz: d79159dd929c7402275367e5c3e03229576e88813f72ac4319213b96683dc8c3195cd6c97fe05ddafed5c12234f177d9208c0eec578a9ab875b03e9c5a3ed1e7
7
- data.tar.gz: 51e5c7f1368122938d304c8c26e7bfd5b87e733622c404285b60a70df267210875199dcd5f65121357aba19ca85e2969574be0f370c486e90b6efd9ed9c68f7c
6
+ metadata.gz: b20845560ebfdacb2ebd7b4e087e7f65ff78802f04c6e68a1339e74ec3a6b52bd9f022cbf2539a56eb3ac4ca06e0abbe62576e81bba08b843aa4d356b7edfe6c
7
+ data.tar.gz: c6d458fb0e0c71cd55d0641057b1ccfb96b5202bef248b6e772e1b74e88b8ee5c36f44fe679d6fc61889b2f362a790b13a85fe84f25e42fba870e10c6b7ffb2a
@@ -77,12 +77,12 @@ module Postspec
77
77
  before update or delete on #{uid}
78
78
  for each row
79
79
  when (old.id <= #{id})
80
- execute function postspec_readonly_failure('#{uid}')
80
+ execute function postspec.readonly_failure('#{uid}')
81
81
  EOS1
82
82
  bt_sql = <<~EOS2
83
83
  create trigger postspec_readonly_bt_trg
84
84
  before truncate on #{uid}
85
- execute function postspec_readonly_failure('#{uid}')
85
+ execute function postspec.readonly_failure('#{uid}')
86
86
  EOS2
87
87
  [
88
88
  bud_sql.chomp,
@@ -1,3 +1,3 @@
1
1
  module Postspec
2
- VERSION = "0.2.5"
2
+ VERSION = "0.3.0"
3
3
  end
data/lib/postspec.rb CHANGED
@@ -68,16 +68,17 @@ module Postspec
68
68
  # TODO: PgMeta object
69
69
  #
70
70
  # +mode+ can be one of :seed, :empty (TODO :reseed, :keep)
71
- def initialize(conn, reflector: nil, mode: :empty, anchors: [], fail: true, ignore: [])
71
+ def initialize(conn, reflector: nil, mode: :empty, anchors: [], fail: true, ignore: [], cache: nil)
72
72
  constrain conn, PgConn
73
73
  constrain reflector, NilClass, String, PgGraph::Reflector
74
74
  constrain mode, lambda { |m| [:empty, :seed].include?(m) }
75
75
  constrain anchors, [Hash], NilClass
76
76
  constrain fail, TrueClass, FalseClass
77
77
  constrain ignore, [String]
78
+ constrain cache, String, nil
78
79
 
79
80
  @conn = conn
80
- @meta = PgMeta.new(@conn)
81
+ @meta = cache ? PgMeta.cache(@conn, yaml: cache) : PgMeta.new(@conn)
81
82
 
82
83
  # Make sure the postspec schema is not included in the type model. TODO:
83
84
  # Consolidate this into the :ignore option of PgGraph::Type.new as is
@@ -85,7 +86,8 @@ module Postspec
85
86
  has_postspec = @meta.schemas.key?("postspec")
86
87
  !has_postspec or (@meta.schemas["postspec"].hidden = true)
87
88
 
88
- @type = PgGraph::Type.new(@meta, reflector, ignore: ["prick"] + ignore)
89
+ @type = PgGraph::Type.new(@meta, reflector, ignore: ["prick"] + ignore)
90
+
89
91
  @render = Render.new(self)
90
92
  @tables = type.schemas.map(&:tables).flatten
91
93
  @ignore = ignore
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: postspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Claus Rasmussen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-04-13 00:00:00.000000000 Z
11
+ date: 2024-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-inflector