Module: Sequel::Postgres

Defined in:
lib/sequel/adapters/shared/postgres.rb,
lib/sequel/adapters/postgres.rb,
lib/sequel/extensions/pg_row.rb,
lib/sequel/extensions/pg_enum.rb,
lib/sequel/extensions/pg_inet.rb,
lib/sequel/extensions/pg_json.rb,
lib/sequel/extensions/pg_array.rb,
lib/sequel/extensions/pg_range.rb,
lib/sequel/extensions/pg_hstore.rb,
lib/sequel/extensions/pg_row_ops.rb,
lib/sequel/extensions/pg_inet_ops.rb,
lib/sequel/extensions/pg_interval.rb,
lib/sequel/extensions/pg_json_ops.rb,
lib/sequel/extensions/pg_array_ops.rb,
lib/sequel/extensions/pg_range_ops.rb,
lib/sequel/extensions/pg_hstore_ops.rb,
lib/sequel/extensions/pg_loose_count.rb,
lib/sequel/extensions/pg_timestamptz.rb,
lib/sequel/extensions/pg_static_cache_updater.rb,
lib/sequel/extensions/pg_extended_date_support.rb

Overview

Top level module for holding all PostgreSQL-related modules and classes for Sequel. All adapters that connect to PostgreSQL support the following options:

:client_min_messages

Change the minimum level of messages that PostgreSQL will send to the the client. The PostgreSQL default is NOTICE, the Sequel default is WARNING. Set to nil to not change the server default. Overridable on a per instance basis via the :client_min_messages option.

:force_standard_strings

Set to false to not force the use of standard strings. Overridable on a per instance basis via the :force_standard_strings option.

:search_path

Set the schema search_path for this Database's connections. Allows to to set which schemas do not need explicit qualification, and in which order to check the schemas when an unqualified object is referenced.

Defined Under Namespace

Modules: ArrayOpMethods, DatabaseMethods, DatasetMethods, EnumDatabaseMethods, ExtendedDateSupport, HStoreOpMethods, InetDatabaseMethods, InetDatasetMethods, InetOpMethods, IntervalDatabaseMethods, IntervalDatasetMethods, JSONBObject, JSONDatabaseMethods, JSONObject, JSONOpMethods, LooseCount, MockAdapterDatabaseMethods, PGRow, RangeOpMethods, StaticCacheUpdater, Timestamptz Classes: Adapter, AlterTableGenerator, ArrayOp, CreatePartitionOfTableGenerator, CreateTableGenerator, Database, Dataset, ExclusionConstraintViolation, HStore, HStoreOp, InetOp, JSONArray, JSONBArray, JSONBHash, JSONBOp, JSONBaseOp, JSONHash, JSONOp, PGArray, PGRange, PGRowOp, RangeOp

Constant Summary collapse

JSON_WRAPPER_MAPPING =
{
  ::Array => JSONArray,
  ::Hash => JSONHash,
}.freeze
JSONB_WRAPPER_MAPPING =
{
  ::Array => JSONBArray,
  ::Hash => JSONBHash,
}.freeze
JSON_PRIMITIVE_WRAPPER_MAPPING =
{
  ::String => JSONString,
  ::Integer => JSONInteger,
  ::Float => JSONFloat,
  ::NilClass => JSONNull,
  ::TrueClass => JSONTrue,
  ::FalseClass => JSONFalse,
}
JSONB_PRIMITIVE_WRAPPER_MAPPING =
{
  ::String => JSONBString,
  ::Integer => JSONBInteger,
  ::Float => JSONBFloat,
  ::NilClass => JSONBNull,
  ::TrueClass => JSONBTrue,
  ::FalseClass => JSONBFalse,
}
JSON_COMBINED_WRAPPER_MAPPING =
JSON_WRAPPER_MAPPING.merge(JSON_PRIMITIVE_WRAPPER_MAPPING).freeze
JSONB_COMBINED_WRAPPER_MAPPING =
JSONB_WRAPPER_MAPPING.merge(JSONB_PRIMITIVE_WRAPPER_MAPPING).freeze
JSONB_WRAP_CLASSES =
JSONB_COMBINED_WRAPPER_MAPPING.keys.freeze
JSON_WRAP_CLASSES =
[Hash, Array, String, Integer, Float, NilClass, TrueClass, FalseClass].freeze
NAN =
0.0/0.0
PLUS_INFINITY =
1.0/0.0
MINUS_INFINITY =
-1.0/0.0
TYPE_TRANSLATOR_DATE =
date.freeze
CONVERSION_PROCS =
{}

Class Method Summary collapse

Class Method Details

.mock_adapter_setup(db) ⇒ Object


88
89
90
91
92
93
94
# File 'lib/sequel/adapters/shared/postgres.rb', line 88

def self.mock_adapter_setup(db)
  db.instance_exec do
    @server_version = 90500
    initialize_postgres_adapter
    extend(MockAdapterDatabaseMethods)
  end
end

.sequel_pg_version_supported?(version) ⇒ Boolean

Whether the given sequel_pg version integer is supported.

Returns:

  • (Boolean)

37
38
39
# File 'lib/sequel/adapters/postgres.rb', line 37

def self.sequel_pg_version_supported?(version)
  version >= 10617
end