Read

Read operations are built by chaining modifiers and finishing with a terminal method.

findUnique()

ballerina
var row = check db.'from(User)
    .'where({email: {equals: "alice@example.com"}})
    .findUnique();

findFirst()

ballerina
var first = check db.'from(User)
    .'where({status: {equals: "ACTIVE"}})
    .orderBy({createdAt: orm:DESC})
    .findFirst();

findMany()

ballerina
var list = check db.'from(User)
    .'where({status: {equals: "ACTIVE"}})
    .orderBy({createdAt: orm:DESC})
    .skip(0)
    .take(20)
    .findMany();

Typed conversion with cloneWithType()

ballerina
User[] typedUsers = check (check db.'from(User)
    .take(10)
    .findMany()
).cloneWithType();

Next step

Continue with Update.