Effect CommunityEC
Effect Community15mo ago
3 replies
franzkafka

Error with SQL Insert Overload in Effect Typescript Library

Hey there, I'm trying out Effect and starting here migrating an existing app's persistence layer. I was following the example on the effect/sql README

export const makePersonService = Effect.gen(function* () {
  const sql = yield* SqlClient.SqlClient

  const InsertPerson = yield* SqlResolver.ordered("InsertPerson", {
    Request: InsertPersonSchema,
    Result: Person,
    execute: (requests) =>
      sql`
        INSERT INTO people
        ${sql.insert(requests)}
        RETURNING people.*
      `
  })

  const insert = InsertPerson.execute

  return { insert }
})


But I'm getting an error on the ${sql.insert(requests)} saying there's no matching overload
Was this page helpful?