meteor

package meteor

Members list

Packages

package meteor.api
package meteor.codec

Type members

Classlikes

trait Client[F[_]]

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.

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.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
object Client

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
Client.type
trait DynamoDbType

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

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

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object B
object BOOL
object BS
object L
object M
object N
object NS
object NULL
object S
object SS
Show all
object DynamoDbType

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
case class Expression(expression: String, attributeNames: Map[String, String], attributeValues: Map[String, AttributeValue])

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.

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
 )
)

Value parameters

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

expression

expression as raw String

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Expression

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Expression.type
case class KeyDef[K](attributeName: String, attributeType: DynamoDbType)

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

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

Type parameters

K

key's type

Value parameters

attributeName

attribute's name

attributeType

attribute's type

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object KeyDef

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
KeyDef.type
case class Query[P, S](partitionKey: P, sortKeyQuery: SortKeyQuery[S], filter: Expression)(implicit evidence$1: Encoder[P], evidence$2: Encoder[S])

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
     )
   )
 )

Type parameters

P

partition key's type

S

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

Value parameters

filter

filter expression

partitionKey

partition key value

sortKeyQuery

sort key query

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Query

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
Query.type
sealed trait SortKeyQuery[T]

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

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

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class BeginsWith[T]
class Between[T]
class Empty[T]
class EqualTo[T]
class GreaterOrEqualTo[T]
class GreaterThan[T]
class LessOrEqualTo[T]
class LessThan[T]
Show all
object SortKeyQuery

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
object errors

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
errors.type
trait syntax

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)
}

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object syntax
object syntax extends syntax

Attributes

Companion
trait
Supertypes
trait syntax
class Object
trait Matchable
class Any
Self type
syntax.type