0

The below queries implements an UPSERT and works perfectly on POSTGRES

if err := query.Clauses(clause.OnConflict{
        Columns: []clause.Column{{Name: "finding_id"}, {Name: "finding_classification_id"}},
        DoUpdates: clause.AssignmentColumns([]string{"deleted_at",
            "deleted_by",
            "last_updated_at",
            "last_updated_by"},
        )}).Save(&classified).Error; err != nil {
        return fmt.Errorf("updating finding classifications: %w", err)
    }

However, when executed again SQLITE it returns the error no such table: main.finding.

The table it wants is called findings.

It looks to me like a bug affecting SQLITE where it drops the functionality that defaults to plural table names. I tried adding a TableName func but it had no impact

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.