Class: PGconn

Class | PGconn
In: | lib/sequel/adapters/postgres.rb
Parent: | Object

Attempt to get uniform behavior for the PGconn object no matter if pg, postgres, or postgres-pr is used.

### Methods

block escape_bytea escape_bytea escape_bytea escape_string escape_string status unescape_bytea

### Constants

CONNECTION_OK | = | -1

### External Aliases

decode_bytea | -> | unescape_bytea
close | -> | finish
exec | -> | async_exec

### Public Class methods

unescape_bytea(obj)

If no valid bytea unescaping method can be found, create one that raises an error

[Source]

        # File lib/sequel/adapters/postgres.rb, line 53
    53:             def self.unescape_bytea(obj)
    54:               raise Sequel::Error, "bytea unescaping not supported with this postgres driver.  Try using ruby-pg, ruby-postgres, or postgres-pr."
    55:             end

### Public Instance methods

block(timeout=nil)

[Source]

        # File lib/sequel/adapters/postgres.rb, line 62
    62:         def block(timeout=nil)
    63:         end

escape_bytea(obj)

If there is no escape_bytea instance method, but there is an escape_bytea class method, use that instead.

[Source]

        # File lib/sequel/adapters/postgres.rb, line 31
    31:           def escape_bytea(obj)
    32:             self.class.escape_bytea(obj)
    33:           end

escape_bytea(obj)

If no valid bytea escaping method can be found, create one that raises an error

[Source]

        # File lib/sequel/adapters/postgres.rb, line 48
    48:             def escape_bytea(obj)
    49:               raise Sequel::Error, "bytea escaping not supported with this postgres driver.  Try using ruby-pg, ruby-postgres, or postgres-pr."
    50:             end

escape_bytea(obj)

If we are using postgres-pr, use the encode_bytea method from that.

[Source]

        # File lib/sequel/adapters/postgres.rb, line 41
    41:             def escape_bytea(obj)
    42:               self.class.encode_bytea(obj)
    43:             end

escape_string(str)

If there is no escape_string instead method, but there is an escape class method, use that instead.

[Source]

        # File lib/sequel/adapters/postgres.rb, line 17
    17:           def escape_string(str)
    18:             Sequel::Postgres.force_standard_strings ? str.gsub("'", "''") : self.class.escape(str)
    19:           end

escape_string(obj)

Raise an error if no valid string escaping method can be found.

[Source]

        # File lib/sequel/adapters/postgres.rb, line 22
    22:           def escape_string(obj)
    23:             raise Sequel::Error, "string escaping not supported with this postgres driver.  Try using ruby-pg, ruby-postgres, or postgres-pr."
    24:           end

status()

[Source]

        # File lib/sequel/adapters/postgres.rb, line 69
    69:         def status
    70:           CONNECTION_OK
    71:         end

[Validate]