Skip to main content
Version: 2.x

Scan and Query Operations

The High Level API mirrors the Scan and Query operations of DDB but with a high level of type safety.

We have to start of with a Scala model of the table and add an implicit schema reference in the companion object together with some convenience ProjectionExpression's via the accessors function.

// year is the sort key
final case class Equipment(id: String, year: Int, name: String, price: Double)
object Equipment {
implicit val schema: Schema.CaseClass4[String, Int, String, Double, Equipment] = DeriveSchema.gen[Equipment]
val (id, year, name, price) = ProjectionExpression.accessors[Equipment]
}

A summary is shown below and detailed sections can be found for each operation.

object DynamoDBQuery {
// Scan/Query operations

def scanAll[A: Schema](
tableName: String
): DynamoDBQuery[A, Stream[Throwable, A]] = ???

def scanSome[A: Schema](
tableName: String,
limit: Int
): DynamoDBQuery[A, (Chunk[A], LastEvaluatedKey)] = ???

def queryAll[A: Schema](
tableName: String
): DynamoDBQuery[A, Stream[Throwable, A]] = ???

def querySome[A: Schema](
tableName: String,
limit: Int
): DynamoDBQuery[A, (Chunk[A], LastEvaluatedKey)] = ???

}

ZIO Chat

๐ŸŒŸ Greetings from ZIO Chat! ๐ŸŒŸ Have questions about ZIO? Look no further! I'm here to be your ZIO guru. Whether you're a seasoned pro or just starting out, I've got answers tailored just for you. Fire away with your ZIO queries, and I'll hit you back with the best insights I've got. Let's dive into the world of ZIO together!