meteor
Members list
Type members
Classlikes
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 Objecttrait Matchableclass Any
Represent DynamoDB primitive data types, including BOOL, B, BS, L, M, N, NS, NULL, S and SS.
Attributes
- Companion
- trait
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
DynamoDbType.type
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 Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
Expression.type
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 Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
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 Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
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 Objecttrait Matchableclass 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
Attributes
- Companion
- trait
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
SortKeyQuery.type
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)
}