Effect CommunityEC
Effect Community13mo ago
6 replies
Gary

Error "Failed to execute statement" with `@effect/sql-drizzle/Mysql` setup and query execution

I'm seeing an error of "Failed to execute statement" when testing the drizzle + @effect/sql-drizzle/Mysql. Am I setting up something wrong?

const SqlLive = MysqlClient.layer({
  url: Redacted.make(
    isProduction ? process.env.MYSQL_URL! : process.env.MYSQL_PUBLIC_URL!
  ),
  transformQueryNames: String.camelToSnake,
  transformResultNames: String.snakeToCamel,
}).pipe(Layer.provide(SqlTracingLive), Layer.provide(DevTools.layer()));


yield* db
 .insert(usersTable)
 .values({...})
 .pipe(
   Effect.mapError((e) => { // Failed to execute statement })
 )
Was this page helpful?