p

meteor

package meteor

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. Protected

Package Members

  1. package api
  2. package codec

Type Members

  1. trait Client[F[_]] extends AnyRef

    Low level client that can perform AWS DynamoDB table and item actions.

    Low level client that can perform AWS DynamoDB table and item actions. It provides methods that resemble DynamoDB's API, consider using high level API tables from meteor.api.hi package instead. This is still useful to: create, delete and scan table.

  2. trait DynamoDbType extends AnyRef

    Represent DynamoDB primitive data types, including BOOL, B, BS, L, M, N, NS, NULL, S and SS.

  3. case class Expression(expression: String, attributeNames: Map[String, String], attributeValues: Map[String, AttributeValue]) extends Product with Serializable

    Abstraction over DynamoDB expressions, this can be key condition expression, update expression, projection expression etc..

    Abstraction over DynamoDB expressions, this can be key condition expression, update expression, projection expression etc.. https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.html.

    It is recommended to avoid DynamoDB's reserved words in expression string by providing expression as raw String with attribute names and values as placeholders only. Attribute names and values can then be replaced separately via attributeNames and attributeValues maps.

    Example:

    import meteor.Expression
    import meteor.syntax._
    
    Expression(
      "#b = :my_bool and #i > :my_int",
      Map("#b" -> "my_bool_attribute_name", "#i" -> "my_int_attribute_name"),
      Map(
        ":my_bool" -> true.asAttributeValue,
        ":my_int" -> 0.asAttributeValue
      )
    )
    expression

    expression as raw String

    attributeNames

    a map of attribute name placeholders in the raw String above to the actual attribute names in the table

    attributeValues

    a map of attribute value placeholders in the raw String above to the actual attribute values

  4. case class KeyDef[K](attributeName: String, attributeType: DynamoDbType) extends Product with Serializable

    Key's definition, a representation of DynamoDB's key.

    Key's definition, a representation of DynamoDB's key.

    K

    key's type

    attributeName

    attribute's name

    attributeType

    attribute's type

  5. case class Query[P, S](partitionKey: P, sortKeyQuery: SortKeyQuery[S], filter: Expression)(implicit evidence$7: Encoder[P], evidence$8: Encoder[S]) extends Product with Serializable

    Represent a DynamoDB's query where a partition key value is required, sortKeyQuery and filter are optional.

    Represent a DynamoDB's query where a partition key value is required, sortKeyQuery and filter are optional.

    Examples:

    // query for an item where partition key == "some-partition-key", sort key == "some-sort-key" but only
    // return a value if the filter's condition is med ("my_bool_attribute_name" == true)
    val query: Query[String, String] =
      Query(
        "some-partition-key",
        SortKeyQuery.EqualTo("some-sort-key"),
        Expression(
          "#b = :my_bool",
          Map("#b" -> "my_bool_attribute_name"),
          Map(
            ":my_bool" -> true.asAttributeValue
          )
        )
      )
    
    // query for an item where partition key == "some-partition-key", the table doesn't have sort key, only
    // return a value if the filter's condition is med ("my_bool_attribute_name" == true)
    val query: Query[String, Nothing] =
      Query(
        "some-partition-key",
        Expression(
          "#b = :my_bool",
          Map("#b" -> "my_bool_attribute_name"),
          Map(
            ":my_bool" -> true.asAttributeValue
          )
        )
      )
    P

    parition key's type

    S

    sort key's type (Nothing type for table without sort key)

    partitionKey

    partition key value

    sortKeyQuery

    sort key query

    filter

    filter expression

  6. sealed trait SortKeyQuery[T] extends AnyRef

    Represent sort key query which can be used as part of key condition expression for query action: https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Query.html#DDB-Query-request-KeyConditionExpression

  7. trait syntax extends AnyRef

    Utility to help writing meteor.codec.Codec, meteor.codec.Encoder and meteor.codec.Decoder.

    Utility to help writing meteor.codec.Codec, meteor.codec.Encoder and meteor.codec.Decoder.

    Examples:

    import meteor.syntax._
    import meteor.codec._
    
    case class Author(
      names: String,
      age: Int
    )
    
    case class Book(
      name: String,
      author: Author,
      coAuthor: Option[Author]
    )
    
    implicit val encoderForAuthor: Encoder[Author] = Encoder.instance { obj =>
      Map(
        "names" -> obj.names.asAttributeValue,
        "age" -> obj.age.asAttributeValue
      ).asAttributeValue
    }
    
    implicit val encoderForBook: Encoder[Book] = Encoder.instance { obj =>
      Map(
        "name" -> obj.names.asAttributeValue,
        "author" -> obj.age.asAttributeValue,
        "coAuthor" -> obj.age.asAttributeValue,
      ).asAttributeValue
    }
    
    implicit val decoderForAuthor: Decoder[Author] = Decoder.instance { av =>
      for {
        names <- av.getAs[String]("names")
        age <- av.getAs[Int]("age")
      } yield Author(names, age)
    }
    
    implicit val decoderForBook: Decoder[Book] = Decoder.instance { av =>
      for {
        name <- av.getAs[String]("name")
        author <- av.getAs[Author]("author")
        coAuthor <- av.getOpt[Author]("coAuthor")
      } yield Book(name, author, coAuthor)
    }

Deprecated Type Members

  1. case class CompositeKeysSecondaryIndex[P, S](tableName: String, indexName: String, partitionKeyDef: KeyDef[P], sortKeyDef: KeyDef[S]) extends CompositeKeysIndex[P, S] with Product with Serializable

    Represent a secondary index which has both partition key and sort key

    Represent a secondary index which has both partition key and sort key

    P

    partition key's type

    S

    sort key's type

    tableName

    table's name

    indexName

    index's name

    partitionKeyDef

    partition key's definition

    sortKeyDef

    sort key's definition

    Annotations
    @deprecated
    Deprecated

    (Since version 2021-05-24) use meteor.api.hi.SecondaryCompositeIndex instead

  2. case class CompositeKeysTable[P, S](tableName: String, partitionKeyDef: KeyDef[P], sortKeyDef: KeyDef[S]) extends CompositeKeysIndex[P, S] with Product with Serializable

    Represent a table which has both partition key and sort key

    Represent a table which has both partition key and sort key

    P

    partition key's type

    S

    sort key's type

    tableName

    table's name

    partitionKeyDef

    partition key's definition

    sortKeyDef

    sort key's definition

    Annotations
    @deprecated
    Deprecated

    (Since version 2021-05-24) use meteor.api.hi.CompositeTable instead

  3. case class PartitionKeySecondaryIndex[P](tableName: String, indexName: String, partitionKeyDef: KeyDef[P]) extends PartitionKeyIndex[P] with Product with Serializable

    Represent a secondary index which has only partition key

    Represent a secondary index which has only partition key

    P

    partition key's type

    tableName

    table's name

    indexName

    secondary index's name

    partitionKeyDef

    partition key's definition

    Annotations
    @deprecated
    Deprecated

    (Since version 2021-05-24) use meteor.api.hi.SecondarySimpleIndex instead

  4. case class PartitionKeyTable[P](tableName: String, partitionKeyDef: KeyDef[P]) extends PartitionKeyIndex[P] with Product with Serializable

    Represent a table which has only partition key

    Represent a table which has only partition key

    P

    partition key's type

    tableName

    table's name

    partitionKeyDef

    partition key's definition

    Annotations
    @deprecated
    Deprecated

    (Since version 2021-05-24) use meteor.api.hi.SimpleTable instead

Value Members

  1. object Client
  2. object DynamoDbType
  3. object Expression extends Serializable
  4. object Query extends Serializable
  5. object SortKeyQuery
  6. object errors
  7. object syntax extends syntax

Ungrouped