acts-as-messageable 0.5.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +8 -0
- data/.github/workflows/test.yml +152 -0
- data/.rubocop.yml +14 -1
- data/.rubocop_todo.yml +49 -7
- data/.ruby-version +1 -0
- data/Appraisals +11 -0
- data/Dockerfile +2 -1
- data/Gemfile +19 -13
- data/Gemfile.lock +186 -97
- data/README.md +2 -3
- data/Rakefile +6 -1
- data/VERSION +1 -1
- data/acts-as-messageable.gemspec +193 -40
- data/bin/tapioca +29 -0
- data/docker-compose.yml +82 -71
- data/gemfiles/rails_3.2.gemfile +14 -9
- data/gemfiles/rails_4.2.gemfile +14 -9
- data/gemfiles/rails_5.2.gemfile +14 -9
- data/gemfiles/rails_6.0.gemfile +14 -9
- data/gemfiles/rails_7.0.gemfile +29 -0
- data/gemfiles/rails_master.gemfile +15 -9
- data/lib/acts-as-messageable.rb +1 -0
- data/lib/acts_as_messageable/message.rb +62 -5
- data/lib/acts_as_messageable/model.rb +71 -20
- data/lib/acts_as_messageable/rails3.rb +27 -2
- data/lib/acts_as_messageable/rails4.rb +31 -4
- data/lib/acts_as_messageable/rails6.rb +34 -2
- data/lib/acts_as_messageable/railtie.rb +1 -0
- data/lib/acts_as_messageable/relation.rb +18 -2
- data/lib/acts_as_messageable/scopes.rb +11 -0
- data/lib/acts_as_messageable.rb +18 -0
- data/lib/generators/acts_as_messageable/migration/migration_generator.rb +4 -0
- data/lib/generators/acts_as_messageable/migration/templates/migration.rb +1 -0
- data/lib/generators/acts_as_messageable/migration/templates/migration_indexes.rb +1 -0
- data/lib/generators/acts_as_messageable/migration/templates/migration_opened_as_datetime.rb +1 -0
- data/lib/generators/acts_as_messageable/migration/templates/migration_permanent.rb +1 -0
- data/sorbet/config +4 -0
- data/sorbet/rbi/annotations/actionpack.rbi +428 -0
- data/sorbet/rbi/annotations/actionview.rbi +77 -0
- data/sorbet/rbi/annotations/activerecord.rbi +18 -0
- data/sorbet/rbi/annotations/activesupport.rbi +52 -0
- data/sorbet/rbi/annotations/faraday.rbi +17 -0
- data/sorbet/rbi/annotations/railties.rbi +58 -0
- data/sorbet/rbi/annotations/rainbow.rbi +269 -0
- data/sorbet/rbi/dsl/abstract_controller/caching/fragments.rbi +23 -0
- data/sorbet/rbi/dsl/abstract_controller/caching.rbi +30 -0
- data/sorbet/rbi/dsl/abstract_controller/callbacks.rbi +23 -0
- data/sorbet/rbi/dsl/abstract_controller/helpers.rbi +23 -0
- data/sorbet/rbi/dsl/abstract_controller/rendering.rbi +9 -0
- data/sorbet/rbi/dsl/abstract_controller/url_for.rbi +23 -0
- data/sorbet/rbi/dsl/action_controller/caching.rbi +29 -0
- data/sorbet/rbi/dsl/action_controller/conditional_get.rbi +23 -0
- data/sorbet/rbi/dsl/action_controller/content_security_policy.rbi +31 -0
- data/sorbet/rbi/dsl/action_controller/data_streaming.rbi +9 -0
- data/sorbet/rbi/dsl/action_controller/etag_with_flash.rbi +24 -0
- data/sorbet/rbi/dsl/action_controller/etag_with_template_digest.rbi +30 -0
- data/sorbet/rbi/dsl/action_controller/flash.rbi +19 -0
- data/sorbet/rbi/dsl/action_controller/form_builder.rbi +19 -0
- data/sorbet/rbi/dsl/action_controller/helpers.rbi +36 -0
- data/sorbet/rbi/dsl/action_controller/params_wrapper.rbi +23 -0
- data/sorbet/rbi/dsl/action_controller/redirecting.rbi +24 -0
- data/sorbet/rbi/dsl/action_controller/renderers/all.rbi +24 -0
- data/sorbet/rbi/dsl/action_controller/renderers.rbi +23 -0
- data/sorbet/rbi/dsl/action_controller/request_forgery_protection.rbi +31 -0
- data/sorbet/rbi/dsl/action_controller/rescue.rbi +24 -0
- data/sorbet/rbi/dsl/action_controller/test_case/behavior.rbi +24 -0
- data/sorbet/rbi/dsl/action_controller/url_for.rbi +24 -0
- data/sorbet/rbi/dsl/action_dispatch/routing/url_for.rbi +23 -0
- data/sorbet/rbi/dsl/action_view/helpers/form_helper.rbi +10 -0
- data/sorbet/rbi/dsl/action_view/helpers/form_tag_helper.rbi +10 -0
- data/sorbet/rbi/dsl/action_view/helpers/text_helper.rbi +9 -0
- data/sorbet/rbi/dsl/action_view/helpers.rbi +10 -0
- data/sorbet/rbi/dsl/action_view/layouts.rbi +24 -0
- data/sorbet/rbi/dsl/action_view/rendering.rbi +9 -0
- data/sorbet/rbi/dsl/active_model/attribute_methods.rbi +27 -0
- data/sorbet/rbi/dsl/active_model/attributes.rbi +34 -0
- data/sorbet/rbi/dsl/active_model/dirty.rbi +28 -0
- data/sorbet/rbi/dsl/active_model/serializers/json.rbi +22 -0
- data/sorbet/rbi/dsl/active_model/validations/callbacks.rbi +22 -0
- data/sorbet/rbi/dsl/active_model/validations.rbi +27 -0
- data/sorbet/rbi/dsl/active_record/attribute_methods/dirty.rbi +38 -0
- data/sorbet/rbi/dsl/active_record/attribute_methods/time_zone_conversion.rbi +32 -0
- data/sorbet/rbi/dsl/active_record/attribute_methods.rbi +53 -0
- data/sorbet/rbi/dsl/active_record/attributes.rbi +19 -0
- data/sorbet/rbi/dsl/active_record/callbacks.rbi +22 -0
- data/sorbet/rbi/dsl/active_record/core.rbi +55 -0
- data/sorbet/rbi/dsl/active_record/encryption/encryptable_record.rbi +23 -0
- data/sorbet/rbi/dsl/active_record/inheritance.rbi +27 -0
- data/sorbet/rbi/dsl/active_record/integration.rbi +32 -0
- data/sorbet/rbi/dsl/active_record/locking/optimistic.rbi +22 -0
- data/sorbet/rbi/dsl/active_record/model_schema.rbi +52 -0
- data/sorbet/rbi/dsl/active_record/nested_attributes.rbi +22 -0
- data/sorbet/rbi/dsl/active_record/readonly_attributes.rbi +19 -0
- data/sorbet/rbi/dsl/active_record/reflection.rbi +32 -0
- data/sorbet/rbi/dsl/active_record/scoping/default.rbi +23 -0
- data/sorbet/rbi/dsl/active_record/scoping.rbi +23 -0
- data/sorbet/rbi/dsl/active_record/serialization.rbi +22 -0
- data/sorbet/rbi/dsl/active_record/signed_id.rbi +22 -0
- data/sorbet/rbi/dsl/active_record/test_fixtures.rbi +58 -0
- data/sorbet/rbi/dsl/active_record/timestamp.rbi +23 -0
- data/sorbet/rbi/dsl/active_record/validations.rbi +28 -0
- data/sorbet/rbi/dsl/active_support/actionable_error.rbi +23 -0
- data/sorbet/rbi/dsl/active_support/callbacks.rbi +22 -0
- data/sorbet/rbi/dsl/active_support/rescuable.rbi +23 -0
- data/sorbet/rbi/dsl/active_support/testing/file_fixtures.rbi +22 -0
- data/sorbet/rbi/gems/actionpack@7.0.4.3.rbi +19265 -0
- data/sorbet/rbi/gems/actionview@7.0.4.3.rbi +15482 -0
- data/sorbet/rbi/gems/activemodel@7.0.4.3.rbi +6025 -0
- data/sorbet/rbi/gems/activerecord@7.0.4.3.rbi +37852 -0
- data/sorbet/rbi/gems/activesupport@7.0.4.3.rbi +18788 -0
- data/sorbet/rbi/gems/addressable@2.4.0.rbi +8 -0
- data/sorbet/rbi/gems/appraisal@2.4.1.rbi +584 -0
- data/sorbet/rbi/gems/ast@2.4.2.rbi +584 -0
- data/sorbet/rbi/gems/builder@3.2.4.rbi +8 -0
- data/sorbet/rbi/gems/coderay@1.1.3.rbi +3426 -0
- data/sorbet/rbi/gems/commander@4.6.0.rbi +8 -0
- data/sorbet/rbi/gems/concurrent-ruby@1.2.2.rbi +11545 -0
- data/sorbet/rbi/gems/coveralls_reborn@0.27.0.rbi +8 -0
- data/sorbet/rbi/gems/crass@1.0.6.rbi +622 -0
- data/sorbet/rbi/gems/descendants_tracker@0.0.4.rbi +8 -0
- data/sorbet/rbi/gems/diff-lcs@1.5.0.rbi +1079 -0
- data/sorbet/rbi/gems/docile@1.4.0.rbi +8 -0
- data/sorbet/rbi/gems/erubi@1.12.0.rbi +146 -0
- data/sorbet/rbi/gems/faraday@0.9.2.rbi +964 -0
- data/sorbet/rbi/gems/git@1.11.0.rbi +2700 -0
- data/sorbet/rbi/gems/github_api@0.16.0.rbi +8 -0
- data/sorbet/rbi/gems/hashie@5.0.0.rbi +8 -0
- data/sorbet/rbi/gems/highline@2.0.3.rbi +8 -0
- data/sorbet/rbi/gems/i18n@1.12.0.rbi +2296 -0
- data/sorbet/rbi/gems/jeweler@2.3.9.rbi +1591 -0
- data/sorbet/rbi/gems/json@2.6.3.rbi +1541 -0
- data/sorbet/rbi/gems/jwt@2.5.0.rbi +8 -0
- data/sorbet/rbi/gems/loofah@2.19.1.rbi +904 -0
- data/sorbet/rbi/gems/method_source@1.0.0.rbi +272 -0
- data/sorbet/rbi/gems/mime-types@2.99.3.rbi +8 -0
- data/sorbet/rbi/gems/minitest@5.18.0.rbi +1491 -0
- data/sorbet/rbi/gems/multi_json@1.15.0.rbi +8 -0
- data/sorbet/rbi/gems/multi_xml@0.6.0.rbi +8 -0
- data/sorbet/rbi/gems/multipart-post@2.2.3.rbi +8 -0
- data/sorbet/rbi/gems/netrc@0.11.0.rbi +158 -0
- data/sorbet/rbi/gems/nokogiri@1.14.2.rbi +7244 -0
- data/sorbet/rbi/gems/oauth2@1.4.8.rbi +8 -0
- data/sorbet/rbi/gems/parallel@1.22.1.rbi +277 -0
- data/sorbet/rbi/gems/pg@1.4.6.rbi +2574 -0
- data/sorbet/rbi/gems/polyfill@1.9.0.rbi +8 -0
- data/sorbet/rbi/gems/pry@0.14.2.rbi +10081 -0
- data/sorbet/rbi/gems/psych@4.0.6.rbi +1819 -0
- data/sorbet/rbi/gems/racc@1.6.2.rbi +155 -0
- data/sorbet/rbi/gems/rack-test@2.0.2.rbi +943 -0
- data/sorbet/rbi/gems/rack@2.2.6.4.rbi +5659 -0
- data/sorbet/rbi/gems/rails-dom-testing@2.0.3.rbi +455 -0
- data/sorbet/rbi/gems/rails-html-sanitizer@1.5.0.rbi +685 -0
- data/sorbet/rbi/gems/railties@7.0.4.3.rbi +4553 -0
- data/sorbet/rbi/gems/rainbow@3.1.1.rbi +8 -0
- data/sorbet/rbi/gems/rake@13.0.6.rbi +2959 -0
- data/sorbet/rbi/gems/rbi@0.0.16.rbi +3008 -0
- data/sorbet/rbi/gems/rbs@2.8.0.rbi +8 -0
- data/sorbet/rbi/gems/rchardet@1.8.0.rbi +1078 -0
- data/sorbet/rbi/gems/rdoc@6.5.0.rbi +12441 -0
- data/sorbet/rbi/gems/regexp_parser@2.7.0.rbi +8 -0
- data/sorbet/rbi/gems/rexml@3.2.5.rbi +8 -0
- data/sorbet/rbi/gems/rspec-core@3.12.0.rbi +10798 -0
- data/sorbet/rbi/gems/rspec-expectations@3.12.0.rbi +8090 -0
- data/sorbet/rbi/gems/rspec-mocks@3.12.0.rbi +5296 -0
- data/sorbet/rbi/gems/rspec-support@3.12.0.rbi +1617 -0
- data/sorbet/rbi/gems/rspec@3.12.0.rbi +88 -0
- data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +8 -0
- data/sorbet/rbi/gems/safe_type@1.1.1.rbi +8 -0
- data/sorbet/rbi/gems/semver2@3.4.2.rbi +8 -0
- data/sorbet/rbi/gems/simplecov-html@0.12.3.rbi +8 -0
- data/sorbet/rbi/gems/simplecov@0.22.0.rbi +8 -0
- data/sorbet/rbi/gems/simplecov_json_formatter@0.1.4.rbi +8 -0
- data/sorbet/rbi/gems/sorbet-coerce@0.7.0.rbi +8 -0
- data/sorbet/rbi/gems/stringio@3.0.2.rbi +8 -0
- data/sorbet/rbi/gems/sync@0.5.0.rbi +8 -0
- data/sorbet/rbi/gems/term-ansicolor@1.7.1.rbi +8 -0
- data/sorbet/rbi/gems/thor@1.2.1.rbi +3956 -0
- data/sorbet/rbi/gems/thread_safe@0.3.6.rbi +8 -0
- data/sorbet/rbi/gems/timecop@0.9.6.rbi +361 -0
- data/sorbet/rbi/gems/tins@1.32.1.rbi +8 -0
- data/sorbet/rbi/gems/tzinfo@2.0.6.rbi +5917 -0
- data/sorbet/rbi/gems/unicode-display_width@2.4.2.rbi +8 -0
- data/sorbet/rbi/gems/unparser@0.6.7.rbi +4515 -0
- data/sorbet/rbi/gems/webrick@1.7.0.rbi +2553 -0
- data/sorbet/rbi/gems/yard@0.9.28.rbi +17954 -0
- data/sorbet/rbi/gems/zeitwerk@2.6.7.rbi +966 -0
- data/sorbet/rbi/models/acts-as-messageable/message.rbi +668 -0
- data/sorbet/rbi/models/acts-as-messageable/user.rbi +343 -0
- data/sorbet/rbi/rails-rbi/active_record_base.rbi +119 -0
- data/sorbet/rbi/rails-rbi/active_record_relation.rbi +180 -0
- data/sorbet/rbi/shims/activerecord.rbi +4 -0
- data/sorbet/rbi/shims/model.rbi +9 -0
- data/sorbet/tapioca/config.yml +10 -0
- data/sorbet/tapioca/pre_require.rb +5 -0
- data/sorbet/tapioca/require.rb +10 -0
- data/spec/acts_as_messageable_spec.rb +7 -4
- data/spec/custom_class_spec.rb +1 -0
- data/spec/custom_required_spec.rb +8 -4
- data/spec/group_messages_spec.rb +1 -0
- data/spec/migrations_spec.rb +2 -1
- data/spec/spec_helper.rb +19 -9
- data/spec/support/admin.rb +3 -0
- data/spec/support/custom_message.rb +3 -0
- data/spec/support/custom_message_uuid.rb +1 -0
- data/spec/support/custom_search_user.rb +3 -0
- data/spec/support/men.rb +1 -0
- data/spec/support/send_message.rb +8 -1
- data/spec/support/table_schema.rb +7 -6
- data/spec/support/user.rb +3 -0
- data/spec/support/uuid_user.rb +3 -0
- data/tasks/types.rake +46 -0
- metadata +261 -11
- data/.travis.yml +0 -55
@@ -0,0 +1,2574 @@
|
|
1
|
+
# typed: true
|
2
|
+
|
3
|
+
# DO NOT EDIT MANUALLY
|
4
|
+
# This is an autogenerated file for types exported from the `pg` gem.
|
5
|
+
# Please instead update this file by running `bin/tapioca gem pg`.
|
6
|
+
|
7
|
+
# The top-level PG namespace.
|
8
|
+
#
|
9
|
+
# source://pg//lib/pg.rb#6
|
10
|
+
module PG
|
11
|
+
include ::PG::Constants
|
12
|
+
|
13
|
+
class << self
|
14
|
+
# Convenience alias for PG::Connection.new.
|
15
|
+
#
|
16
|
+
# source://pg//lib/pg.rb#62
|
17
|
+
def connect(*args, &block); end
|
18
|
+
|
19
|
+
def init_openssl(_arg0, _arg1); end
|
20
|
+
def init_ssl(_arg0); end
|
21
|
+
def is_threadsafe?; end
|
22
|
+
def isthreadsafe; end
|
23
|
+
def library_version; end
|
24
|
+
def threadsafe?; end
|
25
|
+
|
26
|
+
# Get the PG library version.
|
27
|
+
#
|
28
|
+
# +include_buildnum+ is no longer used and any value passed will be ignored.
|
29
|
+
#
|
30
|
+
# source://pg//lib/pg.rb#56
|
31
|
+
def version_string(include_buildnum = T.unsafe(nil)); end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
class PG::ActiveSqlTransaction < ::PG::InvalidTransactionState; end
|
36
|
+
class PG::AdminShutdown < ::PG::OperatorIntervention; end
|
37
|
+
class PG::AmbiguousAlias < ::PG::SyntaxErrorOrAccessRuleViolation; end
|
38
|
+
class PG::AmbiguousColumn < ::PG::SyntaxErrorOrAccessRuleViolation; end
|
39
|
+
class PG::AmbiguousFunction < ::PG::SyntaxErrorOrAccessRuleViolation; end
|
40
|
+
class PG::AmbiguousParameter < ::PG::SyntaxErrorOrAccessRuleViolation; end
|
41
|
+
class PG::ArraySubscriptError < ::PG::DataException; end
|
42
|
+
class PG::AssertFailure < ::PG::PlpgsqlError; end
|
43
|
+
class PG::BadCopyFileFormat < ::PG::DataException; end
|
44
|
+
|
45
|
+
# Simple set of rules for type casting common PostgreSQL types from Ruby
|
46
|
+
# to PostgreSQL.
|
47
|
+
#
|
48
|
+
# OIDs of supported type casts are not hard-coded in the sources, but are retrieved from the
|
49
|
+
# PostgreSQL's +pg_type+ table in PG::BasicTypeMapBasedOnResult.new .
|
50
|
+
#
|
51
|
+
# This class works equal to PG::BasicTypeMapForResults, but does not define decoders for
|
52
|
+
# the given result OIDs, but encoders. So it can be used to type cast field values based on
|
53
|
+
# the type OID retrieved by a separate SQL query.
|
54
|
+
#
|
55
|
+
# PG::TypeMapByOid#build_column_map(result) can be used to generate a result independent
|
56
|
+
# PG::TypeMapByColumn type map, which can subsequently be used to cast query bind parameters
|
57
|
+
# or #put_copy_data fields.
|
58
|
+
#
|
59
|
+
# Example:
|
60
|
+
# conn.exec( "CREATE TEMP TABLE copytable (t TEXT, i INT, ai INT[])" )
|
61
|
+
#
|
62
|
+
# # Retrieve table OIDs per empty result set.
|
63
|
+
# res = conn.exec( "SELECT * FROM copytable LIMIT 0" )
|
64
|
+
# # Build a type map for common ruby to database type encoders.
|
65
|
+
# btm = PG::BasicTypeMapBasedOnResult.new(conn)
|
66
|
+
# # Build a PG::TypeMapByColumn with encoders suitable for copytable.
|
67
|
+
# tm = btm.build_column_map( res )
|
68
|
+
# row_encoder = PG::TextEncoder::CopyRow.new type_map: tm
|
69
|
+
#
|
70
|
+
# conn.copy_data( "COPY copytable FROM STDIN", row_encoder ) do |res|
|
71
|
+
# conn.put_copy_data ['a', 123, [5,4,3]]
|
72
|
+
# end
|
73
|
+
# This inserts a single row into copytable with type casts from ruby to
|
74
|
+
# database types.
|
75
|
+
#
|
76
|
+
# source://pg//lib/pg/basic_type_map_based_on_result.rb#36
|
77
|
+
class PG::BasicTypeMapBasedOnResult < ::PG::TypeMapByOid
|
78
|
+
include ::PG::BasicTypeRegistry::Checker
|
79
|
+
|
80
|
+
# @return [BasicTypeMapBasedOnResult] a new instance of BasicTypeMapBasedOnResult
|
81
|
+
#
|
82
|
+
# source://pg//lib/pg/basic_type_map_based_on_result.rb#39
|
83
|
+
def initialize(connection_or_coder_maps, registry: T.unsafe(nil)); end
|
84
|
+
end
|
85
|
+
|
86
|
+
# Simple set of rules for type casting common Ruby types to PostgreSQL.
|
87
|
+
#
|
88
|
+
# OIDs of supported type casts are not hard-coded in the sources, but are retrieved from the
|
89
|
+
# PostgreSQL's pg_type table in PG::BasicTypeMapForQueries.new .
|
90
|
+
#
|
91
|
+
# Query params are type casted based on the class of the given value.
|
92
|
+
#
|
93
|
+
# Higher level libraries will most likely not make use of this class, but use their
|
94
|
+
# own derivation of PG::TypeMapByClass or another set of rules to choose suitable
|
95
|
+
# encoders and decoders for the values to be sent.
|
96
|
+
#
|
97
|
+
# Example:
|
98
|
+
# conn = PG::Connection.new
|
99
|
+
# # Assign a default ruleset for type casts of input and output values.
|
100
|
+
# conn.type_map_for_queries = PG::BasicTypeMapForQueries.new(conn)
|
101
|
+
# # Execute a query. The Integer param value is typecasted internally by PG::BinaryEncoder::Int8.
|
102
|
+
# # The format of the parameter is set to 0 (text) and the OID of this parameter is set to 20 (int8).
|
103
|
+
# res = conn.exec_params( "SELECT $1", [5] )
|
104
|
+
#
|
105
|
+
# source://pg//lib/pg/basic_type_map_for_queries.rb#24
|
106
|
+
class PG::BasicTypeMapForQueries < ::PG::TypeMapByClass
|
107
|
+
include ::PG::BasicTypeRegistry::Checker
|
108
|
+
|
109
|
+
# Create a new type map for query submission
|
110
|
+
#
|
111
|
+
# Options:
|
112
|
+
# * +registry+: Custom type registry, nil for default global registry
|
113
|
+
# * +if_undefined+: Optional +Proc+ object which is called, if no type for an parameter class is not defined in the registry.
|
114
|
+
#
|
115
|
+
# @return [BasicTypeMapForQueries] a new instance of BasicTypeMapForQueries
|
116
|
+
#
|
117
|
+
# source://pg//lib/pg/basic_type_map_for_queries.rb#50
|
118
|
+
def initialize(connection_or_coder_maps, registry: T.unsafe(nil), if_undefined: T.unsafe(nil)); end
|
119
|
+
|
120
|
+
# Returns the value of attribute encode_array_as.
|
121
|
+
#
|
122
|
+
# source://pg//lib/pg/basic_type_map_for_queries.rb#86
|
123
|
+
def encode_array_as; end
|
124
|
+
|
125
|
+
# Change the mechanism that is used to encode ruby array values
|
126
|
+
#
|
127
|
+
# Possible values:
|
128
|
+
# * +:array+ : Encode the ruby array as a PostgreSQL array.
|
129
|
+
# The array element type is inferred from the class of the first array element. This is the default.
|
130
|
+
# * +:json+ : Encode the ruby array as a JSON document.
|
131
|
+
# * +:record+ : Encode the ruby array as a composite type row.
|
132
|
+
# * <code>"_type"</code> : Encode the ruby array as a particular PostgreSQL type.
|
133
|
+
# All PostgreSQL array types are supported.
|
134
|
+
# If there's an encoder registered for the elements +type+, it will be used.
|
135
|
+
# Otherwise a string conversion (by +value.to_s+) is done.
|
136
|
+
#
|
137
|
+
# source://pg//lib/pg/basic_type_map_for_queries.rb#71
|
138
|
+
def encode_array_as=(pg_type); end
|
139
|
+
|
140
|
+
private
|
141
|
+
|
142
|
+
# source://pg//lib/pg/basic_type_map_for_queries.rb#148
|
143
|
+
def array_encoders_by_klass; end
|
144
|
+
|
145
|
+
# source://pg//lib/pg/basic_type_map_for_queries.rb#96
|
146
|
+
def coder_by_name(format, direction, name); end
|
147
|
+
|
148
|
+
# source://pg//lib/pg/basic_type_map_for_queries.rb#155
|
149
|
+
def get_array_type(value); end
|
150
|
+
|
151
|
+
# source://pg//lib/pg/basic_type_map_for_queries.rb#90
|
152
|
+
def init_encoders; end
|
153
|
+
|
154
|
+
# source://pg//lib/pg/basic_type_map_for_queries.rb#105
|
155
|
+
def populate_encoder_list; end
|
156
|
+
|
157
|
+
# source://pg//lib/pg/basic_type_map_for_queries.rb#101
|
158
|
+
def undefined(name, format); end
|
159
|
+
end
|
160
|
+
|
161
|
+
# Helper class for submission of binary strings into bytea columns.
|
162
|
+
#
|
163
|
+
# Since PG::BasicTypeMapForQueries chooses the encoder to be used by the class of the submitted value,
|
164
|
+
# it's necessary to send binary strings as BinaryData.
|
165
|
+
# That way they're distinct from text strings.
|
166
|
+
# Please note however that PG::BasicTypeMapForResults delivers bytea columns as plain String
|
167
|
+
# with binary encoding.
|
168
|
+
#
|
169
|
+
# conn.type_map_for_queries = PG::BasicTypeMapForQueries.new(conn)
|
170
|
+
# conn.exec("CREATE TEMP TABLE test (data bytea)")
|
171
|
+
# bd = PG::BasicTypeMapForQueries::BinaryData.new("ab\xff\0cd")
|
172
|
+
# conn.exec_params("INSERT INTO test (data) VALUES ($1)", [bd])
|
173
|
+
#
|
174
|
+
# source://pg//lib/pg/basic_type_map_for_queries.rb#37
|
175
|
+
class PG::BasicTypeMapForQueries::BinaryData < ::String; end
|
176
|
+
|
177
|
+
# source://pg//lib/pg/basic_type_map_for_queries.rb#182
|
178
|
+
PG::BasicTypeMapForQueries::DEFAULT_ARRAY_TYPE_MAP = T.let(T.unsafe(nil), Hash)
|
179
|
+
|
180
|
+
# source://pg//lib/pg/basic_type_map_for_queries.rb#165
|
181
|
+
PG::BasicTypeMapForQueries::DEFAULT_TYPE_MAP = T.let(T.unsafe(nil), Hash)
|
182
|
+
|
183
|
+
# source://pg//lib/pg/basic_type_map_for_queries.rb#40
|
184
|
+
class PG::BasicTypeMapForQueries::UndefinedEncoder < ::RuntimeError; end
|
185
|
+
|
186
|
+
# Simple set of rules for type casting common PostgreSQL types to Ruby.
|
187
|
+
#
|
188
|
+
# OIDs of supported type casts are not hard-coded in the sources, but are retrieved from the
|
189
|
+
# PostgreSQL's +pg_type+ table in PG::BasicTypeMapForResults.new .
|
190
|
+
#
|
191
|
+
# Result values are type casted based on the type OID of the given result column.
|
192
|
+
#
|
193
|
+
# Higher level libraries will most likely not make use of this class, but use their
|
194
|
+
# own set of rules to choose suitable encoders and decoders.
|
195
|
+
#
|
196
|
+
# Example:
|
197
|
+
# conn = PG::Connection.new
|
198
|
+
# # Assign a default ruleset for type casts of output values.
|
199
|
+
# conn.type_map_for_results = PG::BasicTypeMapForResults.new(conn)
|
200
|
+
# # Execute a query.
|
201
|
+
# res = conn.exec_params( "SELECT $1::INT", ['5'] )
|
202
|
+
# # Retrieve and cast the result value. Value format is 0 (text) and OID is 20. Therefore typecasting
|
203
|
+
# # is done by PG::TextDecoder::Integer internally for all value retrieval methods.
|
204
|
+
# res.values # => [[5]]
|
205
|
+
#
|
206
|
+
# PG::TypeMapByOid#build_column_map(result) can be used to generate
|
207
|
+
# a result independent PG::TypeMapByColumn type map, which can subsequently be used
|
208
|
+
# to cast #get_copy_data fields:
|
209
|
+
#
|
210
|
+
# For the following table:
|
211
|
+
# conn.exec( "CREATE TABLE copytable AS VALUES('a', 123, '{5,4,3}'::INT[])" )
|
212
|
+
#
|
213
|
+
# # Retrieve table OIDs per empty result set.
|
214
|
+
# res = conn.exec( "SELECT * FROM copytable LIMIT 0" )
|
215
|
+
# # Build a type map for common database to ruby type decoders.
|
216
|
+
# btm = PG::BasicTypeMapForResults.new(conn)
|
217
|
+
# # Build a PG::TypeMapByColumn with decoders suitable for copytable.
|
218
|
+
# tm = btm.build_column_map( res )
|
219
|
+
# row_decoder = PG::TextDecoder::CopyRow.new type_map: tm
|
220
|
+
#
|
221
|
+
# conn.copy_data( "COPY copytable TO STDOUT", row_decoder ) do |res|
|
222
|
+
# while row=conn.get_copy_data
|
223
|
+
# p row
|
224
|
+
# end
|
225
|
+
# end
|
226
|
+
# This prints the rows with type casted columns:
|
227
|
+
# ["a", 123, [5, 4, 3]]
|
228
|
+
#
|
229
|
+
# See also PG::BasicTypeMapBasedOnResult for the encoder direction and PG::BasicTypeRegistry for the definition of additional types.
|
230
|
+
#
|
231
|
+
# source://pg//lib/pg/basic_type_map_for_results.rb#50
|
232
|
+
class PG::BasicTypeMapForResults < ::PG::TypeMapByOid
|
233
|
+
include ::PG::BasicTypeRegistry::Checker
|
234
|
+
|
235
|
+
# @return [BasicTypeMapForResults] a new instance of BasicTypeMapForResults
|
236
|
+
#
|
237
|
+
# source://pg//lib/pg/basic_type_map_for_results.rb#70
|
238
|
+
def initialize(connection_or_coder_maps, registry: T.unsafe(nil)); end
|
239
|
+
end
|
240
|
+
|
241
|
+
# source://pg//lib/pg/basic_type_map_for_results.rb#53
|
242
|
+
class PG::BasicTypeMapForResults::WarningTypeMap < ::PG::TypeMapInRuby
|
243
|
+
# @return [WarningTypeMap] a new instance of WarningTypeMap
|
244
|
+
#
|
245
|
+
# source://pg//lib/pg/basic_type_map_for_results.rb#54
|
246
|
+
def initialize(typenames); end
|
247
|
+
|
248
|
+
# source://pg//lib/pg/basic_type_map_for_results.rb#59
|
249
|
+
def typecast_result_value(result, _tuple, field); end
|
250
|
+
end
|
251
|
+
|
252
|
+
# This class defines the mapping between PostgreSQL types and encoder/decoder classes for PG::BasicTypeMapForResults, PG::BasicTypeMapForQueries and PG::BasicTypeMapBasedOnResult.
|
253
|
+
#
|
254
|
+
# Additional types can be added like so:
|
255
|
+
#
|
256
|
+
# require 'pg'
|
257
|
+
# require 'ipaddr'
|
258
|
+
#
|
259
|
+
# class InetDecoder < PG::SimpleDecoder
|
260
|
+
# def decode(string, tuple=nil, field=nil)
|
261
|
+
# IPAddr.new(string)
|
262
|
+
# end
|
263
|
+
# end
|
264
|
+
# class InetEncoder < PG::SimpleEncoder
|
265
|
+
# def encode(ip_addr)
|
266
|
+
# ip_addr.to_s
|
267
|
+
# end
|
268
|
+
# end
|
269
|
+
#
|
270
|
+
# conn = PG.connect
|
271
|
+
# regi = PG::BasicTypeRegistry.new.register_default_types
|
272
|
+
# regi.register_type(0, 'inet', InetEncoder, InetDecoder)
|
273
|
+
# conn.type_map_for_results = PG::BasicTypeMapForResults.new(conn, registry: regi)
|
274
|
+
#
|
275
|
+
# source://pg//lib/pg/basic_type_registry.rb#28
|
276
|
+
class PG::BasicTypeRegistry
|
277
|
+
include ::PG::BasicTypeRegistry::Checker
|
278
|
+
|
279
|
+
# @return [BasicTypeRegistry] a new instance of BasicTypeRegistry
|
280
|
+
#
|
281
|
+
# source://pg//lib/pg/basic_type_registry.rb#165
|
282
|
+
def initialize; end
|
283
|
+
|
284
|
+
# Alias the +old+ type to the +new+ type.
|
285
|
+
#
|
286
|
+
# source://pg//lib/pg/basic_type_registry.rb#201
|
287
|
+
def alias_type(format, new, old); end
|
288
|
+
|
289
|
+
# Retrieve a Hash of all en- or decoders for a given wire format.
|
290
|
+
# The hash key is the name as defined in table +pg_type+.
|
291
|
+
# The hash value is the registered coder object.
|
292
|
+
#
|
293
|
+
# source://pg//lib/pg/basic_type_registry.rb#173
|
294
|
+
def coders_for(format, direction); end
|
295
|
+
|
296
|
+
# Populate the registry with all builtin types of ruby-pg
|
297
|
+
#
|
298
|
+
# source://pg//lib/pg/basic_type_registry.rb#214
|
299
|
+
def define_default_types; end
|
300
|
+
|
301
|
+
# Register an encoder or decoder instance for casting a PostgreSQL type.
|
302
|
+
#
|
303
|
+
# Coder#name must correspond to the +typname+ column in the +pg_type+ table.
|
304
|
+
# Coder#format can be 0 for text format and 1 for binary.
|
305
|
+
#
|
306
|
+
# source://pg//lib/pg/basic_type_registry.rb#182
|
307
|
+
def register_coder(coder); end
|
308
|
+
|
309
|
+
# Populate the registry with all builtin types of ruby-pg
|
310
|
+
#
|
311
|
+
# source://pg//lib/pg/basic_type_registry.rb#214
|
312
|
+
def register_default_types; end
|
313
|
+
|
314
|
+
# Register the given +encoder_class+ and/or +decoder_class+ for casting a PostgreSQL type.
|
315
|
+
#
|
316
|
+
# +name+ must correspond to the +typname+ column in the +pg_type+ table.
|
317
|
+
# +format+ can be 0 for text format and 1 for binary.
|
318
|
+
#
|
319
|
+
# source://pg//lib/pg/basic_type_registry.rb#194
|
320
|
+
def register_type(format, name, encoder_class, decoder_class); end
|
321
|
+
|
322
|
+
class << self
|
323
|
+
# source://pg//lib/pg/basic_type_registry.rb#295
|
324
|
+
def alias_type(*args); end
|
325
|
+
|
326
|
+
# source://pg//lib/pg/basic_type_registry.rb#295
|
327
|
+
def register_coder(*args); end
|
328
|
+
|
329
|
+
# source://pg//lib/pg/basic_type_registry.rb#295
|
330
|
+
def register_type(*args); end
|
331
|
+
end
|
332
|
+
end
|
333
|
+
|
334
|
+
# source://pg//lib/pg/basic_type_registry.rb#144
|
335
|
+
module PG::BasicTypeRegistry::Checker
|
336
|
+
protected
|
337
|
+
|
338
|
+
# source://pg//lib/pg/basic_type_registry.rb#153
|
339
|
+
def build_coder_maps(conn_or_maps, registry: T.unsafe(nil)); end
|
340
|
+
|
341
|
+
# @raise [ArgumentError]
|
342
|
+
#
|
343
|
+
# source://pg//lib/pg/basic_type_registry.rb#148
|
344
|
+
def check_format_and_direction(format, direction); end
|
345
|
+
end
|
346
|
+
|
347
|
+
# source://pg//lib/pg/basic_type_registry.rb#146
|
348
|
+
PG::BasicTypeRegistry::Checker::ValidDirections = T.let(T.unsafe(nil), Hash)
|
349
|
+
|
350
|
+
# source://pg//lib/pg/basic_type_registry.rb#145
|
351
|
+
PG::BasicTypeRegistry::Checker::ValidFormats = T.let(T.unsafe(nil), Hash)
|
352
|
+
|
353
|
+
# An instance of this class stores the coders that should be used for a particular wire format (text or binary)
|
354
|
+
# and type cast direction (encoder or decoder).
|
355
|
+
#
|
356
|
+
# Each coder object is filled with the PostgreSQL type name, OID, wire format and array coders are filled with the base elements_type.
|
357
|
+
#
|
358
|
+
# source://pg//lib/pg/basic_type_registry.rb#33
|
359
|
+
class PG::BasicTypeRegistry::CoderMap
|
360
|
+
# @return [CoderMap] a new instance of CoderMap
|
361
|
+
#
|
362
|
+
# source://pg//lib/pg/basic_type_registry.rb#44
|
363
|
+
def initialize(result, coders_by_name, format, arraycoder); end
|
364
|
+
|
365
|
+
# source://pg//lib/pg/basic_type_registry.rb#83
|
366
|
+
def coder_by_name(name); end
|
367
|
+
|
368
|
+
# source://pg//lib/pg/basic_type_registry.rb#87
|
369
|
+
def coder_by_oid(oid); end
|
370
|
+
|
371
|
+
# Returns the value of attribute coders.
|
372
|
+
#
|
373
|
+
# source://pg//lib/pg/basic_type_registry.rb#79
|
374
|
+
def coders; end
|
375
|
+
|
376
|
+
# Returns the value of attribute coders_by_name.
|
377
|
+
#
|
378
|
+
# source://pg//lib/pg/basic_type_registry.rb#81
|
379
|
+
def coders_by_name; end
|
380
|
+
|
381
|
+
# Returns the value of attribute coders_by_oid.
|
382
|
+
#
|
383
|
+
# source://pg//lib/pg/basic_type_registry.rb#80
|
384
|
+
def coders_by_oid; end
|
385
|
+
end
|
386
|
+
|
387
|
+
# Hash of text types that don't require quotation, when used within composite types.
|
388
|
+
# type.name => true
|
389
|
+
#
|
390
|
+
# source://pg//lib/pg/basic_type_registry.rb#36
|
391
|
+
PG::BasicTypeRegistry::CoderMap::DONT_QUOTE_TYPES = T.let(T.unsafe(nil), Hash)
|
392
|
+
|
393
|
+
# An instance of this class stores CoderMap instances to be used for text and binary wire formats
|
394
|
+
# as well as encoder and decoder directions.
|
395
|
+
#
|
396
|
+
# A PG::BasicTypeRegistry::CoderMapsBundle instance retrieves all type definitions from the PostgreSQL server and matches them with the coder definitions of the global PG::BasicTypeRegistry .
|
397
|
+
# It provides 4 separate CoderMap instances for the combinations of the two formats and directions.
|
398
|
+
#
|
399
|
+
# A PG::BasicTypeRegistry::CoderMapsBundle instance can be used to initialize an instance of
|
400
|
+
# * PG::BasicTypeMapForResults
|
401
|
+
# * PG::BasicTypeMapForQueries
|
402
|
+
# * PG::BasicTypeMapBasedOnResult
|
403
|
+
# by passing it instead of the connection object like so:
|
404
|
+
#
|
405
|
+
# conn = PG::Connection.new
|
406
|
+
# maps = PG::BasicTypeRegistry::CoderMapsBundle.new(conn)
|
407
|
+
# conn.type_map_for_results = PG::BasicTypeMapForResults.new(maps)
|
408
|
+
#
|
409
|
+
# source://pg//lib/pg/basic_type_registry.rb#108
|
410
|
+
class PG::BasicTypeRegistry::CoderMapsBundle
|
411
|
+
# @return [CoderMapsBundle] a new instance of CoderMapsBundle
|
412
|
+
#
|
413
|
+
# source://pg//lib/pg/basic_type_registry.rb#111
|
414
|
+
def initialize(connection, registry: T.unsafe(nil)); end
|
415
|
+
|
416
|
+
# source://pg//lib/pg/basic_type_registry.rb#135
|
417
|
+
def each_format(direction); end
|
418
|
+
|
419
|
+
# source://pg//lib/pg/basic_type_registry.rb#139
|
420
|
+
def map_for(format, direction); end
|
421
|
+
|
422
|
+
# Returns the value of attribute typenames_by_oid.
|
423
|
+
#
|
424
|
+
# source://pg//lib/pg/basic_type_registry.rb#109
|
425
|
+
def typenames_by_oid; end
|
426
|
+
end
|
427
|
+
|
428
|
+
# @private
|
429
|
+
#
|
430
|
+
# source://pg//lib/pg/basic_type_registry.rb#290
|
431
|
+
PG::BasicTypeRegistry::DEFAULT_TYPE_REGISTRY = T.let(T.unsafe(nil), PG::BasicTypeRegistry)
|
432
|
+
|
433
|
+
# source://pg//lib/pg/binary_decoder.rb#5
|
434
|
+
module PG::BinaryDecoder; end
|
435
|
+
|
436
|
+
class PG::BinaryDecoder::Boolean < ::PG::SimpleDecoder
|
437
|
+
include ::PG::Coder::BinaryFormatting
|
438
|
+
|
439
|
+
def decode(*_arg0); end
|
440
|
+
end
|
441
|
+
|
442
|
+
PG::BinaryDecoder::Boolean::CFUNC = T.let(T.unsafe(nil), Object)
|
443
|
+
|
444
|
+
class PG::BinaryDecoder::Bytea < ::PG::SimpleDecoder
|
445
|
+
include ::PG::Coder::BinaryFormatting
|
446
|
+
|
447
|
+
def decode(*_arg0); end
|
448
|
+
end
|
449
|
+
|
450
|
+
PG::BinaryDecoder::Bytea::CFUNC = T.let(T.unsafe(nil), Object)
|
451
|
+
|
452
|
+
class PG::BinaryDecoder::Float < ::PG::SimpleDecoder
|
453
|
+
include ::PG::Coder::BinaryFormatting
|
454
|
+
|
455
|
+
def decode(*_arg0); end
|
456
|
+
end
|
457
|
+
|
458
|
+
PG::BinaryDecoder::Float::CFUNC = T.let(T.unsafe(nil), Object)
|
459
|
+
|
460
|
+
class PG::BinaryDecoder::Integer < ::PG::SimpleDecoder
|
461
|
+
include ::PG::Coder::BinaryFormatting
|
462
|
+
|
463
|
+
def decode(*_arg0); end
|
464
|
+
end
|
465
|
+
|
466
|
+
PG::BinaryDecoder::Integer::CFUNC = T.let(T.unsafe(nil), Object)
|
467
|
+
|
468
|
+
class PG::BinaryDecoder::String < ::PG::SimpleDecoder
|
469
|
+
include ::PG::Coder::BinaryFormatting
|
470
|
+
|
471
|
+
def decode(*_arg0); end
|
472
|
+
end
|
473
|
+
|
474
|
+
PG::BinaryDecoder::String::CFUNC = T.let(T.unsafe(nil), Object)
|
475
|
+
|
476
|
+
class PG::BinaryDecoder::Timestamp < ::PG::SimpleDecoder
|
477
|
+
include ::PG::Coder::BinaryFormatting
|
478
|
+
|
479
|
+
def decode(*_arg0); end
|
480
|
+
end
|
481
|
+
|
482
|
+
PG::BinaryDecoder::Timestamp::CFUNC = T.let(T.unsafe(nil), Object)
|
483
|
+
|
484
|
+
# source://pg//lib/pg/binary_decoder.rb#17
|
485
|
+
class PG::BinaryDecoder::TimestampLocal < ::PG::BinaryDecoder::Timestamp
|
486
|
+
# @return [TimestampLocal] a new instance of TimestampLocal
|
487
|
+
#
|
488
|
+
# source://pg//lib/pg/binary_decoder.rb#18
|
489
|
+
def initialize(params = T.unsafe(nil)); end
|
490
|
+
end
|
491
|
+
|
492
|
+
# Convenience classes for timezone options
|
493
|
+
#
|
494
|
+
# source://pg//lib/pg/binary_decoder.rb#7
|
495
|
+
class PG::BinaryDecoder::TimestampUtc < ::PG::BinaryDecoder::Timestamp
|
496
|
+
# @return [TimestampUtc] a new instance of TimestampUtc
|
497
|
+
#
|
498
|
+
# source://pg//lib/pg/binary_decoder.rb#8
|
499
|
+
def initialize(params = T.unsafe(nil)); end
|
500
|
+
end
|
501
|
+
|
502
|
+
# source://pg//lib/pg/binary_decoder.rb#12
|
503
|
+
class PG::BinaryDecoder::TimestampUtcToLocal < ::PG::BinaryDecoder::Timestamp
|
504
|
+
# @return [TimestampUtcToLocal] a new instance of TimestampUtcToLocal
|
505
|
+
#
|
506
|
+
# source://pg//lib/pg/binary_decoder.rb#13
|
507
|
+
def initialize(params = T.unsafe(nil)); end
|
508
|
+
end
|
509
|
+
|
510
|
+
class PG::BinaryDecoder::ToBase64 < ::PG::CompositeDecoder
|
511
|
+
include ::PG::Coder::BinaryFormatting
|
512
|
+
|
513
|
+
def decode(*_arg0); end
|
514
|
+
end
|
515
|
+
|
516
|
+
PG::BinaryDecoder::ToBase64::CFUNC = T.let(T.unsafe(nil), Object)
|
517
|
+
module PG::BinaryEncoder; end
|
518
|
+
|
519
|
+
class PG::BinaryEncoder::Boolean < ::PG::SimpleEncoder
|
520
|
+
include ::PG::Coder::BinaryFormatting
|
521
|
+
|
522
|
+
def encode(*_arg0); end
|
523
|
+
end
|
524
|
+
|
525
|
+
PG::BinaryEncoder::Boolean::CFUNC = T.let(T.unsafe(nil), Object)
|
526
|
+
|
527
|
+
class PG::BinaryEncoder::Bytea < ::PG::SimpleEncoder
|
528
|
+
include ::PG::Coder::BinaryFormatting
|
529
|
+
|
530
|
+
def encode(*_arg0); end
|
531
|
+
end
|
532
|
+
|
533
|
+
PG::BinaryEncoder::Bytea::CFUNC = T.let(T.unsafe(nil), Object)
|
534
|
+
|
535
|
+
class PG::BinaryEncoder::FromBase64 < ::PG::CompositeEncoder
|
536
|
+
include ::PG::Coder::BinaryFormatting
|
537
|
+
|
538
|
+
def encode(*_arg0); end
|
539
|
+
end
|
540
|
+
|
541
|
+
PG::BinaryEncoder::FromBase64::CFUNC = T.let(T.unsafe(nil), Object)
|
542
|
+
|
543
|
+
class PG::BinaryEncoder::Int2 < ::PG::SimpleEncoder
|
544
|
+
include ::PG::Coder::BinaryFormatting
|
545
|
+
|
546
|
+
def encode(*_arg0); end
|
547
|
+
end
|
548
|
+
|
549
|
+
PG::BinaryEncoder::Int2::CFUNC = T.let(T.unsafe(nil), Object)
|
550
|
+
|
551
|
+
class PG::BinaryEncoder::Int4 < ::PG::SimpleEncoder
|
552
|
+
include ::PG::Coder::BinaryFormatting
|
553
|
+
|
554
|
+
def encode(*_arg0); end
|
555
|
+
end
|
556
|
+
|
557
|
+
PG::BinaryEncoder::Int4::CFUNC = T.let(T.unsafe(nil), Object)
|
558
|
+
|
559
|
+
class PG::BinaryEncoder::Int8 < ::PG::SimpleEncoder
|
560
|
+
include ::PG::Coder::BinaryFormatting
|
561
|
+
|
562
|
+
def encode(*_arg0); end
|
563
|
+
end
|
564
|
+
|
565
|
+
PG::BinaryEncoder::Int8::CFUNC = T.let(T.unsafe(nil), Object)
|
566
|
+
|
567
|
+
class PG::BinaryEncoder::String < ::PG::SimpleEncoder
|
568
|
+
include ::PG::Coder::BinaryFormatting
|
569
|
+
|
570
|
+
def encode(*_arg0); end
|
571
|
+
end
|
572
|
+
|
573
|
+
PG::BinaryEncoder::String::CFUNC = T.let(T.unsafe(nil), Object)
|
574
|
+
class PG::BranchTransactionAlreadyActive < ::PG::InvalidTransactionState; end
|
575
|
+
class PG::CannotCoerce < ::PG::SyntaxErrorOrAccessRuleViolation; end
|
576
|
+
class PG::CannotConnectNow < ::PG::OperatorIntervention; end
|
577
|
+
class PG::CantChangeRuntimeParam < ::PG::ObjectNotInPrerequisiteState; end
|
578
|
+
class PG::CardinalityViolation < ::PG::ServerError; end
|
579
|
+
class PG::CaseNotFound < ::PG::ServerError; end
|
580
|
+
class PG::CharacterNotInRepertoire < ::PG::DataException; end
|
581
|
+
class PG::CheckViolation < ::PG::IntegrityConstraintViolation; end
|
582
|
+
|
583
|
+
# source://pg//lib/pg/coder.rb#6
|
584
|
+
class PG::Coder
|
585
|
+
# Create a new coder object based on the attribute Hash.
|
586
|
+
#
|
587
|
+
# @return [Coder] a new instance of Coder
|
588
|
+
#
|
589
|
+
# source://pg//lib/pg/coder.rb#17
|
590
|
+
def initialize(params = T.unsafe(nil)); end
|
591
|
+
|
592
|
+
# source://pg//lib/pg/coder.rb#37
|
593
|
+
def ==(v); end
|
594
|
+
|
595
|
+
# source://pg//lib/pg/coder.rb#23
|
596
|
+
def dup; end
|
597
|
+
|
598
|
+
def flags; end
|
599
|
+
def flags=(_arg0); end
|
600
|
+
def format; end
|
601
|
+
def format=(_arg0); end
|
602
|
+
|
603
|
+
# source://pg//lib/pg/coder.rb#49
|
604
|
+
def inspect; end
|
605
|
+
|
606
|
+
# source://pg//lib/pg/coder.rb#58
|
607
|
+
def inspect_short; end
|
608
|
+
|
609
|
+
# source://pg//lib/pg/coder.rb#41
|
610
|
+
def marshal_dump; end
|
611
|
+
|
612
|
+
# source://pg//lib/pg/coder.rb#45
|
613
|
+
def marshal_load(str); end
|
614
|
+
|
615
|
+
def name; end
|
616
|
+
def name=(_arg0); end
|
617
|
+
def oid; end
|
618
|
+
def oid=(_arg0); end
|
619
|
+
|
620
|
+
# Returns coder attributes as Hash.
|
621
|
+
#
|
622
|
+
# source://pg//lib/pg/coder.rb#28
|
623
|
+
def to_h; end
|
624
|
+
end
|
625
|
+
|
626
|
+
# source://pg//lib/pg/coder.rb#8
|
627
|
+
module PG::Coder::BinaryFormatting
|
628
|
+
# source://pg//lib/pg/coder.rb#10
|
629
|
+
def initialize(params = T.unsafe(nil)); end
|
630
|
+
end
|
631
|
+
|
632
|
+
# source://pg//lib/pg/coder.rb#9
|
633
|
+
PG::Coder::BinaryFormatting::Params = T.let(T.unsafe(nil), Hash)
|
634
|
+
|
635
|
+
PG::Coder::FORMAT_ERROR_MASK = T.let(T.unsafe(nil), Integer)
|
636
|
+
PG::Coder::FORMAT_ERROR_TO_PARTIAL = T.let(T.unsafe(nil), Integer)
|
637
|
+
PG::Coder::FORMAT_ERROR_TO_RAISE = T.let(T.unsafe(nil), Integer)
|
638
|
+
PG::Coder::FORMAT_ERROR_TO_STRING = T.let(T.unsafe(nil), Integer)
|
639
|
+
PG::Coder::TIMESTAMP_APP_LOCAL = T.let(T.unsafe(nil), Integer)
|
640
|
+
PG::Coder::TIMESTAMP_APP_UTC = T.let(T.unsafe(nil), Integer)
|
641
|
+
PG::Coder::TIMESTAMP_DB_LOCAL = T.let(T.unsafe(nil), Integer)
|
642
|
+
PG::Coder::TIMESTAMP_DB_UTC = T.let(T.unsafe(nil), Integer)
|
643
|
+
class PG::CollationMismatch < ::PG::SyntaxErrorOrAccessRuleViolation; end
|
644
|
+
|
645
|
+
# source://pg//lib/pg/coder.rb#71
|
646
|
+
class PG::CompositeCoder < ::PG::Coder
|
647
|
+
def delimiter; end
|
648
|
+
def delimiter=(_arg0); end
|
649
|
+
def elements_type; end
|
650
|
+
def elements_type=(_arg0); end
|
651
|
+
|
652
|
+
# source://pg//lib/pg/coder.rb#80
|
653
|
+
def inspect; end
|
654
|
+
|
655
|
+
def needs_quotation=(_arg0); end
|
656
|
+
def needs_quotation?; end
|
657
|
+
|
658
|
+
# source://pg//lib/pg/coder.rb#72
|
659
|
+
def to_h; end
|
660
|
+
end
|
661
|
+
|
662
|
+
class PG::CompositeDecoder < ::PG::CompositeCoder; end
|
663
|
+
class PG::CompositeEncoder < ::PG::CompositeCoder; end
|
664
|
+
class PG::ConfigFileError < ::PG::ServerError; end
|
665
|
+
class PG::ConfigurationLimitExceeded < ::PG::InsufficientResources; end
|
666
|
+
|
667
|
+
# The PostgreSQL connection class. The interface for this class is based on
|
668
|
+
# {libpq}[http://www.postgresql.org/docs/current/libpq.html], the C
|
669
|
+
# application programmer's interface to PostgreSQL. Some familiarity with libpq
|
670
|
+
# is recommended, but not necessary.
|
671
|
+
#
|
672
|
+
# For example, to send query to the database on the localhost:
|
673
|
+
#
|
674
|
+
# require 'pg'
|
675
|
+
# conn = PG::Connection.open(:dbname => 'test')
|
676
|
+
# res = conn.exec_params('SELECT $1 AS a, $2 AS b, $3 AS c', [1, 2, nil])
|
677
|
+
# # Equivalent to:
|
678
|
+
# # res = conn.exec('SELECT 1 AS a, 2 AS b, NULL AS c')
|
679
|
+
#
|
680
|
+
# See the PG::Result class for information on working with the results of a query.
|
681
|
+
#
|
682
|
+
# Many methods of this class have three variants kind of:
|
683
|
+
# 1. #exec - the base method which is an alias to #async_exec .
|
684
|
+
# This is the method that should be used in general.
|
685
|
+
# 2. #async_exec - the async aware version of the method, implemented by libpq's async API.
|
686
|
+
# 3. #sync_exec - the method version that is implemented by blocking function(s) of libpq.
|
687
|
+
#
|
688
|
+
# Sync and async version of the method can be switched by Connection.async_api= , however it is not recommended to change the default.
|
689
|
+
#
|
690
|
+
# source://pg//lib/pg/connection.rb#31
|
691
|
+
class PG::Connection
|
692
|
+
include ::PG::Constants
|
693
|
+
|
694
|
+
# call-seq:
|
695
|
+
# conn.cancel() -> String
|
696
|
+
#
|
697
|
+
# Requests cancellation of the command currently being
|
698
|
+
# processed.
|
699
|
+
#
|
700
|
+
# Returns +nil+ on success, or a string containing the
|
701
|
+
# error message if a failure occurs.
|
702
|
+
#
|
703
|
+
# source://pg//lib/pg/connection.rb#519
|
704
|
+
def async_cancel; end
|
705
|
+
|
706
|
+
def async_describe_portal(_arg0); end
|
707
|
+
def async_describe_prepared(_arg0); end
|
708
|
+
|
709
|
+
# call-seq:
|
710
|
+
# conn.encrypt_password( password, username, algorithm=nil ) -> String
|
711
|
+
#
|
712
|
+
# This function is intended to be used by client applications that wish to send commands like <tt>ALTER USER joe PASSWORD 'pwd'</tt>.
|
713
|
+
# It is good practice not to send the original cleartext password in such a command, because it might be exposed in command logs, activity displays, and so on.
|
714
|
+
# Instead, use this function to convert the password to encrypted form before it is sent.
|
715
|
+
#
|
716
|
+
# The +password+ and +username+ arguments are the cleartext password, and the SQL name of the user it is for.
|
717
|
+
# +algorithm+ specifies the encryption algorithm to use to encrypt the password.
|
718
|
+
# Currently supported algorithms are +md5+ and +scram-sha-256+ (+on+ and +off+ are also accepted as aliases for +md5+, for compatibility with older server versions).
|
719
|
+
# Note that support for +scram-sha-256+ was introduced in PostgreSQL version 10, and will not work correctly with older server versions.
|
720
|
+
# If algorithm is omitted or +nil+, this function will query the server for the current value of the +password_encryption+ setting.
|
721
|
+
# That can block, and will fail if the current transaction is aborted, or if the connection is busy executing another query.
|
722
|
+
# If you wish to use the default algorithm for the server but want to avoid blocking, query +password_encryption+ yourself before calling #encrypt_password, and pass that value as the algorithm.
|
723
|
+
#
|
724
|
+
# Return value is the encrypted password.
|
725
|
+
# The caller can assume the string doesn't contain any special characters that would require escaping.
|
726
|
+
#
|
727
|
+
# Available since PostgreSQL-10.
|
728
|
+
# See also corresponding {libpq function}[https://www.postgresql.org/docs/current/libpq-misc.html#LIBPQ-PQENCRYPTPASSWORDCONN].
|
729
|
+
#
|
730
|
+
# source://pg//lib/pg/connection.rb#492
|
731
|
+
def async_encrypt_password(password, username, algorithm = T.unsafe(nil)); end
|
732
|
+
|
733
|
+
def async_exec(*_arg0); end
|
734
|
+
def async_exec_params(*_arg0); end
|
735
|
+
def async_exec_prepared(*_arg0); end
|
736
|
+
def async_flush; end
|
737
|
+
|
738
|
+
# call-seq:
|
739
|
+
# conn.get_copy_data( [ nonblock = false [, decoder = nil ]] ) -> Object
|
740
|
+
#
|
741
|
+
# Return one row of data, +nil+
|
742
|
+
# if the copy is done, or +false+ if the call would
|
743
|
+
# block (only possible if _nonblock_ is true).
|
744
|
+
#
|
745
|
+
# If _decoder_ is not set or +nil+, data is returned as binary string.
|
746
|
+
#
|
747
|
+
# If _decoder_ is set to a PG::Coder derivation, the return type depends on this decoder.
|
748
|
+
# PG::TextDecoder::CopyRow decodes the received data fields from one row of PostgreSQL's
|
749
|
+
# COPY text format to an Array of Strings.
|
750
|
+
# Optionally the decoder can type cast the single fields to various Ruby types in one step,
|
751
|
+
# if PG::TextDecoder::CopyRow#type_map is set accordingly.
|
752
|
+
#
|
753
|
+
# See also #copy_data.
|
754
|
+
#
|
755
|
+
# source://pg//lib/pg/connection.rb#360
|
756
|
+
def async_get_copy_data(async = T.unsafe(nil), decoder = T.unsafe(nil)); end
|
757
|
+
|
758
|
+
def async_get_last_result; end
|
759
|
+
|
760
|
+
# call-seq:
|
761
|
+
# conn.get_result() -> PG::Result
|
762
|
+
# conn.get_result() {|pg_result| block }
|
763
|
+
#
|
764
|
+
# Blocks waiting for the next result from a call to
|
765
|
+
# #send_query (or another asynchronous command), and returns
|
766
|
+
# it. Returns +nil+ if no more results are available.
|
767
|
+
#
|
768
|
+
# Note: call this function repeatedly until it returns +nil+, or else
|
769
|
+
# you will not be able to issue further commands.
|
770
|
+
#
|
771
|
+
# If the optional code block is given, it will be passed <i>result</i> as an argument,
|
772
|
+
# and the PG::Result object will automatically be cleared when the block terminates.
|
773
|
+
# In this instance, <code>conn.exec</code> returns the value of the block.
|
774
|
+
#
|
775
|
+
# source://pg//lib/pg/connection.rb#337
|
776
|
+
def async_get_result; end
|
777
|
+
|
778
|
+
# call-seq:
|
779
|
+
# conn.isnonblocking() -> Boolean
|
780
|
+
#
|
781
|
+
# Returns the blocking status of the database connection.
|
782
|
+
# Returns +true+ if the connection is set to nonblocking mode and +false+ if blocking.
|
783
|
+
#
|
784
|
+
# source://pg//lib/pg/connection.rb#408
|
785
|
+
def async_isnonblocking; end
|
786
|
+
|
787
|
+
def async_prepare(*_arg0); end
|
788
|
+
|
789
|
+
# call-seq:
|
790
|
+
# conn.put_copy_data( buffer [, encoder] ) -> Boolean
|
791
|
+
#
|
792
|
+
# Transmits _buffer_ as copy data to the server.
|
793
|
+
# Returns true if the data was sent, false if it was
|
794
|
+
# not sent (false is only possible if the connection
|
795
|
+
# is in nonblocking mode, and this command would block).
|
796
|
+
#
|
797
|
+
# _encoder_ can be a PG::Coder derivation (typically PG::TextEncoder::CopyRow).
|
798
|
+
# This encodes the data fields given as _buffer_ from an Array of Strings to
|
799
|
+
# PostgreSQL's COPY text format inclusive proper escaping. Optionally
|
800
|
+
# the encoder can type cast the fields from various Ruby types in one step,
|
801
|
+
# if PG::TextEncoder::CopyRow#type_map is set accordingly.
|
802
|
+
#
|
803
|
+
# Raises an exception if an error occurs.
|
804
|
+
#
|
805
|
+
# See also #copy_data.
|
806
|
+
#
|
807
|
+
# source://pg//lib/pg/connection.rb#432
|
808
|
+
def async_put_copy_data(buffer, encoder = T.unsafe(nil)); end
|
809
|
+
|
810
|
+
# call-seq:
|
811
|
+
# conn.put_copy_end( [ error_message ] ) -> Boolean
|
812
|
+
#
|
813
|
+
# Sends end-of-data indication to the server.
|
814
|
+
#
|
815
|
+
# _error_message_ is an optional parameter, and if set,
|
816
|
+
# forces the COPY command to fail with the string
|
817
|
+
# _error_message_.
|
818
|
+
#
|
819
|
+
# Returns true if the end-of-data was sent, #false* if it was
|
820
|
+
# not sent (*false* is only possible if the connection
|
821
|
+
# is in nonblocking mode, and this command would block).
|
822
|
+
#
|
823
|
+
# source://pg//lib/pg/connection.rb#462
|
824
|
+
def async_put_copy_end(*args); end
|
825
|
+
|
826
|
+
def async_query(*_arg0); end
|
827
|
+
|
828
|
+
# call-seq:
|
829
|
+
# conn.reset()
|
830
|
+
#
|
831
|
+
# Resets the backend connection. This method closes the
|
832
|
+
# backend connection and tries to re-connect.
|
833
|
+
#
|
834
|
+
# source://pg//lib/pg/connection.rb#504
|
835
|
+
def async_reset; end
|
836
|
+
|
837
|
+
def async_set_client_encoding(_arg0); end
|
838
|
+
|
839
|
+
# call-seq:
|
840
|
+
# conn.setnonblocking(Boolean) -> nil
|
841
|
+
#
|
842
|
+
# Sets the nonblocking status of the connection.
|
843
|
+
# In the blocking state, calls to #send_query
|
844
|
+
# will block until the message is sent to the server,
|
845
|
+
# but will not wait for the query results.
|
846
|
+
# In the nonblocking state, calls to #send_query
|
847
|
+
# will return an error if the socket is not ready for
|
848
|
+
# writing.
|
849
|
+
# Note: This function does not affect #exec, because
|
850
|
+
# that function doesn't return until the server has
|
851
|
+
# processed the query and returned the results.
|
852
|
+
#
|
853
|
+
# Returns +nil+.
|
854
|
+
#
|
855
|
+
# source://pg//lib/pg/connection.rb#394
|
856
|
+
def async_setnonblocking(enabled); end
|
857
|
+
|
858
|
+
def backend_key; end
|
859
|
+
def backend_pid; end
|
860
|
+
def block(*_arg0); end
|
861
|
+
|
862
|
+
# call-seq:
|
863
|
+
# conn.cancel() -> String
|
864
|
+
#
|
865
|
+
# Requests cancellation of the command currently being
|
866
|
+
# processed.
|
867
|
+
#
|
868
|
+
# Returns +nil+ on success, or a string containing the
|
869
|
+
# error message if a failure occurs.
|
870
|
+
#
|
871
|
+
# source://pg//lib/pg/connection.rb#519
|
872
|
+
def cancel; end
|
873
|
+
|
874
|
+
def client_encoding=(_arg0); end
|
875
|
+
def close; end
|
876
|
+
|
877
|
+
# Returns an array of Hashes with connection defaults. See ::conndefaults
|
878
|
+
# for details.
|
879
|
+
#
|
880
|
+
# source://pg//lib/pg/connection.rb#275
|
881
|
+
def conndefaults; end
|
882
|
+
|
883
|
+
# Returns a Hash with connection defaults. See ::conndefaults_hash
|
884
|
+
# for details.
|
885
|
+
#
|
886
|
+
# source://pg//lib/pg/connection.rb#291
|
887
|
+
def conndefaults_hash; end
|
888
|
+
|
889
|
+
def connect_poll; end
|
890
|
+
def connection_needs_password; end
|
891
|
+
def connection_used_password; end
|
892
|
+
def conninfo; end
|
893
|
+
|
894
|
+
# Return the Postgres connection info structure as a Hash keyed by option
|
895
|
+
# keyword (as a Symbol).
|
896
|
+
#
|
897
|
+
# See also #conninfo
|
898
|
+
#
|
899
|
+
# source://pg//lib/pg/connection.rb#299
|
900
|
+
def conninfo_hash; end
|
901
|
+
|
902
|
+
def consume_input; end
|
903
|
+
|
904
|
+
# call-seq:
|
905
|
+
# conn.copy_data( sql [, coder] ) {|sql_result| ... } -> PG::Result
|
906
|
+
#
|
907
|
+
# Execute a copy process for transferring data to or from the server.
|
908
|
+
#
|
909
|
+
# This issues the SQL COPY command via #exec. The response to this
|
910
|
+
# (if there is no error in the command) is a PG::Result object that
|
911
|
+
# is passed to the block, bearing a status code of PGRES_COPY_OUT or
|
912
|
+
# PGRES_COPY_IN (depending on the specified copy direction).
|
913
|
+
# The application should then use #put_copy_data or #get_copy_data
|
914
|
+
# to receive or transmit data rows and should return from the block
|
915
|
+
# when finished.
|
916
|
+
#
|
917
|
+
# #copy_data returns another PG::Result object when the data transfer
|
918
|
+
# is complete. An exception is raised if some problem was encountered,
|
919
|
+
# so it isn't required to make use of any of them.
|
920
|
+
# At this point further SQL commands can be issued via #exec.
|
921
|
+
# (It is not possible to execute other SQL commands using the same
|
922
|
+
# connection while the COPY operation is in progress.)
|
923
|
+
#
|
924
|
+
# This method ensures, that the copy process is properly terminated
|
925
|
+
# in case of client side or server side failures. Therefore, in case
|
926
|
+
# of blocking mode of operation, #copy_data is preferred to raw calls
|
927
|
+
# of #put_copy_data, #get_copy_data and #put_copy_end.
|
928
|
+
#
|
929
|
+
# _coder_ can be a PG::Coder derivation
|
930
|
+
# (typically PG::TextEncoder::CopyRow or PG::TextDecoder::CopyRow).
|
931
|
+
# This enables encoding of data fields given to #put_copy_data
|
932
|
+
# or decoding of fields received by #get_copy_data.
|
933
|
+
#
|
934
|
+
# Example with CSV input format:
|
935
|
+
# conn.exec "create table my_table (a text,b text,c text,d text)"
|
936
|
+
# conn.copy_data "COPY my_table FROM STDIN CSV" do
|
937
|
+
# conn.put_copy_data "some,data,to,copy\n"
|
938
|
+
# conn.put_copy_data "more,data,to,copy\n"
|
939
|
+
# end
|
940
|
+
# This creates +my_table+ and inserts two CSV rows.
|
941
|
+
#
|
942
|
+
# The same with text format encoder PG::TextEncoder::CopyRow
|
943
|
+
# and Array input:
|
944
|
+
# enco = PG::TextEncoder::CopyRow.new
|
945
|
+
# conn.copy_data "COPY my_table FROM STDIN", enco do
|
946
|
+
# conn.put_copy_data ['some', 'data', 'to', 'copy']
|
947
|
+
# conn.put_copy_data ['more', 'data', 'to', 'copy']
|
948
|
+
# end
|
949
|
+
#
|
950
|
+
# Example with CSV output format:
|
951
|
+
# conn.copy_data "COPY my_table TO STDOUT CSV" do
|
952
|
+
# while row=conn.get_copy_data
|
953
|
+
# p row
|
954
|
+
# end
|
955
|
+
# end
|
956
|
+
# This prints all rows of +my_table+ to stdout:
|
957
|
+
# "some,data,to,copy\n"
|
958
|
+
# "more,data,to,copy\n"
|
959
|
+
#
|
960
|
+
# The same with text format decoder PG::TextDecoder::CopyRow
|
961
|
+
# and Array output:
|
962
|
+
# deco = PG::TextDecoder::CopyRow.new
|
963
|
+
# conn.copy_data "COPY my_table TO STDOUT", deco do
|
964
|
+
# while row=conn.get_copy_data
|
965
|
+
# p row
|
966
|
+
# end
|
967
|
+
# end
|
968
|
+
# This receives all rows of +my_table+ as ruby array:
|
969
|
+
# ["some", "data", "to", "copy"]
|
970
|
+
# ["more", "data", "to", "copy"]
|
971
|
+
#
|
972
|
+
# @raise [PG::NotInBlockingMode]
|
973
|
+
#
|
974
|
+
# source://pg//lib/pg/connection.rb#185
|
975
|
+
def copy_data(sql, coder = T.unsafe(nil)); end
|
976
|
+
|
977
|
+
def db; end
|
978
|
+
def decoder_for_get_copy_data; end
|
979
|
+
def decoder_for_get_copy_data=(_arg0); end
|
980
|
+
def describe_portal(_arg0); end
|
981
|
+
def describe_prepared(_arg0); end
|
982
|
+
def discard_results; end
|
983
|
+
def encoder_for_put_copy_data; end
|
984
|
+
def encoder_for_put_copy_data=(_arg0); end
|
985
|
+
|
986
|
+
# call-seq:
|
987
|
+
# conn.encrypt_password( password, username, algorithm=nil ) -> String
|
988
|
+
#
|
989
|
+
# This function is intended to be used by client applications that wish to send commands like <tt>ALTER USER joe PASSWORD 'pwd'</tt>.
|
990
|
+
# It is good practice not to send the original cleartext password in such a command, because it might be exposed in command logs, activity displays, and so on.
|
991
|
+
# Instead, use this function to convert the password to encrypted form before it is sent.
|
992
|
+
#
|
993
|
+
# The +password+ and +username+ arguments are the cleartext password, and the SQL name of the user it is for.
|
994
|
+
# +algorithm+ specifies the encryption algorithm to use to encrypt the password.
|
995
|
+
# Currently supported algorithms are +md5+ and +scram-sha-256+ (+on+ and +off+ are also accepted as aliases for +md5+, for compatibility with older server versions).
|
996
|
+
# Note that support for +scram-sha-256+ was introduced in PostgreSQL version 10, and will not work correctly with older server versions.
|
997
|
+
# If algorithm is omitted or +nil+, this function will query the server for the current value of the +password_encryption+ setting.
|
998
|
+
# That can block, and will fail if the current transaction is aborted, or if the connection is busy executing another query.
|
999
|
+
# If you wish to use the default algorithm for the server but want to avoid blocking, query +password_encryption+ yourself before calling #encrypt_password, and pass that value as the algorithm.
|
1000
|
+
#
|
1001
|
+
# Return value is the encrypted password.
|
1002
|
+
# The caller can assume the string doesn't contain any special characters that would require escaping.
|
1003
|
+
#
|
1004
|
+
# Available since PostgreSQL-10.
|
1005
|
+
# See also corresponding {libpq function}[https://www.postgresql.org/docs/current/libpq-misc.html#LIBPQ-PQENCRYPTPASSWORDCONN].
|
1006
|
+
#
|
1007
|
+
# source://pg//lib/pg/connection.rb#492
|
1008
|
+
def encrypt_password(password, username, algorithm = T.unsafe(nil)); end
|
1009
|
+
|
1010
|
+
def enter_pipeline_mode; end
|
1011
|
+
def error_message; end
|
1012
|
+
def escape(_arg0); end
|
1013
|
+
def escape_bytea(_arg0); end
|
1014
|
+
def escape_identifier(_arg0); end
|
1015
|
+
def escape_literal(_arg0); end
|
1016
|
+
def escape_string(_arg0); end
|
1017
|
+
def exec(*_arg0); end
|
1018
|
+
def exec_params(*_arg0); end
|
1019
|
+
def exec_prepared(*_arg0); end
|
1020
|
+
def exit_pipeline_mode; end
|
1021
|
+
def external_encoding; end
|
1022
|
+
def field_name_type; end
|
1023
|
+
def field_name_type=(_arg0); end
|
1024
|
+
def finish; end
|
1025
|
+
def finished?; end
|
1026
|
+
def flush; end
|
1027
|
+
def get_client_encoding; end
|
1028
|
+
|
1029
|
+
# call-seq:
|
1030
|
+
# conn.get_copy_data( [ nonblock = false [, decoder = nil ]] ) -> Object
|
1031
|
+
#
|
1032
|
+
# Return one row of data, +nil+
|
1033
|
+
# if the copy is done, or +false+ if the call would
|
1034
|
+
# block (only possible if _nonblock_ is true).
|
1035
|
+
#
|
1036
|
+
# If _decoder_ is not set or +nil+, data is returned as binary string.
|
1037
|
+
#
|
1038
|
+
# If _decoder_ is set to a PG::Coder derivation, the return type depends on this decoder.
|
1039
|
+
# PG::TextDecoder::CopyRow decodes the received data fields from one row of PostgreSQL's
|
1040
|
+
# COPY text format to an Array of Strings.
|
1041
|
+
# Optionally the decoder can type cast the single fields to various Ruby types in one step,
|
1042
|
+
# if PG::TextDecoder::CopyRow#type_map is set accordingly.
|
1043
|
+
#
|
1044
|
+
# See also #copy_data.
|
1045
|
+
#
|
1046
|
+
# source://pg//lib/pg/connection.rb#360
|
1047
|
+
def get_copy_data(async = T.unsafe(nil), decoder = T.unsafe(nil)); end
|
1048
|
+
|
1049
|
+
def get_last_result; end
|
1050
|
+
|
1051
|
+
# call-seq:
|
1052
|
+
# conn.get_result() -> PG::Result
|
1053
|
+
# conn.get_result() {|pg_result| block }
|
1054
|
+
#
|
1055
|
+
# Blocks waiting for the next result from a call to
|
1056
|
+
# #send_query (or another asynchronous command), and returns
|
1057
|
+
# it. Returns +nil+ if no more results are available.
|
1058
|
+
#
|
1059
|
+
# Note: call this function repeatedly until it returns +nil+, or else
|
1060
|
+
# you will not be able to issue further commands.
|
1061
|
+
#
|
1062
|
+
# If the optional code block is given, it will be passed <i>result</i> as an argument,
|
1063
|
+
# and the PG::Result object will automatically be cleared when the block terminates.
|
1064
|
+
# In this instance, <code>conn.exec</code> returns the value of the block.
|
1065
|
+
#
|
1066
|
+
# source://pg//lib/pg/connection.rb#337
|
1067
|
+
def get_result; end
|
1068
|
+
|
1069
|
+
def host; end
|
1070
|
+
def hostaddr; end
|
1071
|
+
|
1072
|
+
# Return a String representation of the object suitable for debugging.
|
1073
|
+
#
|
1074
|
+
# source://pg//lib/pg/connection.rb#97
|
1075
|
+
def inspect; end
|
1076
|
+
|
1077
|
+
def internal_encoding; end
|
1078
|
+
def internal_encoding=(_arg0); end
|
1079
|
+
def is_busy; end
|
1080
|
+
|
1081
|
+
# call-seq:
|
1082
|
+
# conn.isnonblocking() -> Boolean
|
1083
|
+
#
|
1084
|
+
# Returns the blocking status of the database connection.
|
1085
|
+
# Returns +true+ if the connection is set to nonblocking mode and +false+ if blocking.
|
1086
|
+
#
|
1087
|
+
# source://pg//lib/pg/connection.rb#408
|
1088
|
+
def isnonblocking; end
|
1089
|
+
|
1090
|
+
def lo_close(_arg0); end
|
1091
|
+
def lo_creat(*_arg0); end
|
1092
|
+
def lo_create(_arg0); end
|
1093
|
+
def lo_export(_arg0, _arg1); end
|
1094
|
+
def lo_import(_arg0); end
|
1095
|
+
def lo_lseek(_arg0, _arg1, _arg2); end
|
1096
|
+
def lo_open(*_arg0); end
|
1097
|
+
def lo_read(_arg0, _arg1); end
|
1098
|
+
def lo_seek(_arg0, _arg1, _arg2); end
|
1099
|
+
def lo_tell(_arg0); end
|
1100
|
+
def lo_truncate(_arg0, _arg1); end
|
1101
|
+
def lo_unlink(_arg0); end
|
1102
|
+
def lo_write(_arg0, _arg1); end
|
1103
|
+
def loclose(_arg0); end
|
1104
|
+
def locreat(*_arg0); end
|
1105
|
+
def locreate(_arg0); end
|
1106
|
+
def loexport(_arg0, _arg1); end
|
1107
|
+
def loimport(_arg0); end
|
1108
|
+
def lolseek(_arg0, _arg1, _arg2); end
|
1109
|
+
def loopen(*_arg0); end
|
1110
|
+
def loread(_arg0, _arg1); end
|
1111
|
+
def loseek(_arg0, _arg1, _arg2); end
|
1112
|
+
def lotell(_arg0); end
|
1113
|
+
def lotruncate(_arg0, _arg1); end
|
1114
|
+
def lounlink(_arg0); end
|
1115
|
+
def lowrite(_arg0, _arg1); end
|
1116
|
+
def make_empty_pgresult(_arg0); end
|
1117
|
+
|
1118
|
+
# call-seq:
|
1119
|
+
# conn.isnonblocking() -> Boolean
|
1120
|
+
#
|
1121
|
+
# Returns the blocking status of the database connection.
|
1122
|
+
# Returns +true+ if the connection is set to nonblocking mode and +false+ if blocking.
|
1123
|
+
#
|
1124
|
+
# source://pg//lib/pg/connection.rb#408
|
1125
|
+
def nonblocking?; end
|
1126
|
+
|
1127
|
+
def notifies; end
|
1128
|
+
def notifies_wait(*_arg0); end
|
1129
|
+
def options; end
|
1130
|
+
def parameter_status(_arg0); end
|
1131
|
+
def pass; end
|
1132
|
+
def pipeline_status; end
|
1133
|
+
def pipeline_sync; end
|
1134
|
+
def port; end
|
1135
|
+
def prepare(*_arg0); end
|
1136
|
+
def protocol_version; end
|
1137
|
+
|
1138
|
+
# call-seq:
|
1139
|
+
# conn.put_copy_data( buffer [, encoder] ) -> Boolean
|
1140
|
+
#
|
1141
|
+
# Transmits _buffer_ as copy data to the server.
|
1142
|
+
# Returns true if the data was sent, false if it was
|
1143
|
+
# not sent (false is only possible if the connection
|
1144
|
+
# is in nonblocking mode, and this command would block).
|
1145
|
+
#
|
1146
|
+
# _encoder_ can be a PG::Coder derivation (typically PG::TextEncoder::CopyRow).
|
1147
|
+
# This encodes the data fields given as _buffer_ from an Array of Strings to
|
1148
|
+
# PostgreSQL's COPY text format inclusive proper escaping. Optionally
|
1149
|
+
# the encoder can type cast the fields from various Ruby types in one step,
|
1150
|
+
# if PG::TextEncoder::CopyRow#type_map is set accordingly.
|
1151
|
+
#
|
1152
|
+
# Raises an exception if an error occurs.
|
1153
|
+
#
|
1154
|
+
# See also #copy_data.
|
1155
|
+
#
|
1156
|
+
# source://pg//lib/pg/connection.rb#432
|
1157
|
+
def put_copy_data(buffer, encoder = T.unsafe(nil)); end
|
1158
|
+
|
1159
|
+
# call-seq:
|
1160
|
+
# conn.put_copy_end( [ error_message ] ) -> Boolean
|
1161
|
+
#
|
1162
|
+
# Sends end-of-data indication to the server.
|
1163
|
+
#
|
1164
|
+
# _error_message_ is an optional parameter, and if set,
|
1165
|
+
# forces the COPY command to fail with the string
|
1166
|
+
# _error_message_.
|
1167
|
+
#
|
1168
|
+
# Returns true if the end-of-data was sent, #false* if it was
|
1169
|
+
# not sent (*false* is only possible if the connection
|
1170
|
+
# is in nonblocking mode, and this command would block).
|
1171
|
+
#
|
1172
|
+
# source://pg//lib/pg/connection.rb#462
|
1173
|
+
def put_copy_end(*args); end
|
1174
|
+
|
1175
|
+
def query(*_arg0); end
|
1176
|
+
def quote_ident(_arg0); end
|
1177
|
+
|
1178
|
+
# call-seq:
|
1179
|
+
# conn.reset()
|
1180
|
+
#
|
1181
|
+
# Resets the backend connection. This method closes the
|
1182
|
+
# backend connection and tries to re-connect.
|
1183
|
+
#
|
1184
|
+
# source://pg//lib/pg/connection.rb#504
|
1185
|
+
def reset; end
|
1186
|
+
|
1187
|
+
def reset_poll; end
|
1188
|
+
def reset_start; end
|
1189
|
+
def send_describe_portal(_arg0); end
|
1190
|
+
def send_describe_prepared(_arg0); end
|
1191
|
+
def send_flush_request; end
|
1192
|
+
def send_prepare(*_arg0); end
|
1193
|
+
def send_query(*_arg0); end
|
1194
|
+
def send_query_params(*_arg0); end
|
1195
|
+
def send_query_prepared(*_arg0); end
|
1196
|
+
def server_version; end
|
1197
|
+
def set_client_encoding(_arg0); end
|
1198
|
+
def set_default_encoding; end
|
1199
|
+
def set_error_context_visibility(_arg0); end
|
1200
|
+
def set_error_verbosity(_arg0); end
|
1201
|
+
def set_notice_processor; end
|
1202
|
+
def set_notice_receiver; end
|
1203
|
+
def set_single_row_mode; end
|
1204
|
+
|
1205
|
+
# call-seq:
|
1206
|
+
# conn.setnonblocking(Boolean) -> nil
|
1207
|
+
#
|
1208
|
+
# Sets the nonblocking status of the connection.
|
1209
|
+
# In the blocking state, calls to #send_query
|
1210
|
+
# will block until the message is sent to the server,
|
1211
|
+
# but will not wait for the query results.
|
1212
|
+
# In the nonblocking state, calls to #send_query
|
1213
|
+
# will return an error if the socket is not ready for
|
1214
|
+
# writing.
|
1215
|
+
# Note: This function does not affect #exec, because
|
1216
|
+
# that function doesn't return until the server has
|
1217
|
+
# processed the query and returned the results.
|
1218
|
+
#
|
1219
|
+
# Returns +nil+.
|
1220
|
+
#
|
1221
|
+
# source://pg//lib/pg/connection.rb#394
|
1222
|
+
def setnonblocking(enabled); end
|
1223
|
+
|
1224
|
+
def socket; end
|
1225
|
+
def socket_io; end
|
1226
|
+
def ssl_attribute(_arg0); end
|
1227
|
+
def ssl_attribute_names; end
|
1228
|
+
|
1229
|
+
# call-seq:
|
1230
|
+
# conn.ssl_attributes -> Hash<String,String>
|
1231
|
+
#
|
1232
|
+
# Returns SSL-related information about the connection as key/value pairs
|
1233
|
+
#
|
1234
|
+
# The available attributes varies depending on the SSL library being used,
|
1235
|
+
# and the type of connection.
|
1236
|
+
#
|
1237
|
+
# See also #ssl_attribute
|
1238
|
+
#
|
1239
|
+
# source://pg//lib/pg/connection.rb#316
|
1240
|
+
def ssl_attributes; end
|
1241
|
+
|
1242
|
+
def ssl_in_use?; end
|
1243
|
+
def status; end
|
1244
|
+
def sync_cancel; end
|
1245
|
+
def sync_describe_portal(_arg0); end
|
1246
|
+
def sync_describe_prepared(_arg0); end
|
1247
|
+
def sync_encrypt_password(*_arg0); end
|
1248
|
+
def sync_exec(*_arg0); end
|
1249
|
+
def sync_exec_params(*_arg0); end
|
1250
|
+
def sync_exec_prepared(*_arg0); end
|
1251
|
+
def sync_flush; end
|
1252
|
+
def sync_get_copy_data(*_arg0); end
|
1253
|
+
def sync_get_last_result; end
|
1254
|
+
def sync_get_result; end
|
1255
|
+
def sync_isnonblocking; end
|
1256
|
+
def sync_prepare(*_arg0); end
|
1257
|
+
def sync_put_copy_data(*_arg0); end
|
1258
|
+
def sync_put_copy_end(*_arg0); end
|
1259
|
+
def sync_reset; end
|
1260
|
+
def sync_set_client_encoding(_arg0); end
|
1261
|
+
def sync_setnonblocking(_arg0); end
|
1262
|
+
def trace(_arg0); end
|
1263
|
+
|
1264
|
+
# call-seq:
|
1265
|
+
# conn.transaction { |conn| ... } -> result of the block
|
1266
|
+
#
|
1267
|
+
# Executes a +BEGIN+ at the start of the block,
|
1268
|
+
# and a +COMMIT+ at the end of the block, or
|
1269
|
+
# +ROLLBACK+ if any exception occurs.
|
1270
|
+
#
|
1271
|
+
# source://pg//lib/pg/connection.rb#259
|
1272
|
+
def transaction; end
|
1273
|
+
|
1274
|
+
def transaction_status; end
|
1275
|
+
def tty; end
|
1276
|
+
def type_map_for_queries; end
|
1277
|
+
def type_map_for_queries=(_arg0); end
|
1278
|
+
def type_map_for_results; end
|
1279
|
+
def type_map_for_results=(_arg0); end
|
1280
|
+
def unescape_bytea(_arg0); end
|
1281
|
+
def untrace; end
|
1282
|
+
def user; end
|
1283
|
+
def wait_for_notify(*_arg0); end
|
1284
|
+
|
1285
|
+
private
|
1286
|
+
|
1287
|
+
# source://pg//lib/pg/connection.rb#574
|
1288
|
+
def async_connect_or_reset(poll_meth); end
|
1289
|
+
|
1290
|
+
def flush_data=(_arg0); end
|
1291
|
+
|
1292
|
+
class << self
|
1293
|
+
# Switch between sync and async libpq API.
|
1294
|
+
#
|
1295
|
+
# PG::Connection.async_api = true
|
1296
|
+
# this is the default.
|
1297
|
+
# It sets an alias from #exec to #async_exec, #reset to #async_reset and so on.
|
1298
|
+
#
|
1299
|
+
# PG::Connection.async_api = false
|
1300
|
+
# sets an alias from #exec to #sync_exec, #reset to #sync_reset and so on.
|
1301
|
+
#
|
1302
|
+
# pg-1.1.0+ defaults to libpq's async API for query related blocking methods.
|
1303
|
+
# pg-1.3.0+ defaults to libpq's async API for all possibly blocking methods.
|
1304
|
+
#
|
1305
|
+
# _PLEASE_ _NOTE_: This method is not part of the public API and is for debug and development use only.
|
1306
|
+
# Do not use this method in production code.
|
1307
|
+
# Any issues with the default setting of <tt>async_api=true</tt> should be reported to the maintainers instead.
|
1308
|
+
#
|
1309
|
+
# source://pg//lib/pg/connection.rb#865
|
1310
|
+
def async_api=(enable); end
|
1311
|
+
|
1312
|
+
# call-seq:
|
1313
|
+
# PG::Connection.new -> conn
|
1314
|
+
# PG::Connection.new(connection_hash) -> conn
|
1315
|
+
# PG::Connection.new(connection_string) -> conn
|
1316
|
+
# PG::Connection.new(host, port, options, tty, dbname, user, password) -> conn
|
1317
|
+
#
|
1318
|
+
# Create a connection to the specified server.
|
1319
|
+
#
|
1320
|
+
# +connection_hash+ must be a ruby Hash with connection parameters.
|
1321
|
+
# See the {list of valid parameters}[https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-PARAMKEYWORDS] in the PostgreSQL documentation.
|
1322
|
+
#
|
1323
|
+
# There are two accepted formats for +connection_string+: plain <code>keyword = value</code> strings and URIs.
|
1324
|
+
# See the documentation of {connection strings}[https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING].
|
1325
|
+
#
|
1326
|
+
# The positional parameter form has the same functionality except that the missing parameters will always take on default values. The parameters are:
|
1327
|
+
# [+host+]
|
1328
|
+
# server hostname
|
1329
|
+
# [+port+]
|
1330
|
+
# server port number
|
1331
|
+
# [+options+]
|
1332
|
+
# backend options
|
1333
|
+
# [+tty+]
|
1334
|
+
# (ignored in all versions of PostgreSQL)
|
1335
|
+
# [+dbname+]
|
1336
|
+
# connecting database name
|
1337
|
+
# [+user+]
|
1338
|
+
# login user name
|
1339
|
+
# [+password+]
|
1340
|
+
# login password
|
1341
|
+
#
|
1342
|
+
# Examples:
|
1343
|
+
#
|
1344
|
+
# # Connect using all defaults
|
1345
|
+
# PG::Connection.new
|
1346
|
+
#
|
1347
|
+
# # As a Hash
|
1348
|
+
# PG::Connection.new( dbname: 'test', port: 5432 )
|
1349
|
+
#
|
1350
|
+
# # As a String
|
1351
|
+
# PG::Connection.new( "dbname=test port=5432" )
|
1352
|
+
#
|
1353
|
+
# # As an Array
|
1354
|
+
# PG::Connection.new( nil, 5432, nil, nil, 'test', nil, nil )
|
1355
|
+
#
|
1356
|
+
# # As an URI
|
1357
|
+
# PG::Connection.new( "postgresql://user:pass@pgsql.example.com:5432/testdb?sslmode=require" )
|
1358
|
+
#
|
1359
|
+
# If the Ruby default internal encoding is set (i.e., <code>Encoding.default_internal != nil</code>), the
|
1360
|
+
# connection will have its +client_encoding+ set accordingly.
|
1361
|
+
#
|
1362
|
+
# Raises a PG::Error if the connection fails.
|
1363
|
+
#
|
1364
|
+
# source://pg//lib/pg/connection.rb#695
|
1365
|
+
def async_connect(*args); end
|
1366
|
+
|
1367
|
+
# call-seq:
|
1368
|
+
# PG::Connection.ping(connection_hash) -> Integer
|
1369
|
+
# PG::Connection.ping(connection_string) -> Integer
|
1370
|
+
# PG::Connection.ping(host, port, options, tty, dbname, login, password) -> Integer
|
1371
|
+
#
|
1372
|
+
# Check server status.
|
1373
|
+
#
|
1374
|
+
# See PG::Connection.new for a description of the parameters.
|
1375
|
+
#
|
1376
|
+
# Returns one of:
|
1377
|
+
# [+PQPING_OK+]
|
1378
|
+
# server is accepting connections
|
1379
|
+
# [+PQPING_REJECT+]
|
1380
|
+
# server is alive but rejecting connections
|
1381
|
+
# [+PQPING_NO_RESPONSE+]
|
1382
|
+
# could not establish connection
|
1383
|
+
# [+PQPING_NO_ATTEMPT+]
|
1384
|
+
# connection not attempted (bad params)
|
1385
|
+
#
|
1386
|
+
# source://pg//lib/pg/connection.rb#790
|
1387
|
+
def async_ping(*args); end
|
1388
|
+
|
1389
|
+
# source://pg//lib/pg/connection.rb#842
|
1390
|
+
def async_send_api=(enable); end
|
1391
|
+
|
1392
|
+
def conndefaults; end
|
1393
|
+
|
1394
|
+
# Return the Postgres connection defaults structure as a Hash keyed by option
|
1395
|
+
# keyword (as a Symbol).
|
1396
|
+
#
|
1397
|
+
# See also #conndefaults
|
1398
|
+
#
|
1399
|
+
# source://pg//lib/pg/connection.rb#283
|
1400
|
+
def conndefaults_hash; end
|
1401
|
+
|
1402
|
+
# call-seq:
|
1403
|
+
# PG::Connection.new -> conn
|
1404
|
+
# PG::Connection.new(connection_hash) -> conn
|
1405
|
+
# PG::Connection.new(connection_string) -> conn
|
1406
|
+
# PG::Connection.new(host, port, options, tty, dbname, user, password) -> conn
|
1407
|
+
#
|
1408
|
+
# Create a connection to the specified server.
|
1409
|
+
#
|
1410
|
+
# +connection_hash+ must be a ruby Hash with connection parameters.
|
1411
|
+
# See the {list of valid parameters}[https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-PARAMKEYWORDS] in the PostgreSQL documentation.
|
1412
|
+
#
|
1413
|
+
# There are two accepted formats for +connection_string+: plain <code>keyword = value</code> strings and URIs.
|
1414
|
+
# See the documentation of {connection strings}[https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING].
|
1415
|
+
#
|
1416
|
+
# The positional parameter form has the same functionality except that the missing parameters will always take on default values. The parameters are:
|
1417
|
+
# [+host+]
|
1418
|
+
# server hostname
|
1419
|
+
# [+port+]
|
1420
|
+
# server port number
|
1421
|
+
# [+options+]
|
1422
|
+
# backend options
|
1423
|
+
# [+tty+]
|
1424
|
+
# (ignored in all versions of PostgreSQL)
|
1425
|
+
# [+dbname+]
|
1426
|
+
# connecting database name
|
1427
|
+
# [+user+]
|
1428
|
+
# login user name
|
1429
|
+
# [+password+]
|
1430
|
+
# login password
|
1431
|
+
#
|
1432
|
+
# Examples:
|
1433
|
+
#
|
1434
|
+
# # Connect using all defaults
|
1435
|
+
# PG::Connection.new
|
1436
|
+
#
|
1437
|
+
# # As a Hash
|
1438
|
+
# PG::Connection.new( dbname: 'test', port: 5432 )
|
1439
|
+
#
|
1440
|
+
# # As a String
|
1441
|
+
# PG::Connection.new( "dbname=test port=5432" )
|
1442
|
+
#
|
1443
|
+
# # As an Array
|
1444
|
+
# PG::Connection.new( nil, 5432, nil, nil, 'test', nil, nil )
|
1445
|
+
#
|
1446
|
+
# # As an URI
|
1447
|
+
# PG::Connection.new( "postgresql://user:pass@pgsql.example.com:5432/testdb?sslmode=require" )
|
1448
|
+
#
|
1449
|
+
# If the Ruby default internal encoding is set (i.e., <code>Encoding.default_internal != nil</code>), the
|
1450
|
+
# connection will have its +client_encoding+ set accordingly.
|
1451
|
+
#
|
1452
|
+
# Raises a PG::Error if the connection fails.
|
1453
|
+
#
|
1454
|
+
# source://pg//lib/pg/connection.rb#695
|
1455
|
+
def connect(*args); end
|
1456
|
+
|
1457
|
+
# Convert Hash options to connection String
|
1458
|
+
#
|
1459
|
+
# Values are properly quoted and escaped.
|
1460
|
+
#
|
1461
|
+
# source://pg//lib/pg/connection.rb#45
|
1462
|
+
def connect_hash_to_string(hash); end
|
1463
|
+
|
1464
|
+
def connect_start(*_arg0); end
|
1465
|
+
def conninfo_parse(_arg0); end
|
1466
|
+
def encrypt_password(_arg0, _arg1); end
|
1467
|
+
def escape(_arg0); end
|
1468
|
+
def escape_bytea(_arg0); end
|
1469
|
+
def escape_string(_arg0); end
|
1470
|
+
def isthreadsafe; end
|
1471
|
+
|
1472
|
+
# call-seq:
|
1473
|
+
# PG::Connection.new -> conn
|
1474
|
+
# PG::Connection.new(connection_hash) -> conn
|
1475
|
+
# PG::Connection.new(connection_string) -> conn
|
1476
|
+
# PG::Connection.new(host, port, options, tty, dbname, user, password) -> conn
|
1477
|
+
#
|
1478
|
+
# Create a connection to the specified server.
|
1479
|
+
#
|
1480
|
+
# +connection_hash+ must be a ruby Hash with connection parameters.
|
1481
|
+
# See the {list of valid parameters}[https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-PARAMKEYWORDS] in the PostgreSQL documentation.
|
1482
|
+
#
|
1483
|
+
# There are two accepted formats for +connection_string+: plain <code>keyword = value</code> strings and URIs.
|
1484
|
+
# See the documentation of {connection strings}[https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING].
|
1485
|
+
#
|
1486
|
+
# The positional parameter form has the same functionality except that the missing parameters will always take on default values. The parameters are:
|
1487
|
+
# [+host+]
|
1488
|
+
# server hostname
|
1489
|
+
# [+port+]
|
1490
|
+
# server port number
|
1491
|
+
# [+options+]
|
1492
|
+
# backend options
|
1493
|
+
# [+tty+]
|
1494
|
+
# (ignored in all versions of PostgreSQL)
|
1495
|
+
# [+dbname+]
|
1496
|
+
# connecting database name
|
1497
|
+
# [+user+]
|
1498
|
+
# login user name
|
1499
|
+
# [+password+]
|
1500
|
+
# login password
|
1501
|
+
#
|
1502
|
+
# Examples:
|
1503
|
+
#
|
1504
|
+
# # Connect using all defaults
|
1505
|
+
# PG::Connection.new
|
1506
|
+
#
|
1507
|
+
# # As a Hash
|
1508
|
+
# PG::Connection.new( dbname: 'test', port: 5432 )
|
1509
|
+
#
|
1510
|
+
# # As a String
|
1511
|
+
# PG::Connection.new( "dbname=test port=5432" )
|
1512
|
+
#
|
1513
|
+
# # As an Array
|
1514
|
+
# PG::Connection.new( nil, 5432, nil, nil, 'test', nil, nil )
|
1515
|
+
#
|
1516
|
+
# # As an URI
|
1517
|
+
# PG::Connection.new( "postgresql://user:pass@pgsql.example.com:5432/testdb?sslmode=require" )
|
1518
|
+
#
|
1519
|
+
# If the Ruby default internal encoding is set (i.e., <code>Encoding.default_internal != nil</code>), the
|
1520
|
+
# connection will have its +client_encoding+ set accordingly.
|
1521
|
+
#
|
1522
|
+
# Raises a PG::Error if the connection fails.
|
1523
|
+
#
|
1524
|
+
# source://pg//lib/pg/connection.rb#695
|
1525
|
+
def new(*args); end
|
1526
|
+
|
1527
|
+
# call-seq:
|
1528
|
+
# PG::Connection.new -> conn
|
1529
|
+
# PG::Connection.new(connection_hash) -> conn
|
1530
|
+
# PG::Connection.new(connection_string) -> conn
|
1531
|
+
# PG::Connection.new(host, port, options, tty, dbname, user, password) -> conn
|
1532
|
+
#
|
1533
|
+
# Create a connection to the specified server.
|
1534
|
+
#
|
1535
|
+
# +connection_hash+ must be a ruby Hash with connection parameters.
|
1536
|
+
# See the {list of valid parameters}[https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-PARAMKEYWORDS] in the PostgreSQL documentation.
|
1537
|
+
#
|
1538
|
+
# There are two accepted formats for +connection_string+: plain <code>keyword = value</code> strings and URIs.
|
1539
|
+
# See the documentation of {connection strings}[https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING].
|
1540
|
+
#
|
1541
|
+
# The positional parameter form has the same functionality except that the missing parameters will always take on default values. The parameters are:
|
1542
|
+
# [+host+]
|
1543
|
+
# server hostname
|
1544
|
+
# [+port+]
|
1545
|
+
# server port number
|
1546
|
+
# [+options+]
|
1547
|
+
# backend options
|
1548
|
+
# [+tty+]
|
1549
|
+
# (ignored in all versions of PostgreSQL)
|
1550
|
+
# [+dbname+]
|
1551
|
+
# connecting database name
|
1552
|
+
# [+user+]
|
1553
|
+
# login user name
|
1554
|
+
# [+password+]
|
1555
|
+
# login password
|
1556
|
+
#
|
1557
|
+
# Examples:
|
1558
|
+
#
|
1559
|
+
# # Connect using all defaults
|
1560
|
+
# PG::Connection.new
|
1561
|
+
#
|
1562
|
+
# # As a Hash
|
1563
|
+
# PG::Connection.new( dbname: 'test', port: 5432 )
|
1564
|
+
#
|
1565
|
+
# # As a String
|
1566
|
+
# PG::Connection.new( "dbname=test port=5432" )
|
1567
|
+
#
|
1568
|
+
# # As an Array
|
1569
|
+
# PG::Connection.new( nil, 5432, nil, nil, 'test', nil, nil )
|
1570
|
+
#
|
1571
|
+
# # As an URI
|
1572
|
+
# PG::Connection.new( "postgresql://user:pass@pgsql.example.com:5432/testdb?sslmode=require" )
|
1573
|
+
#
|
1574
|
+
# If the Ruby default internal encoding is set (i.e., <code>Encoding.default_internal != nil</code>), the
|
1575
|
+
# connection will have its +client_encoding+ set accordingly.
|
1576
|
+
#
|
1577
|
+
# Raises a PG::Error if the connection fails.
|
1578
|
+
#
|
1579
|
+
# source://pg//lib/pg/connection.rb#695
|
1580
|
+
def open(*args); end
|
1581
|
+
|
1582
|
+
# Parse the connection +args+ into a connection-parameter string.
|
1583
|
+
# See PG::Connection.new for valid arguments.
|
1584
|
+
#
|
1585
|
+
# It accepts:
|
1586
|
+
# * an option String kind of "host=name port=5432"
|
1587
|
+
# * an option Hash kind of {host: "name", port: 5432}
|
1588
|
+
# * URI string
|
1589
|
+
# * URI object
|
1590
|
+
# * positional arguments
|
1591
|
+
#
|
1592
|
+
# The method adds the option "fallback_application_name" if it isn't already set.
|
1593
|
+
# It returns a connection string with "key=value" pairs.
|
1594
|
+
#
|
1595
|
+
# source://pg//lib/pg/connection.rb#61
|
1596
|
+
def parse_connect_args(*args); end
|
1597
|
+
|
1598
|
+
# call-seq:
|
1599
|
+
# PG::Connection.ping(connection_hash) -> Integer
|
1600
|
+
# PG::Connection.ping(connection_string) -> Integer
|
1601
|
+
# PG::Connection.ping(host, port, options, tty, dbname, login, password) -> Integer
|
1602
|
+
#
|
1603
|
+
# Check server status.
|
1604
|
+
#
|
1605
|
+
# See PG::Connection.new for a description of the parameters.
|
1606
|
+
#
|
1607
|
+
# Returns one of:
|
1608
|
+
# [+PQPING_OK+]
|
1609
|
+
# server is accepting connections
|
1610
|
+
# [+PQPING_REJECT+]
|
1611
|
+
# server is alive but rejecting connections
|
1612
|
+
# [+PQPING_NO_RESPONSE+]
|
1613
|
+
# could not establish connection
|
1614
|
+
# [+PQPING_NO_ATTEMPT+]
|
1615
|
+
# connection not attempted (bad params)
|
1616
|
+
#
|
1617
|
+
# source://pg//lib/pg/connection.rb#790
|
1618
|
+
def ping(*args); end
|
1619
|
+
|
1620
|
+
# Quote a single +value+ for use in a connection-parameter string.
|
1621
|
+
#
|
1622
|
+
# source://pg//lib/pg/connection.rb#38
|
1623
|
+
def quote_connstr(value); end
|
1624
|
+
|
1625
|
+
def quote_ident(_arg0); end
|
1626
|
+
|
1627
|
+
# call-seq:
|
1628
|
+
# PG::Connection.new -> conn
|
1629
|
+
# PG::Connection.new(connection_hash) -> conn
|
1630
|
+
# PG::Connection.new(connection_string) -> conn
|
1631
|
+
# PG::Connection.new(host, port, options, tty, dbname, user, password) -> conn
|
1632
|
+
#
|
1633
|
+
# Create a connection to the specified server.
|
1634
|
+
#
|
1635
|
+
# +connection_hash+ must be a ruby Hash with connection parameters.
|
1636
|
+
# See the {list of valid parameters}[https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-PARAMKEYWORDS] in the PostgreSQL documentation.
|
1637
|
+
#
|
1638
|
+
# There are two accepted formats for +connection_string+: plain <code>keyword = value</code> strings and URIs.
|
1639
|
+
# See the documentation of {connection strings}[https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING].
|
1640
|
+
#
|
1641
|
+
# The positional parameter form has the same functionality except that the missing parameters will always take on default values. The parameters are:
|
1642
|
+
# [+host+]
|
1643
|
+
# server hostname
|
1644
|
+
# [+port+]
|
1645
|
+
# server port number
|
1646
|
+
# [+options+]
|
1647
|
+
# backend options
|
1648
|
+
# [+tty+]
|
1649
|
+
# (ignored in all versions of PostgreSQL)
|
1650
|
+
# [+dbname+]
|
1651
|
+
# connecting database name
|
1652
|
+
# [+user+]
|
1653
|
+
# login user name
|
1654
|
+
# [+password+]
|
1655
|
+
# login password
|
1656
|
+
#
|
1657
|
+
# Examples:
|
1658
|
+
#
|
1659
|
+
# # Connect using all defaults
|
1660
|
+
# PG::Connection.new
|
1661
|
+
#
|
1662
|
+
# # As a Hash
|
1663
|
+
# PG::Connection.new( dbname: 'test', port: 5432 )
|
1664
|
+
#
|
1665
|
+
# # As a String
|
1666
|
+
# PG::Connection.new( "dbname=test port=5432" )
|
1667
|
+
#
|
1668
|
+
# # As an Array
|
1669
|
+
# PG::Connection.new( nil, 5432, nil, nil, 'test', nil, nil )
|
1670
|
+
#
|
1671
|
+
# # As an URI
|
1672
|
+
# PG::Connection.new( "postgresql://user:pass@pgsql.example.com:5432/testdb?sslmode=require" )
|
1673
|
+
#
|
1674
|
+
# If the Ruby default internal encoding is set (i.e., <code>Encoding.default_internal != nil</code>), the
|
1675
|
+
# connection will have its +client_encoding+ set accordingly.
|
1676
|
+
#
|
1677
|
+
# Raises a PG::Error if the connection fails.
|
1678
|
+
#
|
1679
|
+
# source://pg//lib/pg/connection.rb#695
|
1680
|
+
def setdb(*args); end
|
1681
|
+
|
1682
|
+
# call-seq:
|
1683
|
+
# PG::Connection.new -> conn
|
1684
|
+
# PG::Connection.new(connection_hash) -> conn
|
1685
|
+
# PG::Connection.new(connection_string) -> conn
|
1686
|
+
# PG::Connection.new(host, port, options, tty, dbname, user, password) -> conn
|
1687
|
+
#
|
1688
|
+
# Create a connection to the specified server.
|
1689
|
+
#
|
1690
|
+
# +connection_hash+ must be a ruby Hash with connection parameters.
|
1691
|
+
# See the {list of valid parameters}[https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-PARAMKEYWORDS] in the PostgreSQL documentation.
|
1692
|
+
#
|
1693
|
+
# There are two accepted formats for +connection_string+: plain <code>keyword = value</code> strings and URIs.
|
1694
|
+
# See the documentation of {connection strings}[https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING].
|
1695
|
+
#
|
1696
|
+
# The positional parameter form has the same functionality except that the missing parameters will always take on default values. The parameters are:
|
1697
|
+
# [+host+]
|
1698
|
+
# server hostname
|
1699
|
+
# [+port+]
|
1700
|
+
# server port number
|
1701
|
+
# [+options+]
|
1702
|
+
# backend options
|
1703
|
+
# [+tty+]
|
1704
|
+
# (ignored in all versions of PostgreSQL)
|
1705
|
+
# [+dbname+]
|
1706
|
+
# connecting database name
|
1707
|
+
# [+user+]
|
1708
|
+
# login user name
|
1709
|
+
# [+password+]
|
1710
|
+
# login password
|
1711
|
+
#
|
1712
|
+
# Examples:
|
1713
|
+
#
|
1714
|
+
# # Connect using all defaults
|
1715
|
+
# PG::Connection.new
|
1716
|
+
#
|
1717
|
+
# # As a Hash
|
1718
|
+
# PG::Connection.new( dbname: 'test', port: 5432 )
|
1719
|
+
#
|
1720
|
+
# # As a String
|
1721
|
+
# PG::Connection.new( "dbname=test port=5432" )
|
1722
|
+
#
|
1723
|
+
# # As an Array
|
1724
|
+
# PG::Connection.new( nil, 5432, nil, nil, 'test', nil, nil )
|
1725
|
+
#
|
1726
|
+
# # As an URI
|
1727
|
+
# PG::Connection.new( "postgresql://user:pass@pgsql.example.com:5432/testdb?sslmode=require" )
|
1728
|
+
#
|
1729
|
+
# If the Ruby default internal encoding is set (i.e., <code>Encoding.default_internal != nil</code>), the
|
1730
|
+
# connection will have its +client_encoding+ set accordingly.
|
1731
|
+
#
|
1732
|
+
# Raises a PG::Error if the connection fails.
|
1733
|
+
#
|
1734
|
+
# source://pg//lib/pg/connection.rb#695
|
1735
|
+
def setdblogin(*args); end
|
1736
|
+
|
1737
|
+
def sync_connect(*_arg0); end
|
1738
|
+
def sync_ping(*_arg0); end
|
1739
|
+
def unescape_bytea(_arg0); end
|
1740
|
+
|
1741
|
+
private
|
1742
|
+
|
1743
|
+
# source://pg//lib/pg/connection.rb#713
|
1744
|
+
def connect_to_hosts(*args); end
|
1745
|
+
|
1746
|
+
# source://pg//lib/pg/connection.rb#765
|
1747
|
+
def host_is_named_pipe?(host_string); end
|
1748
|
+
end
|
1749
|
+
end
|
1750
|
+
|
1751
|
+
# The order the options are passed to the ::connect method.
|
1752
|
+
#
|
1753
|
+
# source://pg//lib/pg/connection.rb#34
|
1754
|
+
PG::Connection::CONNECT_ARGUMENT_ORDER = T.let(T.unsafe(nil), Array)
|
1755
|
+
|
1756
|
+
class PG::ConnectionBad < ::PG::Error; end
|
1757
|
+
class PG::ConnectionDoesNotExist < ::PG::ConnectionException; end
|
1758
|
+
class PG::ConnectionException < ::PG::ServerError; end
|
1759
|
+
class PG::ConnectionFailure < ::PG::ConnectionException; end
|
1760
|
+
|
1761
|
+
# source://pg//lib/pg/constants.rb#7
|
1762
|
+
module PG::Constants; end
|
1763
|
+
|
1764
|
+
PG::Constants::CONNECTION_AUTH_OK = T.let(T.unsafe(nil), Integer)
|
1765
|
+
PG::Constants::CONNECTION_AWAITING_RESPONSE = T.let(T.unsafe(nil), Integer)
|
1766
|
+
PG::Constants::CONNECTION_BAD = T.let(T.unsafe(nil), Integer)
|
1767
|
+
PG::Constants::CONNECTION_CHECK_STANDBY = T.let(T.unsafe(nil), Integer)
|
1768
|
+
PG::Constants::CONNECTION_CHECK_TARGET = T.let(T.unsafe(nil), Integer)
|
1769
|
+
PG::Constants::CONNECTION_CHECK_WRITABLE = T.let(T.unsafe(nil), Integer)
|
1770
|
+
PG::Constants::CONNECTION_CONSUME = T.let(T.unsafe(nil), Integer)
|
1771
|
+
PG::Constants::CONNECTION_GSS_STARTUP = T.let(T.unsafe(nil), Integer)
|
1772
|
+
PG::Constants::CONNECTION_MADE = T.let(T.unsafe(nil), Integer)
|
1773
|
+
PG::Constants::CONNECTION_NEEDED = T.let(T.unsafe(nil), Integer)
|
1774
|
+
PG::Constants::CONNECTION_OK = T.let(T.unsafe(nil), Integer)
|
1775
|
+
PG::Constants::CONNECTION_SETENV = T.let(T.unsafe(nil), Integer)
|
1776
|
+
PG::Constants::CONNECTION_SSL_STARTUP = T.let(T.unsafe(nil), Integer)
|
1777
|
+
PG::Constants::CONNECTION_STARTED = T.let(T.unsafe(nil), Integer)
|
1778
|
+
PG::Constants::DEF_PGPORT = T.let(T.unsafe(nil), Integer)
|
1779
|
+
PG::Constants::INVALID_OID = T.let(T.unsafe(nil), Integer)
|
1780
|
+
PG::Constants::INV_READ = T.let(T.unsafe(nil), Integer)
|
1781
|
+
PG::Constants::INV_WRITE = T.let(T.unsafe(nil), Integer)
|
1782
|
+
PG::Constants::InvalidOid = T.let(T.unsafe(nil), Integer)
|
1783
|
+
PG::Constants::PGRES_BAD_RESPONSE = T.let(T.unsafe(nil), Integer)
|
1784
|
+
PG::Constants::PGRES_COMMAND_OK = T.let(T.unsafe(nil), Integer)
|
1785
|
+
PG::Constants::PGRES_COPY_BOTH = T.let(T.unsafe(nil), Integer)
|
1786
|
+
PG::Constants::PGRES_COPY_IN = T.let(T.unsafe(nil), Integer)
|
1787
|
+
PG::Constants::PGRES_COPY_OUT = T.let(T.unsafe(nil), Integer)
|
1788
|
+
PG::Constants::PGRES_EMPTY_QUERY = T.let(T.unsafe(nil), Integer)
|
1789
|
+
PG::Constants::PGRES_FATAL_ERROR = T.let(T.unsafe(nil), Integer)
|
1790
|
+
PG::Constants::PGRES_NONFATAL_ERROR = T.let(T.unsafe(nil), Integer)
|
1791
|
+
PG::Constants::PGRES_PIPELINE_ABORTED = T.let(T.unsafe(nil), Integer)
|
1792
|
+
PG::Constants::PGRES_PIPELINE_SYNC = T.let(T.unsafe(nil), Integer)
|
1793
|
+
PG::Constants::PGRES_POLLING_FAILED = T.let(T.unsafe(nil), Integer)
|
1794
|
+
PG::Constants::PGRES_POLLING_OK = T.let(T.unsafe(nil), Integer)
|
1795
|
+
PG::Constants::PGRES_POLLING_READING = T.let(T.unsafe(nil), Integer)
|
1796
|
+
PG::Constants::PGRES_POLLING_WRITING = T.let(T.unsafe(nil), Integer)
|
1797
|
+
PG::Constants::PGRES_SINGLE_TUPLE = T.let(T.unsafe(nil), Integer)
|
1798
|
+
PG::Constants::PGRES_TUPLES_OK = T.let(T.unsafe(nil), Integer)
|
1799
|
+
PG::Constants::PG_DIAG_COLUMN_NAME = T.let(T.unsafe(nil), Integer)
|
1800
|
+
PG::Constants::PG_DIAG_CONSTRAINT_NAME = T.let(T.unsafe(nil), Integer)
|
1801
|
+
PG::Constants::PG_DIAG_CONTEXT = T.let(T.unsafe(nil), Integer)
|
1802
|
+
PG::Constants::PG_DIAG_DATATYPE_NAME = T.let(T.unsafe(nil), Integer)
|
1803
|
+
PG::Constants::PG_DIAG_INTERNAL_POSITION = T.let(T.unsafe(nil), Integer)
|
1804
|
+
PG::Constants::PG_DIAG_INTERNAL_QUERY = T.let(T.unsafe(nil), Integer)
|
1805
|
+
PG::Constants::PG_DIAG_MESSAGE_DETAIL = T.let(T.unsafe(nil), Integer)
|
1806
|
+
PG::Constants::PG_DIAG_MESSAGE_HINT = T.let(T.unsafe(nil), Integer)
|
1807
|
+
PG::Constants::PG_DIAG_MESSAGE_PRIMARY = T.let(T.unsafe(nil), Integer)
|
1808
|
+
PG::Constants::PG_DIAG_SCHEMA_NAME = T.let(T.unsafe(nil), Integer)
|
1809
|
+
PG::Constants::PG_DIAG_SEVERITY = T.let(T.unsafe(nil), Integer)
|
1810
|
+
PG::Constants::PG_DIAG_SEVERITY_NONLOCALIZED = T.let(T.unsafe(nil), Integer)
|
1811
|
+
PG::Constants::PG_DIAG_SOURCE_FILE = T.let(T.unsafe(nil), Integer)
|
1812
|
+
PG::Constants::PG_DIAG_SOURCE_FUNCTION = T.let(T.unsafe(nil), Integer)
|
1813
|
+
PG::Constants::PG_DIAG_SOURCE_LINE = T.let(T.unsafe(nil), Integer)
|
1814
|
+
PG::Constants::PG_DIAG_SQLSTATE = T.let(T.unsafe(nil), Integer)
|
1815
|
+
PG::Constants::PG_DIAG_STATEMENT_POSITION = T.let(T.unsafe(nil), Integer)
|
1816
|
+
PG::Constants::PG_DIAG_TABLE_NAME = T.let(T.unsafe(nil), Integer)
|
1817
|
+
PG::Constants::PQERRORS_DEFAULT = T.let(T.unsafe(nil), Integer)
|
1818
|
+
PG::Constants::PQERRORS_SQLSTATE = T.let(T.unsafe(nil), Integer)
|
1819
|
+
PG::Constants::PQERRORS_TERSE = T.let(T.unsafe(nil), Integer)
|
1820
|
+
PG::Constants::PQERRORS_VERBOSE = T.let(T.unsafe(nil), Integer)
|
1821
|
+
PG::Constants::PQPING_NO_ATTEMPT = T.let(T.unsafe(nil), Integer)
|
1822
|
+
PG::Constants::PQPING_NO_RESPONSE = T.let(T.unsafe(nil), Integer)
|
1823
|
+
PG::Constants::PQPING_OK = T.let(T.unsafe(nil), Integer)
|
1824
|
+
PG::Constants::PQPING_REJECT = T.let(T.unsafe(nil), Integer)
|
1825
|
+
PG::Constants::PQSHOW_CONTEXT_ALWAYS = T.let(T.unsafe(nil), Integer)
|
1826
|
+
PG::Constants::PQSHOW_CONTEXT_ERRORS = T.let(T.unsafe(nil), Integer)
|
1827
|
+
PG::Constants::PQSHOW_CONTEXT_NEVER = T.let(T.unsafe(nil), Integer)
|
1828
|
+
PG::Constants::PQTRANS_ACTIVE = T.let(T.unsafe(nil), Integer)
|
1829
|
+
PG::Constants::PQTRANS_IDLE = T.let(T.unsafe(nil), Integer)
|
1830
|
+
PG::Constants::PQTRANS_INERROR = T.let(T.unsafe(nil), Integer)
|
1831
|
+
PG::Constants::PQTRANS_INTRANS = T.let(T.unsafe(nil), Integer)
|
1832
|
+
PG::Constants::PQTRANS_UNKNOWN = T.let(T.unsafe(nil), Integer)
|
1833
|
+
PG::Constants::PQ_PIPELINE_ABORTED = T.let(T.unsafe(nil), Integer)
|
1834
|
+
PG::Constants::PQ_PIPELINE_OFF = T.let(T.unsafe(nil), Integer)
|
1835
|
+
PG::Constants::PQ_PIPELINE_ON = T.let(T.unsafe(nil), Integer)
|
1836
|
+
PG::Constants::SEEK_CUR = T.let(T.unsafe(nil), Integer)
|
1837
|
+
PG::Constants::SEEK_END = T.let(T.unsafe(nil), Integer)
|
1838
|
+
PG::Constants::SEEK_SET = T.let(T.unsafe(nil), Integer)
|
1839
|
+
|
1840
|
+
# source://pg//lib/pg/coder.rb#87
|
1841
|
+
class PG::CopyCoder < ::PG::Coder
|
1842
|
+
def delimiter; end
|
1843
|
+
def delimiter=(_arg0); end
|
1844
|
+
def null_string; end
|
1845
|
+
def null_string=(_arg0); end
|
1846
|
+
|
1847
|
+
# source://pg//lib/pg/coder.rb#88
|
1848
|
+
def to_h; end
|
1849
|
+
|
1850
|
+
def type_map; end
|
1851
|
+
def type_map=(_arg0); end
|
1852
|
+
end
|
1853
|
+
|
1854
|
+
class PG::CopyDecoder < ::PG::CopyCoder
|
1855
|
+
include ::PG::Coder::BinaryFormatting
|
1856
|
+
end
|
1857
|
+
|
1858
|
+
class PG::CopyEncoder < ::PG::CopyCoder
|
1859
|
+
include ::PG::Coder::BinaryFormatting
|
1860
|
+
end
|
1861
|
+
|
1862
|
+
class PG::CrashShutdown < ::PG::OperatorIntervention; end
|
1863
|
+
class PG::DataCorrupted < ::PG::InternalError; end
|
1864
|
+
class PG::DataException < ::PG::ServerError; end
|
1865
|
+
class PG::DatabaseDropped < ::PG::OperatorIntervention; end
|
1866
|
+
class PG::DatatypeMismatch < ::PG::SyntaxErrorOrAccessRuleViolation; end
|
1867
|
+
class PG::DatetimeFieldOverflow < ::PG::DataException; end
|
1868
|
+
class PG::DependentObjectsStillExist < ::PG::DependentPrivilegeDescriptorsStillExist; end
|
1869
|
+
class PG::DependentPrivilegeDescriptorsStillExist < ::PG::ServerError; end
|
1870
|
+
class PG::DiagnosticsException < ::PG::ServerError; end
|
1871
|
+
class PG::DiskFull < ::PG::InsufficientResources; end
|
1872
|
+
class PG::DivisionByZero < ::PG::DataException; end
|
1873
|
+
class PG::DuplicateAlias < ::PG::SyntaxErrorOrAccessRuleViolation; end
|
1874
|
+
class PG::DuplicateColumn < ::PG::SyntaxErrorOrAccessRuleViolation; end
|
1875
|
+
class PG::DuplicateCursor < ::PG::SyntaxErrorOrAccessRuleViolation; end
|
1876
|
+
class PG::DuplicateDatabase < ::PG::SyntaxErrorOrAccessRuleViolation; end
|
1877
|
+
class PG::DuplicateFile < ::PG::SystemError; end
|
1878
|
+
class PG::DuplicateFunction < ::PG::SyntaxErrorOrAccessRuleViolation; end
|
1879
|
+
class PG::DuplicateJsonObjectKeyValue < ::PG::DataException; end
|
1880
|
+
class PG::DuplicateObject < ::PG::SyntaxErrorOrAccessRuleViolation; end
|
1881
|
+
class PG::DuplicatePstatement < ::PG::SyntaxErrorOrAccessRuleViolation; end
|
1882
|
+
class PG::DuplicateSchema < ::PG::SyntaxErrorOrAccessRuleViolation; end
|
1883
|
+
class PG::DuplicateTable < ::PG::SyntaxErrorOrAccessRuleViolation; end
|
1884
|
+
class PG::EREContainingSqlNotPermitted < ::PG::ExternalRoutineException; end
|
1885
|
+
class PG::EREModifyingSqlDataNotPermitted < ::PG::ExternalRoutineException; end
|
1886
|
+
class PG::EREProhibitedSqlStatementAttempted < ::PG::ExternalRoutineException; end
|
1887
|
+
class PG::EREReadingSqlDataNotPermitted < ::PG::ExternalRoutineException; end
|
1888
|
+
class PG::ERIEEventTriggerProtocolViolated < ::PG::ExternalRoutineInvocationException; end
|
1889
|
+
class PG::ERIEInvalidSqlstateReturned < ::PG::ExternalRoutineInvocationException; end
|
1890
|
+
class PG::ERIENullValueNotAllowed < ::PG::ExternalRoutineInvocationException; end
|
1891
|
+
class PG::ERIESrfProtocolViolated < ::PG::ExternalRoutineInvocationException; end
|
1892
|
+
class PG::ERIETriggerProtocolViolated < ::PG::ExternalRoutineInvocationException; end
|
1893
|
+
PG::ERROR_CLASSES = T.let(T.unsafe(nil), Hash)
|
1894
|
+
|
1895
|
+
# source://pg//lib/pg/exceptions.rb#9
|
1896
|
+
class PG::Error < ::StandardError
|
1897
|
+
# @return [Error] a new instance of Error
|
1898
|
+
#
|
1899
|
+
# source://pg//lib/pg/exceptions.rb#10
|
1900
|
+
def initialize(msg = T.unsafe(nil), connection: T.unsafe(nil), result: T.unsafe(nil)); end
|
1901
|
+
|
1902
|
+
def connection; end
|
1903
|
+
def error; end
|
1904
|
+
def result; end
|
1905
|
+
end
|
1906
|
+
|
1907
|
+
class PG::ErrorInAssignment < ::PG::DataException; end
|
1908
|
+
class PG::EscapeCharacterConflict < ::PG::DataException; end
|
1909
|
+
class PG::ExclusionViolation < ::PG::IntegrityConstraintViolation; end
|
1910
|
+
class PG::ExternalRoutineException < ::PG::ServerError; end
|
1911
|
+
class PG::ExternalRoutineInvocationException < ::PG::ServerError; end
|
1912
|
+
class PG::FdwColumnNameNotFound < ::PG::FdwError; end
|
1913
|
+
class PG::FdwDynamicParameterValueNeeded < ::PG::FdwError; end
|
1914
|
+
class PG::FdwError < ::PG::ServerError; end
|
1915
|
+
class PG::FdwFunctionSequenceError < ::PG::FdwError; end
|
1916
|
+
class PG::FdwInconsistentDescriptorInformation < ::PG::FdwError; end
|
1917
|
+
class PG::FdwInvalidAttributeValue < ::PG::FdwError; end
|
1918
|
+
class PG::FdwInvalidColumnName < ::PG::FdwError; end
|
1919
|
+
class PG::FdwInvalidColumnNumber < ::PG::FdwError; end
|
1920
|
+
class PG::FdwInvalidDataType < ::PG::FdwError; end
|
1921
|
+
class PG::FdwInvalidDataTypeDescriptors < ::PG::FdwError; end
|
1922
|
+
class PG::FdwInvalidDescriptorFieldIdentifier < ::PG::FdwError; end
|
1923
|
+
class PG::FdwInvalidHandle < ::PG::FdwError; end
|
1924
|
+
class PG::FdwInvalidOptionIndex < ::PG::FdwError; end
|
1925
|
+
class PG::FdwInvalidOptionName < ::PG::FdwError; end
|
1926
|
+
class PG::FdwInvalidStringFormat < ::PG::FdwError; end
|
1927
|
+
class PG::FdwInvalidStringLengthOrBufferLength < ::PG::FdwError; end
|
1928
|
+
class PG::FdwInvalidUseOfNullPointer < ::PG::FdwError; end
|
1929
|
+
class PG::FdwNoSchemas < ::PG::FdwError; end
|
1930
|
+
class PG::FdwOptionNameNotFound < ::PG::FdwError; end
|
1931
|
+
class PG::FdwOutOfMemory < ::PG::FdwError; end
|
1932
|
+
class PG::FdwReplyHandle < ::PG::FdwError; end
|
1933
|
+
class PG::FdwSchemaNotFound < ::PG::FdwError; end
|
1934
|
+
class PG::FdwTableNotFound < ::PG::FdwError; end
|
1935
|
+
class PG::FdwTooManyHandles < ::PG::FdwError; end
|
1936
|
+
class PG::FdwUnableToCreateExecution < ::PG::FdwError; end
|
1937
|
+
class PG::FdwUnableToCreateReply < ::PG::FdwError; end
|
1938
|
+
class PG::FdwUnableToEstablishConnection < ::PG::FdwError; end
|
1939
|
+
class PG::FeatureNotSupported < ::PG::ServerError; end
|
1940
|
+
class PG::FloatingPointException < ::PG::DataException; end
|
1941
|
+
class PG::ForeignKeyViolation < ::PG::IntegrityConstraintViolation; end
|
1942
|
+
class PG::GeneratedAlways < ::PG::SyntaxErrorOrAccessRuleViolation; end
|
1943
|
+
class PG::GroupingError < ::PG::SyntaxErrorOrAccessRuleViolation; end
|
1944
|
+
class PG::HeldCursorRequiresSameIsolationLevel < ::PG::InvalidTransactionState; end
|
1945
|
+
class PG::IdleInTransactionSessionTimeout < ::PG::InvalidTransactionState; end
|
1946
|
+
class PG::IdleSessionTimeout < ::PG::OperatorIntervention; end
|
1947
|
+
class PG::InFailedSqlTransaction < ::PG::InvalidTransactionState; end
|
1948
|
+
class PG::InappropriateAccessModeForBranchTransaction < ::PG::InvalidTransactionState; end
|
1949
|
+
class PG::InappropriateIsolationLevelForBranchTransaction < ::PG::InvalidTransactionState; end
|
1950
|
+
class PG::IndeterminateCollation < ::PG::SyntaxErrorOrAccessRuleViolation; end
|
1951
|
+
class PG::IndeterminateDatatype < ::PG::SyntaxErrorOrAccessRuleViolation; end
|
1952
|
+
class PG::IndexCorrupted < ::PG::InternalError; end
|
1953
|
+
class PG::IndicatorOverflow < ::PG::DataException; end
|
1954
|
+
class PG::InsufficientPrivilege < ::PG::SyntaxErrorOrAccessRuleViolation; end
|
1955
|
+
class PG::InsufficientResources < ::PG::ServerError; end
|
1956
|
+
class PG::IntegrityConstraintViolation < ::PG::ServerError; end
|
1957
|
+
class PG::InternalError < ::PG::ServerError; end
|
1958
|
+
class PG::IntervalFieldOverflow < ::PG::DataException; end
|
1959
|
+
class PG::InvalidArgumentForLog < ::PG::DataException; end
|
1960
|
+
class PG::InvalidArgumentForNthValue < ::PG::DataException; end
|
1961
|
+
class PG::InvalidArgumentForNtile < ::PG::DataException; end
|
1962
|
+
class PG::InvalidArgumentForPowerFunction < ::PG::DataException; end
|
1963
|
+
class PG::InvalidArgumentForSqlJsonDatetimeFunction < ::PG::DataException; end
|
1964
|
+
class PG::InvalidArgumentForWidthBucketFunction < ::PG::DataException; end
|
1965
|
+
class PG::InvalidAuthorizationSpecification < ::PG::ServerError; end
|
1966
|
+
class PG::InvalidBinaryRepresentation < ::PG::DataException; end
|
1967
|
+
class PG::InvalidCatalogName < ::PG::ServerError; end
|
1968
|
+
class PG::InvalidChangeOfResultFields < ::PG::Error; end
|
1969
|
+
class PG::InvalidCharacterValueForCast < ::PG::DataException; end
|
1970
|
+
class PG::InvalidColumnDefinition < ::PG::SyntaxErrorOrAccessRuleViolation; end
|
1971
|
+
class PG::InvalidColumnReference < ::PG::SyntaxErrorOrAccessRuleViolation; end
|
1972
|
+
class PG::InvalidCursorDefinition < ::PG::SyntaxErrorOrAccessRuleViolation; end
|
1973
|
+
class PG::InvalidCursorName < ::PG::ServerError; end
|
1974
|
+
class PG::InvalidCursorState < ::PG::ServerError; end
|
1975
|
+
class PG::InvalidDatabaseDefinition < ::PG::SyntaxErrorOrAccessRuleViolation; end
|
1976
|
+
class PG::InvalidDatetimeFormat < ::PG::DataException; end
|
1977
|
+
class PG::InvalidEscapeCharacter < ::PG::DataException; end
|
1978
|
+
class PG::InvalidEscapeOctet < ::PG::DataException; end
|
1979
|
+
class PG::InvalidEscapeSequence < ::PG::DataException; end
|
1980
|
+
class PG::InvalidForeignKey < ::PG::SyntaxErrorOrAccessRuleViolation; end
|
1981
|
+
class PG::InvalidFunctionDefinition < ::PG::SyntaxErrorOrAccessRuleViolation; end
|
1982
|
+
class PG::InvalidGrantOperation < ::PG::InvalidGrantor; end
|
1983
|
+
class PG::InvalidGrantor < ::PG::ServerError; end
|
1984
|
+
class PG::InvalidIndicatorParameterValue < ::PG::DataException; end
|
1985
|
+
class PG::InvalidJsonText < ::PG::DataException; end
|
1986
|
+
class PG::InvalidName < ::PG::SyntaxErrorOrAccessRuleViolation; end
|
1987
|
+
class PG::InvalidObjectDefinition < ::PG::SyntaxErrorOrAccessRuleViolation; end
|
1988
|
+
class PG::InvalidParameterValue < ::PG::DataException; end
|
1989
|
+
class PG::InvalidPassword < ::PG::InvalidAuthorizationSpecification; end
|
1990
|
+
class PG::InvalidPrecedingOrFollowingSize < ::PG::DataException; end
|
1991
|
+
class PG::InvalidPstatementDefinition < ::PG::SyntaxErrorOrAccessRuleViolation; end
|
1992
|
+
class PG::InvalidRecursion < ::PG::SyntaxErrorOrAccessRuleViolation; end
|
1993
|
+
class PG::InvalidRegularExpression < ::PG::DataException; end
|
1994
|
+
class PG::InvalidResultStatus < ::PG::Error; end
|
1995
|
+
class PG::InvalidRoleSpecification < ::PG::ServerError; end
|
1996
|
+
class PG::InvalidRowCountInLimitClause < ::PG::DataException; end
|
1997
|
+
class PG::InvalidRowCountInResultOffsetClause < ::PG::DataException; end
|
1998
|
+
class PG::InvalidSchemaDefinition < ::PG::SyntaxErrorOrAccessRuleViolation; end
|
1999
|
+
class PG::InvalidSchemaName < ::PG::ServerError; end
|
2000
|
+
class PG::InvalidSqlJsonSubscript < ::PG::DataException; end
|
2001
|
+
class PG::InvalidSqlStatementName < ::PG::ServerError; end
|
2002
|
+
class PG::InvalidTableDefinition < ::PG::SyntaxErrorOrAccessRuleViolation; end
|
2003
|
+
class PG::InvalidTablesampleArgument < ::PG::DataException; end
|
2004
|
+
class PG::InvalidTablesampleRepeat < ::PG::DataException; end
|
2005
|
+
class PG::InvalidTextRepresentation < ::PG::DataException; end
|
2006
|
+
class PG::InvalidTimeZoneDisplacementValue < ::PG::DataException; end
|
2007
|
+
class PG::InvalidTransactionInitiation < ::PG::ServerError; end
|
2008
|
+
class PG::InvalidTransactionState < ::PG::ServerError; end
|
2009
|
+
class PG::InvalidTransactionTermination < ::PG::ServerError; end
|
2010
|
+
class PG::InvalidUseOfEscapeCharacter < ::PG::DataException; end
|
2011
|
+
class PG::InvalidXmlComment < ::PG::DataException; end
|
2012
|
+
class PG::InvalidXmlContent < ::PG::DataException; end
|
2013
|
+
class PG::InvalidXmlDocument < ::PG::DataException; end
|
2014
|
+
class PG::InvalidXmlProcessingInstruction < ::PG::DataException; end
|
2015
|
+
class PG::IoError < ::PG::SystemError; end
|
2016
|
+
class PG::LEInvalidSpecification < ::PG::LocatorException; end
|
2017
|
+
class PG::LocatorException < ::PG::ServerError; end
|
2018
|
+
class PG::LockFileExists < ::PG::ConfigFileError; end
|
2019
|
+
class PG::LockNotAvailable < ::PG::ObjectNotInPrerequisiteState; end
|
2020
|
+
|
2021
|
+
# source://pg//lib/pg/exceptions.rb#19
|
2022
|
+
class PG::LostCopyState < ::PG::Error; end
|
2023
|
+
|
2024
|
+
class PG::MoreThanOneSqlJsonItem < ::PG::DataException; end
|
2025
|
+
class PG::MostSpecificTypeMismatch < ::PG::DataException; end
|
2026
|
+
class PG::NameTooLong < ::PG::SyntaxErrorOrAccessRuleViolation; end
|
2027
|
+
class PG::NoActiveSqlTransaction < ::PG::InvalidTransactionState; end
|
2028
|
+
class PG::NoActiveSqlTransactionForBranchTransaction < ::PG::InvalidTransactionState; end
|
2029
|
+
class PG::NoDataFound < ::PG::PlpgsqlError; end
|
2030
|
+
class PG::NoResultError < ::PG::Error; end
|
2031
|
+
class PG::NoSqlJsonItem < ::PG::DataException; end
|
2032
|
+
class PG::NonNumericSqlJsonItem < ::PG::DataException; end
|
2033
|
+
class PG::NonUniqueKeysInAJsonObject < ::PG::DataException; end
|
2034
|
+
class PG::NonstandardUseOfEscapeCharacter < ::PG::DataException; end
|
2035
|
+
|
2036
|
+
# source://pg//lib/pg/exceptions.rb#17
|
2037
|
+
class PG::NotAllCopyDataRetrieved < ::PG::Error; end
|
2038
|
+
|
2039
|
+
class PG::NotAnXmlDocument < ::PG::DataException; end
|
2040
|
+
|
2041
|
+
# source://pg//lib/pg/exceptions.rb#21
|
2042
|
+
class PG::NotInBlockingMode < ::PG::Error; end
|
2043
|
+
|
2044
|
+
class PG::NotNullViolation < ::PG::IntegrityConstraintViolation; end
|
2045
|
+
class PG::NullValueNoIndicatorParameter < ::PG::DataException; end
|
2046
|
+
class PG::NullValueNotAllowed < ::PG::DataException; end
|
2047
|
+
class PG::NumericValueOutOfRange < ::PG::DataException; end
|
2048
|
+
class PG::ObjectInUse < ::PG::ObjectNotInPrerequisiteState; end
|
2049
|
+
class PG::ObjectNotInPrerequisiteState < ::PG::ServerError; end
|
2050
|
+
class PG::OperatorIntervention < ::PG::ServerError; end
|
2051
|
+
class PG::OutOfMemory < ::PG::InsufficientResources; end
|
2052
|
+
|
2053
|
+
# source://pg//lib/pg/postgresql_lib_path.rb#2
|
2054
|
+
PG::POSTGRESQL_LIB_PATH = T.let(T.unsafe(nil), String)
|
2055
|
+
|
2056
|
+
class PG::PlpgsqlError < ::PG::ServerError; end
|
2057
|
+
class PG::ProgramLimitExceeded < ::PG::ServerError; end
|
2058
|
+
class PG::ProtocolViolation < ::PG::ConnectionException; end
|
2059
|
+
class PG::QueryCanceled < ::PG::OperatorIntervention; end
|
2060
|
+
class PG::RaiseException < ::PG::PlpgsqlError; end
|
2061
|
+
class PG::ReadOnlySqlTransaction < ::PG::InvalidTransactionState; end
|
2062
|
+
|
2063
|
+
# source://pg//lib/pg/coder.rb#97
|
2064
|
+
class PG::RecordCoder < ::PG::Coder
|
2065
|
+
# source://pg//lib/pg/coder.rb#98
|
2066
|
+
def to_h; end
|
2067
|
+
|
2068
|
+
def type_map; end
|
2069
|
+
def type_map=(_arg0); end
|
2070
|
+
end
|
2071
|
+
|
2072
|
+
class PG::RecordDecoder < ::PG::RecordCoder; end
|
2073
|
+
class PG::RecordEncoder < ::PG::RecordCoder; end
|
2074
|
+
class PG::ReservedName < ::PG::SyntaxErrorOrAccessRuleViolation; end
|
2075
|
+
class PG::RestrictViolation < ::PG::IntegrityConstraintViolation; end
|
2076
|
+
|
2077
|
+
# source://pg//lib/pg/result.rb#7
|
2078
|
+
class PG::Result
|
2079
|
+
include ::Enumerable
|
2080
|
+
include ::PG::Constants
|
2081
|
+
|
2082
|
+
def [](_arg0); end
|
2083
|
+
def autoclear?; end
|
2084
|
+
def check; end
|
2085
|
+
def check_result; end
|
2086
|
+
def clear; end
|
2087
|
+
def cleared?; end
|
2088
|
+
def cmd_status; end
|
2089
|
+
def cmd_tuples; end
|
2090
|
+
def cmdtuples; end
|
2091
|
+
def column_values(_arg0); end
|
2092
|
+
def each; end
|
2093
|
+
def each_row; end
|
2094
|
+
def error_field(_arg0); end
|
2095
|
+
def error_message; end
|
2096
|
+
def fformat(_arg0); end
|
2097
|
+
def field_name_type; end
|
2098
|
+
def field_name_type=(_arg0); end
|
2099
|
+
|
2100
|
+
# Set the data type for all field name returning methods.
|
2101
|
+
#
|
2102
|
+
# +type+: a Symbol defining the field name type.
|
2103
|
+
#
|
2104
|
+
# This method is equal to #field_name_type= , but returns self, so that calls can be chained.
|
2105
|
+
#
|
2106
|
+
# source://pg//lib/pg/result.rb#26
|
2107
|
+
def field_names_as(type); end
|
2108
|
+
|
2109
|
+
def field_values(_arg0); end
|
2110
|
+
def fields; end
|
2111
|
+
def fmod(_arg0); end
|
2112
|
+
def fname(_arg0); end
|
2113
|
+
def fnumber(_arg0); end
|
2114
|
+
def fsize(_arg0); end
|
2115
|
+
def ftable(_arg0); end
|
2116
|
+
def ftablecol(_arg0); end
|
2117
|
+
def ftype(_arg0); end
|
2118
|
+
def getisnull(_arg0, _arg1); end
|
2119
|
+
def getlength(_arg0, _arg1); end
|
2120
|
+
def getvalue(_arg0, _arg1); end
|
2121
|
+
|
2122
|
+
# Return a String representation of the object suitable for debugging.
|
2123
|
+
#
|
2124
|
+
# source://pg//lib/pg/result.rb#32
|
2125
|
+
def inspect; end
|
2126
|
+
|
2127
|
+
# Apply a type map for all value retrieving methods.
|
2128
|
+
#
|
2129
|
+
# +type_map+: a PG::TypeMap instance.
|
2130
|
+
#
|
2131
|
+
# This method is equal to #type_map= , but returns self, so that calls can be chained.
|
2132
|
+
#
|
2133
|
+
# See also PG::BasicTypeMapForResults
|
2134
|
+
#
|
2135
|
+
# source://pg//lib/pg/result.rb#16
|
2136
|
+
def map_types!(type_map); end
|
2137
|
+
|
2138
|
+
def nfields; end
|
2139
|
+
def nparams; end
|
2140
|
+
def ntuples; end
|
2141
|
+
def num_fields; end
|
2142
|
+
def num_tuples; end
|
2143
|
+
def oid_value; end
|
2144
|
+
def paramtype(_arg0); end
|
2145
|
+
def res_status(_arg0); end
|
2146
|
+
def result_error_field(_arg0); end
|
2147
|
+
def result_error_message; end
|
2148
|
+
def result_status; end
|
2149
|
+
def result_verbose_error_message(_arg0, _arg1); end
|
2150
|
+
def stream_each; end
|
2151
|
+
def stream_each_row; end
|
2152
|
+
def stream_each_tuple; end
|
2153
|
+
def tuple(_arg0); end
|
2154
|
+
def tuple_values(_arg0); end
|
2155
|
+
def type_map; end
|
2156
|
+
def type_map=(_arg0); end
|
2157
|
+
def values; end
|
2158
|
+
def verbose_error_message(_arg0, _arg1); end
|
2159
|
+
end
|
2160
|
+
|
2161
|
+
class PG::SEInvalidSpecification < ::PG::SavepointException; end
|
2162
|
+
class PG::SREFunctionExecutedNoReturnStatement < ::PG::SqlRoutineException; end
|
2163
|
+
class PG::SREModifyingSqlDataNotPermitted < ::PG::SqlRoutineException; end
|
2164
|
+
class PG::SREProhibitedSqlStatementAttempted < ::PG::SqlRoutineException; end
|
2165
|
+
class PG::SREReadingSqlDataNotPermitted < ::PG::SqlRoutineException; end
|
2166
|
+
class PG::SavepointException < ::PG::ServerError; end
|
2167
|
+
class PG::SchemaAndDataStatementMixingNotSupported < ::PG::InvalidTransactionState; end
|
2168
|
+
class PG::SequenceGeneratorLimitExceeded < ::PG::DataException; end
|
2169
|
+
class PG::ServerError < ::PG::Error; end
|
2170
|
+
class PG::SimpleCoder < ::PG::Coder; end
|
2171
|
+
class PG::SimpleDecoder < ::PG::SimpleCoder; end
|
2172
|
+
class PG::SimpleEncoder < ::PG::SimpleCoder; end
|
2173
|
+
class PG::SingletonSqlJsonItemRequired < ::PG::DataException; end
|
2174
|
+
class PG::SnapshotTooOld < ::PG::ServerError; end
|
2175
|
+
class PG::SqlJsonArrayNotFound < ::PG::DataException; end
|
2176
|
+
class PG::SqlJsonItemCannotBeCastToTargetType < ::PG::DataException; end
|
2177
|
+
class PG::SqlJsonMemberNotFound < ::PG::DataException; end
|
2178
|
+
class PG::SqlJsonNumberNotFound < ::PG::DataException; end
|
2179
|
+
class PG::SqlJsonObjectNotFound < ::PG::DataException; end
|
2180
|
+
class PG::SqlJsonScalarRequired < ::PG::DataException; end
|
2181
|
+
class PG::SqlRoutineException < ::PG::ServerError; end
|
2182
|
+
class PG::SqlStatementNotYetComplete < ::PG::ServerError; end
|
2183
|
+
class PG::SqlclientUnableToEstablishSqlconnection < ::PG::ConnectionException; end
|
2184
|
+
class PG::SqlserverRejectedEstablishmentOfSqlconnection < ::PG::ConnectionException; end
|
2185
|
+
class PG::StackedDiagnosticsAccessedWithoutActiveHandler < ::PG::DiagnosticsException; end
|
2186
|
+
class PG::StatementTooComplex < ::PG::ProgramLimitExceeded; end
|
2187
|
+
class PG::StringDataLengthMismatch < ::PG::DataException; end
|
2188
|
+
class PG::StringDataRightTruncation < ::PG::DataException; end
|
2189
|
+
class PG::SubstringError < ::PG::DataException; end
|
2190
|
+
class PG::SyntaxError < ::PG::SyntaxErrorOrAccessRuleViolation; end
|
2191
|
+
class PG::SyntaxErrorOrAccessRuleViolation < ::PG::ServerError; end
|
2192
|
+
class PG::SystemError < ::PG::ServerError; end
|
2193
|
+
class PG::TRDeadlockDetected < ::PG::TransactionRollback; end
|
2194
|
+
class PG::TRIntegrityConstraintViolation < ::PG::TransactionRollback; end
|
2195
|
+
class PG::TRSerializationFailure < ::PG::TransactionRollback; end
|
2196
|
+
class PG::TRStatementCompletionUnknown < ::PG::TransactionRollback; end
|
2197
|
+
|
2198
|
+
# source://pg//lib/pg/text_decoder.rb#8
|
2199
|
+
module PG::TextDecoder; end
|
2200
|
+
|
2201
|
+
class PG::TextDecoder::Array < ::PG::CompositeDecoder
|
2202
|
+
def decode(*_arg0); end
|
2203
|
+
end
|
2204
|
+
|
2205
|
+
PG::TextDecoder::Array::CFUNC = T.let(T.unsafe(nil), Object)
|
2206
|
+
|
2207
|
+
class PG::TextDecoder::Boolean < ::PG::SimpleDecoder
|
2208
|
+
def decode(*_arg0); end
|
2209
|
+
end
|
2210
|
+
|
2211
|
+
PG::TextDecoder::Boolean::CFUNC = T.let(T.unsafe(nil), Object)
|
2212
|
+
|
2213
|
+
class PG::TextDecoder::Bytea < ::PG::SimpleDecoder
|
2214
|
+
def decode(*_arg0); end
|
2215
|
+
end
|
2216
|
+
|
2217
|
+
PG::TextDecoder::Bytea::CFUNC = T.let(T.unsafe(nil), Object)
|
2218
|
+
|
2219
|
+
class PG::TextDecoder::CopyRow < ::PG::CopyDecoder
|
2220
|
+
def decode(*_arg0); end
|
2221
|
+
end
|
2222
|
+
|
2223
|
+
PG::TextDecoder::CopyRow::CFUNC = T.let(T.unsafe(nil), Object)
|
2224
|
+
|
2225
|
+
# source://pg//lib/pg/text_decoder.rb#9
|
2226
|
+
class PG::TextDecoder::Date < ::PG::SimpleDecoder
|
2227
|
+
# source://pg//lib/pg/text_decoder.rb#10
|
2228
|
+
def decode(string, tuple = T.unsafe(nil), field = T.unsafe(nil)); end
|
2229
|
+
end
|
2230
|
+
|
2231
|
+
class PG::TextDecoder::Float < ::PG::SimpleDecoder
|
2232
|
+
def decode(*_arg0); end
|
2233
|
+
end
|
2234
|
+
|
2235
|
+
PG::TextDecoder::Float::CFUNC = T.let(T.unsafe(nil), Object)
|
2236
|
+
|
2237
|
+
class PG::TextDecoder::FromBase64 < ::PG::CompositeDecoder
|
2238
|
+
def decode(*_arg0); end
|
2239
|
+
end
|
2240
|
+
|
2241
|
+
PG::TextDecoder::FromBase64::CFUNC = T.let(T.unsafe(nil), Object)
|
2242
|
+
|
2243
|
+
class PG::TextDecoder::Identifier < ::PG::SimpleDecoder
|
2244
|
+
def decode(*_arg0); end
|
2245
|
+
end
|
2246
|
+
|
2247
|
+
PG::TextDecoder::Identifier::CFUNC = T.let(T.unsafe(nil), Object)
|
2248
|
+
|
2249
|
+
class PG::TextDecoder::Inet < ::PG::SimpleDecoder
|
2250
|
+
def decode(*_arg0); end
|
2251
|
+
end
|
2252
|
+
|
2253
|
+
PG::TextDecoder::Inet::CFUNC = T.let(T.unsafe(nil), Object)
|
2254
|
+
|
2255
|
+
class PG::TextDecoder::Integer < ::PG::SimpleDecoder
|
2256
|
+
def decode(*_arg0); end
|
2257
|
+
end
|
2258
|
+
|
2259
|
+
PG::TextDecoder::Integer::CFUNC = T.let(T.unsafe(nil), Object)
|
2260
|
+
|
2261
|
+
# source://pg//lib/pg/text_decoder.rb#19
|
2262
|
+
class PG::TextDecoder::JSON < ::PG::SimpleDecoder
|
2263
|
+
# source://pg//lib/pg/text_decoder.rb#20
|
2264
|
+
def decode(string, tuple = T.unsafe(nil), field = T.unsafe(nil)); end
|
2265
|
+
end
|
2266
|
+
|
2267
|
+
class PG::TextDecoder::Numeric < ::PG::SimpleDecoder
|
2268
|
+
def decode(*_arg0); end
|
2269
|
+
end
|
2270
|
+
|
2271
|
+
PG::TextDecoder::Numeric::CFUNC = T.let(T.unsafe(nil), Object)
|
2272
|
+
|
2273
|
+
class PG::TextDecoder::Record < ::PG::RecordDecoder
|
2274
|
+
def decode(*_arg0); end
|
2275
|
+
end
|
2276
|
+
|
2277
|
+
PG::TextDecoder::Record::CFUNC = T.let(T.unsafe(nil), Object)
|
2278
|
+
|
2279
|
+
class PG::TextDecoder::String < ::PG::SimpleDecoder
|
2280
|
+
def decode(*_arg0); end
|
2281
|
+
end
|
2282
|
+
|
2283
|
+
PG::TextDecoder::String::CFUNC = T.let(T.unsafe(nil), Object)
|
2284
|
+
|
2285
|
+
class PG::TextDecoder::Timestamp < ::PG::SimpleDecoder
|
2286
|
+
def decode(*_arg0); end
|
2287
|
+
end
|
2288
|
+
|
2289
|
+
PG::TextDecoder::Timestamp::CFUNC = T.let(T.unsafe(nil), Object)
|
2290
|
+
|
2291
|
+
# source://pg//lib/pg/text_decoder.rb#36
|
2292
|
+
class PG::TextDecoder::TimestampLocal < ::PG::TextDecoder::Timestamp
|
2293
|
+
# @return [TimestampLocal] a new instance of TimestampLocal
|
2294
|
+
#
|
2295
|
+
# source://pg//lib/pg/text_decoder.rb#37
|
2296
|
+
def initialize(params = T.unsafe(nil)); end
|
2297
|
+
end
|
2298
|
+
|
2299
|
+
# Convenience classes for timezone options
|
2300
|
+
#
|
2301
|
+
# source://pg//lib/pg/text_decoder.rb#26
|
2302
|
+
class PG::TextDecoder::TimestampUtc < ::PG::TextDecoder::Timestamp
|
2303
|
+
# @return [TimestampUtc] a new instance of TimestampUtc
|
2304
|
+
#
|
2305
|
+
# source://pg//lib/pg/text_decoder.rb#27
|
2306
|
+
def initialize(params = T.unsafe(nil)); end
|
2307
|
+
end
|
2308
|
+
|
2309
|
+
# source://pg//lib/pg/text_decoder.rb#31
|
2310
|
+
class PG::TextDecoder::TimestampUtcToLocal < ::PG::TextDecoder::Timestamp
|
2311
|
+
# @return [TimestampUtcToLocal] a new instance of TimestampUtcToLocal
|
2312
|
+
#
|
2313
|
+
# source://pg//lib/pg/text_decoder.rb#32
|
2314
|
+
def initialize(params = T.unsafe(nil)); end
|
2315
|
+
end
|
2316
|
+
|
2317
|
+
# source://pg//lib/pg/text_decoder.rb#44
|
2318
|
+
PG::TextDecoder::TimestampWithTimeZone = PG::TextDecoder::Timestamp
|
2319
|
+
|
2320
|
+
# For backward compatibility:
|
2321
|
+
#
|
2322
|
+
# source://pg//lib/pg/text_decoder.rb#43
|
2323
|
+
PG::TextDecoder::TimestampWithoutTimeZone = PG::TextDecoder::TimestampLocal
|
2324
|
+
|
2325
|
+
# source://pg//lib/pg/text_encoder.rb#8
|
2326
|
+
module PG::TextEncoder; end
|
2327
|
+
|
2328
|
+
class PG::TextEncoder::Array < ::PG::CompositeEncoder
|
2329
|
+
def encode(*_arg0); end
|
2330
|
+
end
|
2331
|
+
|
2332
|
+
PG::TextEncoder::Array::CFUNC = T.let(T.unsafe(nil), Object)
|
2333
|
+
|
2334
|
+
class PG::TextEncoder::Boolean < ::PG::SimpleEncoder
|
2335
|
+
def encode(*_arg0); end
|
2336
|
+
end
|
2337
|
+
|
2338
|
+
PG::TextEncoder::Boolean::CFUNC = T.let(T.unsafe(nil), Object)
|
2339
|
+
|
2340
|
+
class PG::TextEncoder::Bytea < ::PG::SimpleEncoder
|
2341
|
+
def encode(*_arg0); end
|
2342
|
+
end
|
2343
|
+
|
2344
|
+
PG::TextEncoder::Bytea::CFUNC = T.let(T.unsafe(nil), Object)
|
2345
|
+
|
2346
|
+
class PG::TextEncoder::CopyRow < ::PG::CopyEncoder
|
2347
|
+
def encode(*_arg0); end
|
2348
|
+
end
|
2349
|
+
|
2350
|
+
PG::TextEncoder::CopyRow::CFUNC = T.let(T.unsafe(nil), Object)
|
2351
|
+
|
2352
|
+
# source://pg//lib/pg/text_encoder.rb#9
|
2353
|
+
class PG::TextEncoder::Date < ::PG::SimpleEncoder
|
2354
|
+
# source://pg//lib/pg/text_encoder.rb#10
|
2355
|
+
def encode(value); end
|
2356
|
+
end
|
2357
|
+
|
2358
|
+
class PG::TextEncoder::Float < ::PG::SimpleEncoder
|
2359
|
+
def encode(*_arg0); end
|
2360
|
+
end
|
2361
|
+
|
2362
|
+
PG::TextEncoder::Float::CFUNC = T.let(T.unsafe(nil), Object)
|
2363
|
+
|
2364
|
+
class PG::TextEncoder::Identifier < ::PG::SimpleEncoder
|
2365
|
+
def encode(*_arg0); end
|
2366
|
+
end
|
2367
|
+
|
2368
|
+
PG::TextEncoder::Identifier::CFUNC = T.let(T.unsafe(nil), Object)
|
2369
|
+
|
2370
|
+
# source://pg//lib/pg/text_encoder.rb#39
|
2371
|
+
class PG::TextEncoder::Inet < ::PG::SimpleEncoder
|
2372
|
+
# source://pg//lib/pg/text_encoder.rb#40
|
2373
|
+
def encode(value); end
|
2374
|
+
end
|
2375
|
+
|
2376
|
+
class PG::TextEncoder::Integer < ::PG::SimpleEncoder
|
2377
|
+
def encode(*_arg0); end
|
2378
|
+
end
|
2379
|
+
|
2380
|
+
PG::TextEncoder::Integer::CFUNC = T.let(T.unsafe(nil), Object)
|
2381
|
+
|
2382
|
+
# source://pg//lib/pg/text_encoder.rb#33
|
2383
|
+
class PG::TextEncoder::JSON < ::PG::SimpleEncoder
|
2384
|
+
# source://pg//lib/pg/text_encoder.rb#34
|
2385
|
+
def encode(value); end
|
2386
|
+
end
|
2387
|
+
|
2388
|
+
class PG::TextEncoder::Numeric < ::PG::SimpleEncoder
|
2389
|
+
def encode(*_arg0); end
|
2390
|
+
end
|
2391
|
+
|
2392
|
+
PG::TextEncoder::Numeric::CFUNC = T.let(T.unsafe(nil), Object)
|
2393
|
+
|
2394
|
+
class PG::TextEncoder::QuotedLiteral < ::PG::CompositeEncoder
|
2395
|
+
def encode(*_arg0); end
|
2396
|
+
end
|
2397
|
+
|
2398
|
+
PG::TextEncoder::QuotedLiteral::CFUNC = T.let(T.unsafe(nil), Object)
|
2399
|
+
|
2400
|
+
class PG::TextEncoder::Record < ::PG::RecordEncoder
|
2401
|
+
def encode(*_arg0); end
|
2402
|
+
end
|
2403
|
+
|
2404
|
+
PG::TextEncoder::Record::CFUNC = T.let(T.unsafe(nil), Object)
|
2405
|
+
|
2406
|
+
class PG::TextEncoder::String < ::PG::SimpleEncoder
|
2407
|
+
def encode(*_arg0); end
|
2408
|
+
end
|
2409
|
+
|
2410
|
+
PG::TextEncoder::String::CFUNC = T.let(T.unsafe(nil), Object)
|
2411
|
+
|
2412
|
+
# source://pg//lib/pg/text_encoder.rb#21
|
2413
|
+
class PG::TextEncoder::TimestampUtc < ::PG::SimpleEncoder
|
2414
|
+
# source://pg//lib/pg/text_encoder.rb#22
|
2415
|
+
def encode(value); end
|
2416
|
+
end
|
2417
|
+
|
2418
|
+
# source://pg//lib/pg/text_encoder.rb#27
|
2419
|
+
class PG::TextEncoder::TimestampWithTimeZone < ::PG::SimpleEncoder
|
2420
|
+
# source://pg//lib/pg/text_encoder.rb#28
|
2421
|
+
def encode(value); end
|
2422
|
+
end
|
2423
|
+
|
2424
|
+
# source://pg//lib/pg/text_encoder.rb#15
|
2425
|
+
class PG::TextEncoder::TimestampWithoutTimeZone < ::PG::SimpleEncoder
|
2426
|
+
# source://pg//lib/pg/text_encoder.rb#16
|
2427
|
+
def encode(value); end
|
2428
|
+
end
|
2429
|
+
|
2430
|
+
class PG::TextEncoder::ToBase64 < ::PG::CompositeEncoder
|
2431
|
+
def encode(*_arg0); end
|
2432
|
+
end
|
2433
|
+
|
2434
|
+
PG::TextEncoder::ToBase64::CFUNC = T.let(T.unsafe(nil), Object)
|
2435
|
+
class PG::TooManyArguments < ::PG::ProgramLimitExceeded; end
|
2436
|
+
class PG::TooManyColumns < ::PG::ProgramLimitExceeded; end
|
2437
|
+
class PG::TooManyConnections < ::PG::InsufficientResources; end
|
2438
|
+
class PG::TooManyJsonArrayElements < ::PG::DataException; end
|
2439
|
+
class PG::TooManyJsonObjectMembers < ::PG::DataException; end
|
2440
|
+
class PG::TooManyRows < ::PG::PlpgsqlError; end
|
2441
|
+
class PG::TransactionResolutionUnknown < ::PG::ConnectionException; end
|
2442
|
+
class PG::TransactionRollback < ::PG::ServerError; end
|
2443
|
+
class PG::TriggeredActionException < ::PG::ServerError; end
|
2444
|
+
class PG::TriggeredDataChangeViolation < ::PG::ServerError; end
|
2445
|
+
class PG::TrimError < ::PG::DataException; end
|
2446
|
+
|
2447
|
+
# source://pg//lib/pg/tuple.rb#7
|
2448
|
+
class PG::Tuple
|
2449
|
+
include ::Enumerable
|
2450
|
+
|
2451
|
+
def [](_arg0); end
|
2452
|
+
def each; end
|
2453
|
+
|
2454
|
+
# source://pg//lib/pg/tuple.rb#23
|
2455
|
+
def each_key(&block); end
|
2456
|
+
|
2457
|
+
def each_value; end
|
2458
|
+
def fetch(*_arg0); end
|
2459
|
+
|
2460
|
+
# @return [Boolean]
|
2461
|
+
#
|
2462
|
+
# source://pg//lib/pg/tuple.rb#14
|
2463
|
+
def has_key?(key); end
|
2464
|
+
|
2465
|
+
def index(_arg0); end
|
2466
|
+
|
2467
|
+
# Return a String representation of the object suitable for debugging.
|
2468
|
+
#
|
2469
|
+
# source://pg//lib/pg/tuple.rb#10
|
2470
|
+
def inspect; end
|
2471
|
+
|
2472
|
+
# @return [Boolean]
|
2473
|
+
#
|
2474
|
+
# source://pg//lib/pg/tuple.rb#14
|
2475
|
+
def key?(key); end
|
2476
|
+
|
2477
|
+
# source://pg//lib/pg/tuple.rb#19
|
2478
|
+
def keys; end
|
2479
|
+
|
2480
|
+
def length; end
|
2481
|
+
def size; end
|
2482
|
+
def values; end
|
2483
|
+
|
2484
|
+
private
|
2485
|
+
|
2486
|
+
def field_map; end
|
2487
|
+
def field_names; end
|
2488
|
+
def marshal_dump; end
|
2489
|
+
def marshal_load(_arg0); end
|
2490
|
+
end
|
2491
|
+
|
2492
|
+
class PG::TypeMap; end
|
2493
|
+
|
2494
|
+
module PG::TypeMap::DefaultTypeMappable
|
2495
|
+
def default_type_map; end
|
2496
|
+
def default_type_map=(_arg0); end
|
2497
|
+
def with_default_type_map(_arg0); end
|
2498
|
+
end
|
2499
|
+
|
2500
|
+
class PG::TypeMapAllStrings < ::PG::TypeMap; end
|
2501
|
+
|
2502
|
+
class PG::TypeMapByClass < ::PG::TypeMap
|
2503
|
+
include ::PG::TypeMap::DefaultTypeMappable
|
2504
|
+
|
2505
|
+
def [](_arg0); end
|
2506
|
+
def []=(_arg0, _arg1); end
|
2507
|
+
def coders; end
|
2508
|
+
end
|
2509
|
+
|
2510
|
+
# source://pg//lib/pg/type_map_by_column.rb#6
|
2511
|
+
class PG::TypeMapByColumn < ::PG::TypeMap
|
2512
|
+
include ::PG::TypeMap::DefaultTypeMappable
|
2513
|
+
|
2514
|
+
def initialize(_arg0); end
|
2515
|
+
|
2516
|
+
def coders; end
|
2517
|
+
|
2518
|
+
# source://pg//lib/pg/type_map_by_column.rb#12
|
2519
|
+
def inspect; end
|
2520
|
+
|
2521
|
+
# Returns the type oids of the assigned coders.
|
2522
|
+
#
|
2523
|
+
# source://pg//lib/pg/type_map_by_column.rb#8
|
2524
|
+
def oids; end
|
2525
|
+
end
|
2526
|
+
|
2527
|
+
class PG::TypeMapByMriType < ::PG::TypeMap
|
2528
|
+
include ::PG::TypeMap::DefaultTypeMappable
|
2529
|
+
|
2530
|
+
def [](_arg0); end
|
2531
|
+
def []=(_arg0, _arg1); end
|
2532
|
+
def coders; end
|
2533
|
+
end
|
2534
|
+
|
2535
|
+
class PG::TypeMapByOid < ::PG::TypeMap
|
2536
|
+
include ::PG::TypeMap::DefaultTypeMappable
|
2537
|
+
|
2538
|
+
def add_coder(_arg0); end
|
2539
|
+
def build_column_map(_arg0); end
|
2540
|
+
def coders; end
|
2541
|
+
def max_rows_for_online_lookup; end
|
2542
|
+
def max_rows_for_online_lookup=(_arg0); end
|
2543
|
+
def rm_coder(_arg0, _arg1); end
|
2544
|
+
end
|
2545
|
+
|
2546
|
+
class PG::TypeMapInRuby < ::PG::TypeMap
|
2547
|
+
include ::PG::TypeMap::DefaultTypeMappable
|
2548
|
+
|
2549
|
+
def typecast_copy_get(_arg0, _arg1, _arg2, _arg3); end
|
2550
|
+
def typecast_query_param(_arg0, _arg1); end
|
2551
|
+
def typecast_result_value(_arg0, _arg1, _arg2); end
|
2552
|
+
end
|
2553
|
+
|
2554
|
+
class PG::UnableToSend < ::PG::Error; end
|
2555
|
+
class PG::UndefinedColumn < ::PG::SyntaxErrorOrAccessRuleViolation; end
|
2556
|
+
class PG::UndefinedFile < ::PG::SystemError; end
|
2557
|
+
class PG::UndefinedFunction < ::PG::SyntaxErrorOrAccessRuleViolation; end
|
2558
|
+
class PG::UndefinedObject < ::PG::SyntaxErrorOrAccessRuleViolation; end
|
2559
|
+
class PG::UndefinedParameter < ::PG::SyntaxErrorOrAccessRuleViolation; end
|
2560
|
+
class PG::UndefinedTable < ::PG::SyntaxErrorOrAccessRuleViolation; end
|
2561
|
+
class PG::UniqueViolation < ::PG::IntegrityConstraintViolation; end
|
2562
|
+
class PG::UnsafeNewEnumValueUsage < ::PG::ObjectNotInPrerequisiteState; end
|
2563
|
+
class PG::UnterminatedCString < ::PG::DataException; end
|
2564
|
+
class PG::UntranslatableCharacter < ::PG::DataException; end
|
2565
|
+
|
2566
|
+
# Library version
|
2567
|
+
#
|
2568
|
+
# source://pg//lib/pg/version.rb#3
|
2569
|
+
PG::VERSION = T.let(T.unsafe(nil), String)
|
2570
|
+
|
2571
|
+
class PG::WindowingError < ::PG::SyntaxErrorOrAccessRuleViolation; end
|
2572
|
+
class PG::WithCheckOptionViolation < ::PG::ServerError; end
|
2573
|
+
class PG::WrongObjectType < ::PG::SyntaxErrorOrAccessRuleViolation; end
|
2574
|
+
class PG::ZeroLengthCharacterString < ::PG::DataException; end
|