Arr

skunk.data.Arr
See theArr companion object
final class Arr[A]

A Postgres array, which is either empty and zero-dimensional, or non-empty and rectangular (unlike Scala Arrays, which are ragged) with a postive number of dimensions (all non-empty). Arr is a traversable functor.

Attributes

Companion
object
Source
Arr.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Grouped members

Transformation

def reshape(dimensions: Int*): Option[Arr[A]]

Attempt to reshape this Arr with the specified dimensions.

Attempt to reshape this Arr with the specified dimensions. This is possible if and only if dimensions factorize size. O(1).

Attributes

Source
Arr.scala

Accessors

def dimensions: List[Int]

Size of this Arr by dimension.

Size of this Arr by dimension. Invariant: if this Arr is non-empty then dimensions.product equals size.

Attributes

Source
Arr.scala
def get(ords: Int*): Option[A]

Retrieve the element at the specified location, if the ordinates are in range (i.e., between zero and the corresponding entry in dimensions).

Retrieve the element at the specified location, if the ordinates are in range (i.e., between zero and the corresponding entry in dimensions).

Attributes

Source
Arr.scala
def size: Int

Total number of elements in this Arr.

Total number of elements in this Arr.

Attributes

Source
Arr.scala

Encoding

def encode(f: A => String, delim: Char): String

Encode this Arr into a Postgres array literal, using f to encode the values (which will be quoted and escaped as needed) and the given delimiter (specified in pg_type but almost always a comma).

Encode this Arr into a Postgres array literal, using f to encode the values (which will be quoted and escaped as needed) and the given delimiter (specified in pg_type but almost always a comma).

Attributes

Source
Arr.scala

Value members

Concrete methods

def flattenTo[C](fact: Factory[A, C]): C

Construct this Arr's elements as a collection C, as if first reshaped to be single-dimensional.

Construct this Arr's elements as a collection C, as if first reshaped to be single-dimensional.

Attributes

Source
Arr.scala
def isEmpty: Boolean

True if this Arr is empty.

True if this Arr is empty. Invariant: isEmpty == dimensions.isEmpty.

Attributes

Source
Arr.scala
override def toString: String

Approximation of the equivalent Postgres array literal, for debugging only.

Approximation of the equivalent Postgres array literal, for debugging only.

Attributes

Definition Classes
Any
Source
Arr.scala