Class List Method List File List

# Class: VertxMysqlPostgresql::PostgreSQLClient

Inherits:
  AsyncSQLClient
  - Object
  - AsyncSQLClient
  - VertxMysqlPostgresql::PostgreSQLClient
  show all
Defined in:
  /Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mysql-postgresql/postgre_sql_client.rb

## Overview

Represents an PostgreSQL client

## Class Method Summary (collapse)

- + (::VertxMysqlPostgresql::AsyncSQLClient) create_non_shared(vertx = nil, config = nil)
  Create a PostgreSQL client which maintains its own pool.
- + (::VertxMysqlPostgresql::AsyncSQLClient) create_shared(vertx = nil, config = nil, poolName = nil)
  Create a PostgreSQL client which shares its pool with any other MySQL clients created with the same pool name.

### Methods inherited from AsyncSQLClient

#close, #get_connection

## Class Method Details

### + (`::VertxMysqlPostgresql::AsyncSQLClient`) create_non_shared(vertx = nil, config = nil)

Create a PostgreSQL client which maintains its own pool.

Parameters:

- vertx (`::Vertx::Vertx`) (defaults to: `nil`) —
  the Vert.x instance
- config (`Hash{String => Object}`) (defaults to: `nil`) —
  the configuration

Returns:

- (`::VertxMysqlPostgresql::AsyncSQLClient`) —
  the client

Raises:

- (`ArgumentError`)

    23
    24
    25
    26
    27
    28
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mysql-postgresql/postgre_sql_client.rb', line 23

    def self.create_non_shared(vertx=nil,config=nil)
      if vertx.class.method_defined?(:j_del) && config.class == Hash && !block_given?
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtAsyncsql::PostgreSQLClient.java_method(:createNonShared, [Java::IoVertxCore::Vertx.java_class,Java::IoVertxCoreJson::JsonObject.java_class]).call(vertx.j_del,::Vertx::Util::Utils.to_json_object(config)),::VertxMysqlPostgresql::AsyncSQLClient)
      end
      raise ArgumentError, "Invalid arguments when calling create_non_shared(vertx,config)"
    end

### + (`::VertxMysqlPostgresql::AsyncSQLClient`) create_shared(vertx = nil, config = nil, poolName = nil)

Create a PostgreSQL client which shares its pool with any other MySQL clients created with the same pool name.

Parameters:

- vertx (`::Vertx::Vertx`) (defaults to: `nil`) —
  the Vert.x instance
- config (`Hash{String => Object}`) (defaults to: `nil`) —
  the configuration
- poolName (`String`) (defaults to: `nil`) —
  the pool name

Returns:

- (`::VertxMysqlPostgresql::AsyncSQLClient`) —
  the client

Raises:

- (`ArgumentError`)

    34
    35
    36
    37
    38
    39
    40
    41
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mysql-postgresql/postgre_sql_client.rb', line 34

    def self.create_shared(vertx=nil,config=nil,poolName=nil)
      if vertx.class.method_defined?(:j_del) && config.class == Hash && !block_given? && poolName == nil
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtAsyncsql::PostgreSQLClient.java_method(:createShared, [Java::IoVertxCore::Vertx.java_class,Java::IoVertxCoreJson::JsonObject.java_class]).call(vertx.j_del,::Vertx::Util::Utils.to_json_object(config)),::VertxMysqlPostgresql::AsyncSQLClient)
      elsif vertx.class.method_defined?(:j_del) && config.class == Hash && poolName.class == String && !block_given?
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtAsyncsql::PostgreSQLClient.java_method(:createShared, [Java::IoVertxCore::Vertx.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::java.lang.String.java_class]).call(vertx.j_del,::Vertx::Util::Utils.to_json_object(config),poolName),::VertxMysqlPostgresql::AsyncSQLClient)
      end
      raise ArgumentError, "Invalid arguments when calling create_shared(vertx,config,poolName)"
    end