diff --git a/internal/sqlutil/trace.go b/internal/sqlutil/trace.go index dd92daf6..c3892aac 100644 --- a/internal/sqlutil/trace.go +++ b/internal/sqlutil/trace.go @@ -53,7 +53,7 @@ func (in *traceInterceptor) StmtQueryContext(ctx context.Context, stmt driver.St safe = w.Safe() } } - if safe != "" { + if safe != "" && !strings.HasPrefix(query, "SELECT ") { logrus.Infof("unsafe: %s -- %s", safe, query) } @@ -75,7 +75,7 @@ func (in *traceInterceptor) StmtExecContext(ctx context.Context, stmt driver.Stm safe = w.Safe() } } - if safe != "" { + if safe != "" && !strings.HasPrefix(query, "SELECT ") { logrus.Infof("unsafe: %s -- %s", safe, query) } diff --git a/syncapi/storage/sqlite3/syncserver.go b/syncapi/storage/sqlite3/syncserver.go index 135495a5..c7530d3c 100644 --- a/syncapi/storage/sqlite3/syncserver.go +++ b/syncapi/storage/sqlite3/syncserver.go @@ -258,3 +258,16 @@ func (d *SyncServerDatasource) PutFilter(ctx context.Context, localpart string, func (d *SyncServerDatasource) RedactEvent(ctx context.Context, redactedEventID string, redactedBecause *gomatrixserverlib.HeaderedEvent) error { return d.Database.RedactEvent(d.dbctx, redactedEventID, redactedBecause) } + +func (d *SyncServerDatasource) PartitionOffsets( + ctx context.Context, topic string, +) ([]sqlutil.PartitionOffset, error) { + return d.PartitionOffsetStatements.PartitionOffsets(d.dbctx, topic) +} + +// SetPartitionOffset implements PartitionStorer +func (d *SyncServerDatasource) SetPartitionOffset( + ctx context.Context, topic string, partition int32, offset int64, +) error { + return d.PartitionOffsetStatements.SetPartitionOffset(d.dbctx, topic, partition, offset) +}