Class List Method List File List

# Class: VertxMysqlPostgresql::MySQLClient

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

## Overview

Represents an asynchronous MySQL client

## Class Method Summary (collapse)

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

### Methods inherited from AsyncSQLClient

#close, #get_connection

## Class Method Details

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

Create a MySQL 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/my_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::MySQLClient.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 MySQL client which shares its data source with any other MySQL clients created with the same data source 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`)

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

    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::MySQLClient.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::MySQLClient.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