Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ Added:
* When `--max-pages!=0` (limited pages), defaults to 50 to maintain backward compatibility
* Custom page size can be specified with `--page-size` flag

Changed:
- Import now ignores duplicate tuples instead of failing the import. Note: this feature requires OpenFGA server [v1.10.0](https://github.com/openfga/openfga/releases/tag/v1.10.0) or later. You can still import to previous versions, but this setting will be ignored. Writes that are not imports (aka. writing a single tuple instead of from a file) will still fail on duplicates.

## [0.7.4] - 2025-08-15

Changed:
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module github.com/openfga/cli

go 1.24.0

toolchain go1.24.6
toolchain go1.25.1

require (
github.com/gocarina/gocsv v0.0.0-20240520201108-78e41c74b4b1
Expand All @@ -13,7 +13,7 @@ require (
github.com/nwidger/jsoncolor v0.3.2
github.com/oklog/ulid/v2 v2.1.1
github.com/openfga/api/proto v0.0.0-20250909172242-b4b2a12f5c67
github.com/openfga/go-sdk v0.7.2
github.com/openfga/go-sdk v0.7.3
github.com/openfga/language/pkg/go v0.2.0-beta.2.0.20250919191407-efa08b02a76a
github.com/openfga/openfga v1.10.2
github.com/rung/go-safecast v1.0.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQ
github.com/opencontainers/image-spec v1.1.0/go.mod h1:W4s4sFTMaBeK1BQLXbG4AdM2szdn85PY75RI83NrTrM=
github.com/openfga/api/proto v0.0.0-20250909172242-b4b2a12f5c67 h1:58mhO5nqkdka2Mpg5mijuZOHScX7reowhzRciwjFCU8=
github.com/openfga/api/proto v0.0.0-20250909172242-b4b2a12f5c67/go.mod h1:XDX4qYNBUM2Rsa2AbKPh+oocZc2zgme+EF2fFC6amVU=
github.com/openfga/go-sdk v0.7.2 h1:qbklIm0hjPDnCCjGkgr1X32v46agEYzYiANYribPO5s=
github.com/openfga/go-sdk v0.7.2/go.mod h1:kiryf3FszAobRaQiBSbCpxBxuSh0SpSMt94ivduaIWc=
github.com/openfga/go-sdk v0.7.3 h1:BrYmJyIdicVeKzoycCFT0vzf0oz4luWrwoPIJdF6Wgo=
github.com/openfga/go-sdk v0.7.3/go.mod h1:kiryf3FszAobRaQiBSbCpxBxuSh0SpSMt94ivduaIWc=
github.com/openfga/language/pkg/go v0.2.0-beta.2.0.20250919191407-efa08b02a76a h1:mwpFZZdH4B6hHDGuQjkvebkp8+eLEi63nZ8XniGTyvo=
github.com/openfga/language/pkg/go v0.2.0-beta.2.0.20250919191407-efa08b02a76a/go.mod h1:BG26d1Fk4GSg0wMj60TRJ6Pe4ka2WQ33akhO+mzt3t0=
github.com/openfga/openfga v1.10.2 h1:7dw9AatGYuhNTs0e5zsAaetIzV8sePbAeaBai5ibvZs=
Expand Down
4 changes: 4 additions & 0 deletions internal/tuple/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ func ImportTuples(ctx context.Context, fgaClient client.SdkClient,
MaxPerChunk: maxTuplesPerWrite32,
MaxParallelRequests: maxParallelRequests32,
},
Conflict: client.ClientWriteConflictOptions{
OnDuplicateWrites: client.CLIENT_WRITE_REQUEST_ON_DUPLICATE_WRITES_IGNORE,
OnMissingDeletes: client.CLIENT_WRITE_REQUEST_ON_MISSING_DELETES_IGNORE,
},
}

// If RPS values are 0, then fallback to the previous way of importing
Expand Down
Loading