Partial update using makeRepository

hey! using this Model
import { Model } from "@effect/sql";
import { UserId } from "app/user/model";
import { Schema } from "effect";

export const SessionId = Schema.Number.pipe(Schema.brand("SessionId"));
export type SessionId = typeof SessionId.Type;

export class Session extends Model.Class<Session>("Session")({
    id: Model.Generated(SessionId),
    userId: Model.Generated(UserId),
    createdAt: Model.DateTimeInsert,
    expiresAt: Model.DateTimeFromDate,
}) {}

I want to update one field, the expiresAt and dont want to touch to the other property.
however using the repository from @effect/sql
const repo = yield* Model.makeRepository(Session, {
  idColumn: "id",
  tableName: "sessions",
  panPrefix: "SessionStore",
});
repo.update({  }) /*all fields are mandatory, userId, id, expiresAt (createdAt isnt as it is omitted from updates*/

for my use case do I need to execute a raw sql query as the repository wont let me update only one field?
Was this page helpful?