Skip to content

rowsAffected broken since 0.15 for aws hosted Turso databases #312

Open
@erkannt

Description

@erkannt

Since version 0.15 rowsAffected has been 0 even when new rows get inserted.

This seems to only affect turso databases hosted on aws. Legacy databases hosted on fly.io are fine, as are local file databases.

Have confirmed that we are not hitting the todo marked line in the client as returnsData is false.

app-1          | returnsData false
app-1          | info { changes: 0, duration: 0.873753976, lastInsertRowid: 54 }

Have confirmed that the rows actually do get written.


For context, we use rowsAffected to implement optimistic concurrency control:

  const result = await dbClient.execute({
    sql: insertEventRow,
    args: constructArgsForNewEventRow(event, resource, newResourceVersion),
  });
  return result.rowsAffected === 1
    ? 'raised-event'
    : 'last-known-version-out-of-date';

We only switched to 0.15 as 0.14 produced the following error for aws hosted Turso databases.

ERROR tower_http::trace::on_failure: response failed classification=Error: status: Internal, message: "Invalid header bit 123 expected 0 or 1", details: [], metadata: MetadataMap { headers: {} } latency=70 ms

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions