Class: ReactivePgClient::PgResult

Inherits:
Object
  • Object
show all
Defined in:
/Users/julien/java/reactive-pg-client/target/classes/reactive-pg-client/pg_result.rb

Overview

Represents the result of an operation on database.

Direct Known Subclasses

PgRowSet

Instance Method Summary (collapse)

Instance Method Details

- (Array<String>) columns_names

Get the names of columns in the PgResult.

Returns:

  • (Array<String>)
    the list of names of columns.

Raises:

  • (ArgumentError)


35
36
37
38
39
40
# File '/Users/julien/java/reactive-pg-client/target/classes/reactive-pg-client/pg_result.rb', line 35

def columns_names
  if !block_given?
    return @j_del.java_method(:columnsNames, []).call().to_a.map { |elt| elt }
  end
  raise ArgumentError, "Invalid arguments when calling columns_names()"
end

- (::ReactivePgClient::PgResult) next

Return the next available result or null, e.g for a simple query that executed multiple queries or for a batch result.

Returns:

Raises:

  • (ArgumentError)


60
61
62
63
64
65
# File '/Users/julien/java/reactive-pg-client/target/classes/reactive-pg-client/pg_result.rb', line 60

def next
  if !block_given?
    return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:next, []).call(),::ReactivePgClient::PgResult, nil)
  end
  raise ArgumentError, "Invalid arguments when calling next()"
end

- (Fixnum) row_count

Get the number of the affected rows in the operation to this PgResult.

The meaning depends on the executed statement:

  • INSERT: the number of rows inserted
  • DELETE: the number of rows deleted
  • UPDATE: the number of rows updated
  • SELECT: the number of rows retrieved

Returns:

  • (Fixnum)
    the count of affected rows.

Raises:

  • (ArgumentError)


27
28
29
30
31
32
# File '/Users/julien/java/reactive-pg-client/target/classes/reactive-pg-client/pg_result.rb', line 27

def row_count
  if !block_given?
    return @j_del.java_method(:rowCount, []).call()
  end
  raise ArgumentError, "Invalid arguments when calling row_count()"
end

- (Fixnum) size

Get the number of rows in the PgResult.

Returns:

  • (Fixnum)
    the count of rows.

Raises:

  • (ArgumentError)


43
44
45
46
47
48
# File '/Users/julien/java/reactive-pg-client/target/classes/reactive-pg-client/pg_result.rb', line 43

def size
  if !block_given?
    return @j_del.java_method(:size, []).call()
  end
  raise ArgumentError, "Invalid arguments when calling size()"
end

- (Object) value

Get the result value.

Returns:

  • (Object)
    the result

Raises:

  • (ArgumentError)


51
52
53
54
55
56
# File '/Users/julien/java/reactive-pg-client/target/classes/reactive-pg-client/pg_result.rb', line 51

def value
  if !block_given?
    return @j_arg_T.wrap(@j_del.java_method(:value, []).call())
  end
  raise ArgumentError, "Invalid arguments when calling value()"
end