Skip to content

Commit

Permalink
specifiy table name when to insert (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
JunNishimura committed Mar 28, 2024
1 parent 692758a commit b1cdd3c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,10 @@ func (a *bunAdapter) savePolicyRecords(policies []CasbinPolicy) error {
}

// bulk insert new policies
if _, err := a.db.NewInsert().Model(&policies).Exec(context.Background()); err != nil {
if _, err := a.db.NewInsert().
Model(&policies).
Table(a.tableName).
Exec(context.Background()); err != nil {
return err
}

Expand Down

0 comments on commit b1cdd3c

Please sign in to comment.