pg_trunk 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +4 -15
  3. data/CHANGELOG.md +6 -0
  4. data/README.md +1 -0
  5. data/lib/pg_trunk/operations/check_constraints/add_check_constraint.rb +3 -3
  6. data/lib/pg_trunk/operations/check_constraints/drop_check_constraint.rb +4 -4
  7. data/lib/pg_trunk/operations/check_constraints/rename_check_constraint.rb +2 -2
  8. data/lib/pg_trunk/operations/check_constraints/validate_check_constraint.rb +1 -1
  9. data/lib/pg_trunk/operations/composite_types/change_composite_type.rb +2 -2
  10. data/lib/pg_trunk/operations/composite_types/create_composite_type.rb +1 -1
  11. data/lib/pg_trunk/operations/composite_types/drop_composite_type.rb +3 -3
  12. data/lib/pg_trunk/operations/composite_types/rename_composite_type.rb +1 -1
  13. data/lib/pg_trunk/operations/domains/create_domain.rb +5 -5
  14. data/lib/pg_trunk/operations/domains/drop_domain.rb +6 -6
  15. data/lib/pg_trunk/operations/domains/rename_domain.rb +1 -1
  16. data/lib/pg_trunk/operations/enums/create_enum.rb +2 -2
  17. data/lib/pg_trunk/operations/enums/drop_enum.rb +4 -4
  18. data/lib/pg_trunk/operations/enums/rename_enum.rb +1 -1
  19. data/lib/pg_trunk/operations/foreign_keys/add_foreign_key.rb +8 -8
  20. data/lib/pg_trunk/operations/foreign_keys/drop_foreign_key.rb +9 -9
  21. data/lib/pg_trunk/operations/foreign_keys/rename_foreign_key.rb +5 -5
  22. data/lib/pg_trunk/operations/functions/change_function.rb +1 -1
  23. data/lib/pg_trunk/operations/functions/create_function.rb +11 -11
  24. data/lib/pg_trunk/operations/functions/drop_function.rb +12 -12
  25. data/lib/pg_trunk/operations/functions/rename_function.rb +1 -1
  26. data/lib/pg_trunk/operations/materialized_views/change_materialized_view.rb +1 -1
  27. data/lib/pg_trunk/operations/materialized_views/create_materialized_view.rb +6 -6
  28. data/lib/pg_trunk/operations/materialized_views/drop_materialized_view.rb +7 -7
  29. data/lib/pg_trunk/operations/materialized_views/refresh_materialized_view.rb +2 -2
  30. data/lib/pg_trunk/operations/materialized_views/rename_materialized_view.rb +2 -2
  31. data/lib/pg_trunk/operations/procedures/change_procedure.rb +1 -1
  32. data/lib/pg_trunk/operations/procedures/create_procedure.rb +5 -5
  33. data/lib/pg_trunk/operations/procedures/drop_procedure.rb +5 -5
  34. data/lib/pg_trunk/operations/procedures/rename_procedure.rb +1 -1
  35. data/lib/pg_trunk/operations/rules/base.rb +77 -0
  36. data/lib/pg_trunk/operations/rules/create_rule.rb +155 -0
  37. data/lib/pg_trunk/operations/rules/drop_rule.rb +94 -0
  38. data/lib/pg_trunk/operations/rules/rename_rule.rb +62 -0
  39. data/lib/pg_trunk/operations/rules.rb +13 -0
  40. data/lib/pg_trunk/operations/statistics/create_statistics.rb +4 -4
  41. data/lib/pg_trunk/operations/statistics/drop_statistics.rb +5 -5
  42. data/lib/pg_trunk/operations/statistics/rename_statistics.rb +1 -1
  43. data/lib/pg_trunk/operations/triggers/change_trigger.rb +1 -1
  44. data/lib/pg_trunk/operations/triggers/create_trigger.rb +9 -9
  45. data/lib/pg_trunk/operations/triggers/drop_trigger.rb +9 -9
  46. data/lib/pg_trunk/operations/triggers/rename_trigger.rb +6 -6
  47. data/lib/pg_trunk/operations/views/change_view.rb +1 -1
  48. data/lib/pg_trunk/operations/views/create_view.rb +5 -5
  49. data/lib/pg_trunk/operations/views/drop_view.rb +7 -7
  50. data/lib/pg_trunk/operations/views/rename_view.rb +2 -2
  51. data/lib/pg_trunk/operations.rb +1 -0
  52. data/lib/pg_trunk/version.rb +1 -1
  53. data/pg_trunk.gemspec +0 -1
  54. data/spec/operations/rules/create_rule_spec.rb +119 -0
  55. data/spec/operations/rules/drop_rule_spec.rb +117 -0
  56. data/spec/operations/rules/rename_rule_spec.rb +148 -0
  57. metadata +12 -68
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7e7e7834f9f7da413371ea11262161da230fab549707bad615f3d5ab4ad9b19c
4
- data.tar.gz: 14084be1a484bd0a7201f33d680546a1bba2ff8e5b34bc59aa3f3597f5d48c87
3
+ metadata.gz: d88867c31da4259d601293ec91a915c070cef21a29ebe82e97a18a7dd0c72931
4
+ data.tar.gz: c18bc215374043cf53bfdeae0245d537899dba92c9d665adda0dd7f05eba2890
5
5
  SHA512:
6
- metadata.gz: 056da9038cee7e60551a7b1ddb3cf990fe6a0eaeee95b48b95b38babd777ec97e9cce2564e3c1e1dbcd13a30072360beb87a0f20f48c152b2080997e0e489cd6
7
- data.tar.gz: c83b7f738860de782e7cf407cfdbcd71fbfe3e3c5f995aa3a4fcdc7643e9a000f69eeca02b4c025e4219f5ecf19fb24781704e4fc8524944c7e11a9bc18f355e
6
+ metadata.gz: 17b2ec446bf2e44a04d7a9bd2e09451730321de3c08b3ca9fdf4faeb5f10894d933721c58b617f4309a900df2abd50609c6ac2295254afad727d992de8107106
7
+ data.tar.gz: 11de4394260f0b6b1012c577b78ac344fd72ae78bc34f4465634557b6310b0982c54e29151a9a673b2f94bd11e889889ec16e7a69acf9e6c4e796eab94364ef9
@@ -58,25 +58,14 @@ jobs:
58
58
  - name: Checkout
59
59
  uses: actions/checkout@v2
60
60
 
61
- - name: Install Ruby ${{ matrix.ruby }}
62
- uses: ruby/setup-ruby@v1.61.1
63
- with:
64
- ruby-version: ${{ matrix.ruby }}
65
-
66
61
  - name: Install dependent libraries
67
62
  run: sudo apt-get install libpq-dev
68
63
 
69
- - name: Generate lockfile
70
- run: bundle lock
71
-
72
- - name: Cache dependencies
73
- uses: actions/cache@v1
64
+ - name: Install Ruby ${{ matrix.ruby }}
65
+ uses: ruby/setup-ruby@v1.61.1
74
66
  with:
75
- path: vendor/bundle
76
- key: bundle-${{ hashFiles('Gemfile.lock') }}
77
-
78
- - name: Set up PGTrunk
79
- run: bin/setup
67
+ ruby-version: ${{ matrix.ruby }}
68
+ bundler-cache: true # 'bundle install' and cache
80
69
 
81
70
  - name: Check code style
82
71
  run: bundle exec rubocop
data/CHANGELOG.md CHANGED
@@ -4,6 +4,12 @@ The noteworthy changes for each PGTrunk version are included here.
4
4
  The format is based on [Keep a Changelog] and this project adheres to [Semantic Versioning].
5
5
  For a complete changelog, see the [commits] for each version via the version links.
6
6
 
7
+ ## [0.1.3] (2022-01-20)
8
+
9
+ * Add support for rules (nepalez)
10
+ * Fix CI/CD flow (olleolleolle)
11
+ * Fix documentation (nepalez)
12
+
7
13
  ## [0.1.2] (2022-01-17)
8
14
 
9
15
  * Fix registry of custom types (nepalez)
data/README.md CHANGED
@@ -72,6 +72,7 @@ As of today we support creation, modification and dropping the following objects
72
72
  - enumerable types
73
73
  - composite types
74
74
  - domains types
75
+ - rules
75
76
 
76
77
  For `tables` and `indexes` we reuse the ActiveRecord's native methods.
77
78
  For `check constraints` and `foreign keys` we support both the native definitions inside the table
@@ -6,9 +6,9 @@
6
6
  # #
7
7
  # # @param [#to_s] table (nil) The qualified name of the table
8
8
  # # @param [#to_s] expression (nil) The SQL expression
9
- # # @option [#to_s] :name (nil) The optional name of the constraint
10
- # # @option [Boolean] :inherit (true) If the constraint should be inherited by subtables
11
- # # @option [#to_s] :comment (nil) The comment describing the constraint
9
+ # # @option options [#to_s] :name (nil) The optional name of the constraint
10
+ # # @option options [Boolean] :inherit (true) If the constraint should be inherited by subtables
11
+ # # @option options [#to_s] :comment (nil) The comment describing the constraint
12
12
  # # @yield [c] the block with the constraint's definition
13
13
  # # @yieldparam Object receiver of methods specifying the constraint
14
14
  # # @return [void]
@@ -6,10 +6,10 @@
6
6
  # #
7
7
  # # @param [#to_s] table (nil) The qualified name of the table
8
8
  # # @param [#to_s] expression (nil) The SQL expression
9
- # # @option [Boolean] :if_exists (false) Suppress the error when the constraint is absent
10
- # # @option [#to_s] :name (nil) The optional name of the constraint
11
- # # @option [Boolean] :inherit (true) If the constraint should be inherited by subtables
12
- # # @option [#to_s] :comment (nil) The comment describing the constraint
9
+ # # @option options [Boolean] :if_exists (false) Suppress the error when the constraint is absent
10
+ # # @option options [#to_s] :name (nil) The optional name of the constraint
11
+ # # @option options [Boolean] :inherit (true) If the constraint should be inherited by subtables
12
+ # # @option options [#to_s] :comment (nil) The comment describing the constraint
13
13
  # # @yield [c] the block with the constraint's definition
14
14
  # # @yieldparam Object receiver of methods specifying the constraint
15
15
  # # @return [void]
@@ -6,8 +6,8 @@
6
6
  # #
7
7
  # # @param [#to_s] table (nil) The qualified name of the table
8
8
  # # @param [#to_s] expression (nil) The SQL expression
9
- # # @option [#to_s] :name (nil) The current name of the constraint
10
- # # @option [#to_s] :to (nil) The new name for the constraint
9
+ # # @option options [#to_s] :name (nil) The current name of the constraint
10
+ # # @option options [#to_s] :to (nil) The new name for the constraint
11
11
  # # @yield [c] the block with the constraint's definition
12
12
  # # @yieldparam Object receiver of methods specifying the constraint
13
13
  # # @return [void]
@@ -6,7 +6,7 @@
6
6
  # #
7
7
  # # @param [#to_s] table (nil) The qualified name of the table
8
8
  # # @param [#to_s] expression (nil) The SQL expression
9
- # # @option [#to_s] :name (nil) The optional name of the constraint
9
+ # # @option options [#to_s] :name (nil) The optional name of the constraint
10
10
  # # @yield [c] the block with the constraint's definition
11
11
  # # @yieldparam Object receiver of methods specifying the constraint
12
12
  # # @return [void]
@@ -5,8 +5,8 @@
5
5
  # # Modify a composite type
6
6
  # #
7
7
  # # @param [#to_s] name (nil) The qualified name of the type
8
- # # @option [Symbol] :force (:restrict) How to process dependent objects (`:cascade` or `:restrict`)
9
- # # @option [#to_s] :comment (nil) The comment describing the constraint
8
+ # # @option options [Symbol] :force (:restrict) How to process dependent objects (`:cascade` or `:restrict`)
9
+ # # @option options [#to_s] :comment (nil) The comment describing the constraint
10
10
  # # @yield [t] the block with the type's definition
11
11
  # # @yieldparam Object receiver of methods specifying the type
12
12
  # # @return [void]
@@ -5,7 +5,7 @@
5
5
  # # Create a composite type
6
6
  # #
7
7
  # # @param [#to_s] name (nil) The qualified name of the type
8
- # # @option [#to_s] :comment (nil) The comment describing the constraint
8
+ # # @option options [#to_s] :comment (nil) The comment describing the constraint
9
9
  # # @yield [t] the block with the type's definition
10
10
  # # @yieldparam Object receiver of methods specifying the type
11
11
  # # @return [void]
@@ -5,9 +5,9 @@
5
5
  # # Drop a composite type
6
6
  # #
7
7
  # # @param [#to_s] name (nil) The qualified name of the type
8
- # # @option [Boolean] :if_exists (false) Suppress the error when the type is absent
9
- # # @option [Symbol] :force (:restrict) How to process dependent objects (`:cascade` or `:restrict`)
10
- # # @option [#to_s] :comment (nil) The comment describing the constraint
8
+ # # @option options [Boolean] :if_exists (false) Suppress the error when the type is absent
9
+ # # @option options [Symbol] :force (:restrict) How to process dependent objects (`:cascade` or `:restrict`)
10
+ # # @option options [#to_s] :comment (nil) The comment describing the constraint
11
11
  # # @yield [t] the block with the type's definition
12
12
  # # @yieldparam Object receiver of methods specifying the type
13
13
  # # @return [void]
@@ -5,7 +5,7 @@
5
5
  # # Change the name and/or schema of a composite type
6
6
  # #
7
7
  # # @param [#to_s] name (nil) The qualified name of the type
8
- # # @option [#to_s] :to (nil) The new qualified name for the type
8
+ # # @option options [#to_s] :to (nil) The new qualified name for the type
9
9
  # # @return [void]
10
10
  # #
11
11
  # # ```ruby
@@ -5,11 +5,11 @@
5
5
  # # Create a domain type
6
6
  # #
7
7
  # # @param [#to_s] name (nil) The qualified name of the type
8
- # # @option [#to_s] :as (nil) The base type for the domain (alias: :type)
9
- # # @option [#to_s] :collation (nil) The collation
10
- # # @option [Boolean] :null (true) If a value of this type can be NULL
11
- # # @option [#to_s] :default_sql (nil) The snippet for the default value of the domain
12
- # # @option [#to_s] :comment (nil) The comment describing the constraint
8
+ # # @option options [#to_s] :as (nil) The base type for the domain (alias: :type)
9
+ # # @option options [#to_s] :collation (nil) The collation
10
+ # # @option options [Boolean] :null (true) If a value of this type can be NULL
11
+ # # @option options [#to_s] :default_sql (nil) The snippet for the default value of the domain
12
+ # # @option options [#to_s] :comment (nil) The comment describing the constraint
13
13
  # # @yield [d] the block with the type's definition
14
14
  # # @yieldparam Object receiver of methods specifying the type
15
15
  # # @return [void]
@@ -5,12 +5,12 @@
5
5
  # # Drop a domain type by qualified name
6
6
  # #
7
7
  # # @param [#to_s] name (nil) The qualified name of the type
8
- # # @option [Boolean] :if_exists (false) Suppress the error when the type is absent
9
- # # @option [Symbol] :force (:restrict) How to process dependent objects (`:cascade` or `:restrict`)
10
- # # @option [#to_s] :as (nil) The base type for the domain (alias: :type)
11
- # # @option [#to_s] :collation (nil) The collation
12
- # # @option [#to_s] :default_sql (nil) The snippet for the default value of the domain
13
- # # @option [#to_s] :comment (nil) The comment describing the constraint
8
+ # # @option options [Boolean] :if_exists (false) Suppress the error when the type is absent
9
+ # # @option options [Symbol] :force (:restrict) How to process dependent objects (`:cascade` or `:restrict`)
10
+ # # @option options [#to_s] :as (nil) The base type for the domain (alias: :type)
11
+ # # @option options [#to_s] :collation (nil) The collation
12
+ # # @option options [#to_s] :default_sql (nil) The snippet for the default value of the domain
13
+ # # @option options [#to_s] :comment (nil) The comment describing the constraint
14
14
  # # @yield [d] the block with the type's definition
15
15
  # # @yieldparam Object receiver of methods specifying the type
16
16
  # # @return [void]
@@ -5,7 +5,7 @@
5
5
  # # Change the name and/or schema of a domain type
6
6
  # #
7
7
  # # @param [#to_s] :name (nil) The qualified name of the type
8
- # # @option [#to_s] :to (nil) The new qualified name for the type
8
+ # # @option options [#to_s] :to (nil) The new qualified name for the type
9
9
  # # @return [void]
10
10
  # #
11
11
  # # A domain type can be both renamed and moved to another schema.
@@ -5,8 +5,8 @@
5
5
  # # Create an enumerated type by qualified name
6
6
  # #
7
7
  # # @param [#to_s] name (nil) The qualified name of the type
8
- # # @option [Array<#to_s>] :values ([]) The list of values
9
- # # @option [#to_s] :comment (nil) The comment describing the constraint
8
+ # # @option options [Array<#to_s>] :values ([]) The list of values
9
+ # # @option options [#to_s] :comment (nil) The comment describing the constraint
10
10
  # # @yield [e] the block with the type's definition
11
11
  # # @yieldparam Object receiver of methods specifying the type
12
12
  # # @return [void]
@@ -5,10 +5,10 @@
5
5
  # # Drop an enumerated type by qualified name
6
6
  # #
7
7
  # # @param [#to_s] name (nil) The qualified name of the type
8
- # # @option [Boolean] :if_exists (false) Suppress the error when the type is absent
9
- # # @option [Symbol] :force (:restrict) How to process dependent objects (`:cascade` or `:restrict`)
10
- # # @option [Array<#to_s>] :values ([]) The list of values
11
- # # @option [#to_s] :comment (nil) The comment describing the constraint
8
+ # # @option options [Boolean] :if_exists (false) Suppress the error when the type is absent
9
+ # # @option options [Symbol] :force (:restrict) How to process dependent objects (`:cascade` or `:restrict`)
10
+ # # @option options [Array<#to_s>] :values ([]) The list of values
11
+ # # @option options [#to_s] :comment (nil) The comment describing the constraint
12
12
  # # @yield [e] the block with the type's definition
13
13
  # # @yieldparam Object receiver of methods specifying the type
14
14
  # # @return [void]
@@ -5,7 +5,7 @@
5
5
  # # Change the name and/or schema of an enumerated type
6
6
  # #
7
7
  # # @param [#to_s] :name (nil) The qualified name of the type
8
- # # @option [#to_s] :to (nil) The new qualified name for the type
8
+ # # @option options [#to_s] :to (nil) The new qualified name for the type
9
9
  # # @return [void]
10
10
  # #
11
11
  # # @example:
@@ -6,17 +6,17 @@
6
6
  # #
7
7
  # # @param [#to_s] table (nil) The qualified name of the table
8
8
  # # @param [#to_s] reference (nil) The qualified name of the reference table
9
- # # @option [#to_s] :name (nil) The current name of the foreign key
10
- # # @option [#to_s] :to (nil) The new name for the foreign key
11
- # # @option [Array<#to_s>] :columns ([]) The list of columns of the table
12
- # # @option [#to_s] :column (nil) An alias for :columns for the case of single-column keys
13
- # # @option [Array<#to_s>] :primary_key ([]) The list of columns of the reference table
14
- # # @option [Symbol] :match (:full) Define how to match rows
9
+ # # @option options [#to_s] :name (nil) The current name of the foreign key
10
+ # # @option options [#to_s] :to (nil) The new name for the foreign key
11
+ # # @option options [Array<#to_s>] :columns ([]) The list of columns of the table
12
+ # # @option options [#to_s] :column (nil) An alias for :columns for the case of single-column keys
13
+ # # @option options [Array<#to_s>] :primary_key ([]) The list of columns of the reference table
14
+ # # @option options [Symbol] :match (:full) Define how to match rows
15
15
  # # Supported values: :full (default), :partial, :simple
16
- # # @option [Symbol] :on_delete (:restrict)
16
+ # # @option options [Symbol] :on_delete (:restrict)
17
17
  # # Define how to handle the deletion of the referred row.
18
18
  # # Supported values: :restrict (default), :cascade, :nullify, :reset
19
- # # @option [Symbol] :on_update (:restrict)
19
+ # # @option options [Symbol] :on_update (:restrict)
20
20
  # # Define how to handle the update of the referred row.
21
21
  # # Supported values: :restrict (default), :cascade, :nullify, :reset
22
22
  # # @yield [k] the block with the key's definition
@@ -6,18 +6,18 @@
6
6
  # #
7
7
  # # @param [#to_s] table (nil) The qualified name of the table
8
8
  # # @param [#to_s] reference (nil) The qualified name of the reference table
9
- # # @option [#to_s] :name (nil) The current name of the foreign key
10
- # # @option [Boolean] :if_exists (false) Suppress the error when the constraint is absent
11
- # # @option [#to_s] :to (nil) The new name for the foreign key
12
- # # @option [Array<#to_s>] :columns ([]) The list of columns of the table
13
- # # @option [#to_s] :column (nil) An alias for :columns for the case of single-column keys
14
- # # @option [Array<#to_s>] :primary_key ([]) The list of columns of the reference table
15
- # # @option [Symbol] :match (:full) Define how to match rows
9
+ # # @option options [#to_s] :name (nil) The current name of the foreign key
10
+ # # @option options [Boolean] :if_exists (false) Suppress the error when the constraint is absent
11
+ # # @option options [#to_s] :to (nil) The new name for the foreign key
12
+ # # @option options [Array<#to_s>] :columns ([]) The list of columns of the table
13
+ # # @option options [#to_s] :column (nil) An alias for :columns for the case of single-column keys
14
+ # # @option options [Array<#to_s>] :primary_key ([]) The list of columns of the reference table
15
+ # # @option options [Symbol] :match (:full) Define how to match rows
16
16
  # # Supported values: :full (default), :partial, :simple
17
- # # @option [Symbol] :on_delete (:restrict)
17
+ # # @option options [Symbol] :on_delete (:restrict)
18
18
  # # Define how to handle the deletion of the referred row.
19
19
  # # Supported values: :restrict (default), :cascade, :nullify, :reset
20
- # # @option [Symbol] :on_update (:restrict)
20
+ # # @option options [Symbol] :on_update (:restrict)
21
21
  # # Define how to handle the update of the referred row.
22
22
  # # Supported values: :restrict (default), :cascade, :nullify, :reset
23
23
  # # @yield [k] the block with the key's definition
@@ -6,11 +6,11 @@
6
6
  # #
7
7
  # # @param [#to_s] table (nil) The qualified name of the table
8
8
  # # @param [#to_s] reference (nil) The qualified name of the reference table
9
- # # @option [#to_s] :name (nil) The current name of the foreign key
10
- # # @option [#to_s] :to (nil) The new name for the foreign key
11
- # # @option [Array<#to_s>] :columns ([]) The list of columns of the table
12
- # # @option [#to_s] :column (nil) An alias for :columns for the case of single-column keys
13
- # # @option [Array<#to_s>] :primary_key ([]) The list of columns of the reference table
9
+ # # @option options [#to_s] :name (nil) The current name of the foreign key
10
+ # # @option options [#to_s] :to (nil) The new name for the foreign key
11
+ # # @option options [Array<#to_s>] :columns ([]) The list of columns of the table
12
+ # # @option options [#to_s] :column (nil) An alias for :columns for the case of single-column keys
13
+ # # @option options [Array<#to_s>] :primary_key ([]) The list of columns of the reference table
14
14
  # # @yield [k] the block with the key's definition
15
15
  # # @yieldparam Object receiver of methods specifying the foreign key
16
16
  # # @return [void]
@@ -5,7 +5,7 @@
5
5
  # # Modify a function
6
6
  # #
7
7
  # # @param [#to_s] name (nil) The qualified name of the function
8
- # # @option [Boolean] :if_exists (false) Suppress the error when the function is absent
8
+ # # @option options [Boolean] :if_exists (false) Suppress the error when the function is absent
9
9
  # # @yield [f] the block with the function's definition
10
10
  # # @yieldparam Object receiver of methods specifying the function
11
11
  # # @return [void]
@@ -6,20 +6,20 @@
6
6
  # #
7
7
  # # @param [#to_s] name (nil)
8
8
  # # The qualified name of the function with arguments and returned value type
9
- # # @option [Boolean] :replace_existing (false) If the function should overwrite an existing one
10
- # # @option [#to_s] :language ("sql") The language (like "sql" or "plpgsql")
11
- # # @option [#to_s] :body (nil) The body of the function
12
- # # @option [Symbol] :volatility (:volatile) The volatility of the function.
9
+ # # @option options [Boolean] :replace_existing (false) If the function should overwrite an existing one
10
+ # # @option options [#to_s] :language ("sql") The language (like "sql" or "plpgsql")
11
+ # # @option options [#to_s] :body (nil) The body of the function
12
+ # # @option options [Symbol] :volatility (:volatile) The volatility of the function.
13
13
  # # Supported values: :volatile (default), :stable, :immutable
14
- # # @option [Symbol] :parallel (:unsafe) The safety of parallel execution.
14
+ # # @option options [Symbol] :parallel (:unsafe) The safety of parallel execution.
15
15
  # # Supported values: :unsafe (default), :restricted, :safe
16
- # # @option [Symbol] :security (:invoker) Define the role under which the function is invoked
16
+ # # @option options [Symbol] :security (:invoker) Define the role under which the function is invoked
17
17
  # # Supported values: :invoker (default), :definer
18
- # # @option [Boolean] :leakproof (false) If the function is leakproof
19
- # # @option [Boolean] :strict (false) If the function is strict
20
- # # @option [Float] :cost (nil) The cost estimation for the function
21
- # # @option [Integer] :rows (nil) The number of rows returned by a function
22
- # # @option [#to_s] :comment The description of the function
18
+ # # @option options [Boolean] :leakproof (false) If the function is leakproof
19
+ # # @option options [Boolean] :strict (false) If the function is strict
20
+ # # @option options [Float] :cost (nil) The cost estimation for the function
21
+ # # @option options [Integer] :rows (nil) The number of rows returned by a function
22
+ # # @option options [#to_s] :comment The description of the function
23
23
  # # @yield [f] the block with the function's definition
24
24
  # # @yieldparam Object receiver of methods specifying the function
25
25
  # # @return [void]
@@ -6,22 +6,22 @@
6
6
  # #
7
7
  # # @param [#to_s] name (nil)
8
8
  # # The qualified name of the function with arguments and returned value type
9
- # # @option [Boolean] :if_exists (false) Suppress the error when the function is absent
10
- # # @option [Symbol] :force (:restrict) How to process dependent objects
9
+ # # @option options [Boolean] :if_exists (false) Suppress the error when the function is absent
10
+ # # @option options [Symbol] :force (:restrict) How to process dependent objects
11
11
  # # Supported values: :restrict (default), :cascade
12
- # # @option [#to_s] :language ("sql") The language (like "sql" or "plpgsql")
13
- # # @option [#to_s] :body (nil) The body of the function
14
- # # @option [Symbol] :volatility (:volatile) The volatility of the function.
12
+ # # @option options [#to_s] :language ("sql") The language (like "sql" or "plpgsql")
13
+ # # @option options [#to_s] :body (nil) The body of the function
14
+ # # @option options [Symbol] :volatility (:volatile) The volatility of the function.
15
15
  # # Supported values: :volatile (default), :stable, :immutable
16
- # # @option [Symbol] :parallel (:unsafe) The safety of parallel execution.
16
+ # # @option options [Symbol] :parallel (:unsafe) The safety of parallel execution.
17
17
  # # Supported values: :unsafe (default), :restricted, :safe
18
- # # @option [Symbol] :security (:invoker) Define the role under which the function is invoked
18
+ # # @option options [Symbol] :security (:invoker) Define the role under which the function is invoked
19
19
  # # Supported values: :invoker (default), :definer
20
- # # @option [Boolean] :leakproof (false) If the function is leakproof
21
- # # @option [Boolean] :strict (false) If the function is strict
22
- # # @option [Float] :cost (nil) The cost estimation for the function
23
- # # @option [Integer] :rows (nil) The number of rows returned by a function
24
- # # @option [#to_s] :comment The description of the function
20
+ # # @option options [Boolean] :leakproof (false) If the function is leakproof
21
+ # # @option options [Boolean] :strict (false) If the function is strict
22
+ # # @option options [Float] :cost (nil) The cost estimation for the function
23
+ # # @option options [Integer] :rows (nil) The number of rows returned by a function
24
+ # # @option options [#to_s] :comment The description of the function
25
25
  # # @yield [f] the block with the function's definition
26
26
  # # @yieldparam Object receiver of methods specifying the function
27
27
  # # @return [void]
@@ -5,7 +5,7 @@
5
5
  # # Change the name and/or schema of a function
6
6
  # #
7
7
  # # @param [#to_s] :name (nil) The qualified name of the function
8
- # # @option [#to_s] :to (nil) The new qualified name for the function
8
+ # # @option options [#to_s] :to (nil) The new qualified name for the function
9
9
  # # @return [void]
10
10
  # #
11
11
  # # A function can be renamed by changing both the name
@@ -5,7 +5,7 @@
5
5
  # # Modify a materialized view
6
6
  # #
7
7
  # # @param [#to_s] name (nil) The qualified name of the view
8
- # # @option [Boolean] :if_exists (false) Suppress the error when the view is absent
8
+ # # @option options [Boolean] :if_exists (false) Suppress the error when the view is absent
9
9
  # # @yield [v] the block with the view's definition
10
10
  # # @yieldparam Object receiver of methods specifying the view
11
11
  # # @return [void]
@@ -5,13 +5,13 @@
5
5
  # # Create a materialized view
6
6
  # #
7
7
  # # @param [#to_s] name (nil) The qualified name of the view
8
- # # @option [Boolean] :if_not_exists (false) Suppress the error when a view has been already created
9
- # # @option [#to_s] :sql_definition (nil) The snippet containing the query
10
- # # @option [#to_i] :version (nil)
8
+ # # @option options [Boolean] :if_not_exists (false) Suppress the error when a view has been already created
9
+ # # @option options [#to_s] :sql_definition (nil) The snippet containing the query
10
+ # # @option options [#to_i] :version (nil)
11
11
  # # The alternative way to set sql_definition by referencing to a file containing the snippet
12
- # # @option [#to_s] :tablespace (nil) The tablespace for the view
13
- # # @option [Boolean] :with_data (true) If the view should be populated after creation
14
- # # @option [#to_s] :comment (nil) The comment describing the view
12
+ # # @option options [#to_s] :tablespace (nil) The tablespace for the view
13
+ # # @option options [Boolean] :with_data (true) If the view should be populated after creation
14
+ # # @option options [#to_s] :comment (nil) The comment describing the view
15
15
  # # @yield [v] the block with the view's definition
16
16
  # # @yieldparam Object receiver of methods specifying the view
17
17
  # # @return [void]
@@ -5,14 +5,14 @@
5
5
  # # Drop a materialized view
6
6
  # #
7
7
  # # @param [#to_s] name (nil) The qualified name of the view
8
- # # @option [Boolean] :if_exists (false) Suppress the error when the view is absent
9
- # # @option [Symbol] :force (:restrict) How to process dependent objects (`:cascade` or `:restrict`)
10
- # # @option [#to_s] :sql_definition (nil) The snippet containing the query
11
- # # @option [#to_i] :revert_to_version (nil)
8
+ # # @option options [Boolean] :if_exists (false) Suppress the error when the view is absent
9
+ # # @option options [Symbol] :force (:restrict) How to process dependent objects (`:cascade` or `:restrict`)
10
+ # # @option options [#to_s] :sql_definition (nil) The snippet containing the query
11
+ # # @option options [#to_i] :revert_to_version (nil)
12
12
  # # The alternative way to set sql_definition by referencing to a file containing the snippet
13
- # # @option [#to_s] :tablespace (nil) The tablespace for the view
14
- # # @option [Boolean] :with_data (true) If the view should be populated after creation
15
- # # @option [#to_s] :comment (nil) The comment describing the view
13
+ # # @option options [#to_s] :tablespace (nil) The tablespace for the view
14
+ # # @option options [Boolean] :with_data (true) If the view should be populated after creation
15
+ # # @option options [#to_s] :comment (nil) The comment describing the view
16
16
  # # @yield [v] the block with the view's definition
17
17
  # # @yieldparam Object receiver of methods specifying the view
18
18
  # # @return [void]
@@ -5,8 +5,8 @@
5
5
  # # Refresh a materialized view
6
6
  # #
7
7
  # # @param [#to_s] name (nil) The qualified name of the view
8
- # # @option [Boolean] :with_data (true) If the view should be populated after creation
9
- # # @option [Symbol] :algorithm (nil) Makes the operation concurrent when set to :concurrently
8
+ # # @option options [Boolean] :with_data (true) If the view should be populated after creation
9
+ # # @option options [Symbol] :algorithm (nil) Makes the operation concurrent when set to :concurrently
10
10
  # # @return [void]
11
11
  # #
12
12
  # # The operation enables refreshing a materialized view
@@ -5,8 +5,8 @@
5
5
  # # Change the name and/or schema of a materialized view
6
6
  # #
7
7
  # # @param [#to_s] :name (nil) The qualified name of the view
8
- # # @option [#to_s] :to (nil) The new qualified name for the view
9
- # # @option [Boolean] :if_exists (false) Suppress the error when the view is absent
8
+ # # @option options [#to_s] :to (nil) The new qualified name for the view
9
+ # # @option options [Boolean] :if_exists (false) Suppress the error when the view is absent
10
10
  # # @return [void]
11
11
  # #
12
12
  # # A materialized view can be renamed by changing both the name
@@ -5,7 +5,7 @@
5
5
  # # Modify a procedure
6
6
  # #
7
7
  # # @param [#to_s] name (nil) The qualified name of the procedure
8
- # # @option [Boolean] :if_exists (false) Suppress the error when the procedure is absent
8
+ # # @option options [Boolean] :if_exists (false) Suppress the error when the procedure is absent
9
9
  # # @yield [p] the block with the procedure's definition
10
10
  # # @yieldparam Object receiver of methods specifying the procedure
11
11
  # # @return [void]
@@ -6,12 +6,12 @@
6
6
  # #
7
7
  # # @param [#to_s] name (nil)
8
8
  # # The qualified name of the procedure with arguments and returned value type
9
- # # @option [Boolean] :replace_existing (false) If the procedure should overwrite an existing one
10
- # # @option [#to_s] :language ("sql") The language (like "sql" or "plpgsql")
11
- # # @option [#to_s] :body (nil) The body of the procedure
12
- # # @option [Symbol] :security (:invoker) Define the role under which the procedure is invoked
9
+ # # @option options [Boolean] :replace_existing (false) If the procedure should overwrite an existing one
10
+ # # @option options [#to_s] :language ("sql") The language (like "sql" or "plpgsql")
11
+ # # @option options [#to_s] :body (nil) The body of the procedure
12
+ # # @option options [Symbol] :security (:invoker) Define the role under which the procedure is invoked
13
13
  # # Supported values: :invoker (default), :definer
14
- # # @option [#to_s] :comment The description of the procedure
14
+ # # @option options [#to_s] :comment The description of the procedure
15
15
  # # @yield [p] the block with the procedure's definition
16
16
  # # @yieldparam Object receiver of methods specifying the procedure
17
17
  # # @return [void]
@@ -6,12 +6,12 @@
6
6
  # #
7
7
  # # @param [#to_s] name (nil)
8
8
  # # The qualified name of the procedure with arguments and returned value type
9
- # # @option [Boolean] :if_exists (false) Suppress the error when the procedure is absent
10
- # # @option [#to_s] :language ("sql") The language (like "sql" or "plpgsql")
11
- # # @option [#to_s] :body (nil) The body of the procedure
12
- # # @option [Symbol] :security (:invoker) Define the role under which the procedure is invoked
9
+ # # @option options [Boolean] :if_exists (false) Suppress the error when the procedure is absent
10
+ # # @option options [#to_s] :language ("sql") The language (like "sql" or "plpgsql")
11
+ # # @option options [#to_s] :body (nil) The body of the procedure
12
+ # # @option options [Symbol] :security (:invoker) Define the role under which the procedure is invoked
13
13
  # # Supported values: :invoker (default), :definer
14
- # # @option [#to_s] :comment The description of the procedure
14
+ # # @option options [#to_s] :comment The description of the procedure
15
15
  # # @yield [p] the block with the procedure's definition
16
16
  # # @yieldparam Object receiver of methods specifying the procedure
17
17
  # # @return [void]
@@ -5,7 +5,7 @@
5
5
  # # Change the name and/or schema of a procedure
6
6
  # #
7
7
  # # @param [#to_s] :name (nil) The qualified name of the procedure
8
- # # @option [#to_s] :to (nil) The new qualified name for the procedure
8
+ # # @option options [#to_s] :to (nil) The new qualified name for the procedure
9
9
  # # @return [void]
10
10
  # #
11
11
  # # A procedure can be renamed by changing both the name