diff --git a/CHANGELOG.md b/CHANGELOG.md index d9c01b1..4d05b63 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ 1. Reworked command line arguments to specify ACL table using --table:ACL option. 2. Reworked sqlite3 implementation to replace the UPSERT with an ON CONFLICT REPLACE clause in the CREATE TABLE. +3. Replaced os.Rename with lib implementation for tmpfs support. ## [0.8.5](https://github.com/uhppoted/uhppoted-app-db/releases/tag/v0.8.5) - 2023-06-13 diff --git a/TODO.md b/TODO.md index aca8a05..bd2d49b 100644 --- a/TODO.md +++ b/TODO.md @@ -9,6 +9,7 @@ - [x] MySQL support (cf. https://github.com/uhppoted/uhppoted-app-db/issues/1) - [x] Clean up DSN/DB logic - [x] sqlite3: replace UPSERTs with TABLE ON CONFLICT REPLACE clause +- [x] Replace os.Rename with lib implementation for tmpfs support (cf. https://github.com/uhppoted/uhppoted-httpd/issues/20) ## TODO diff --git a/commands/command.go b/commands/command.go index 759dae8..5336349 100644 --- a/commands/command.go +++ b/commands/command.go @@ -10,6 +10,7 @@ import ( "github.com/uhppoted/uhppote-core/uhppote" "github.com/uhppoted/uhppoted-lib/config" "github.com/uhppoted/uhppoted-lib/lockfile" + lib "github.com/uhppoted/uhppoted-lib/os" "github.com/uhppoted/uhppoted-app-db/log" ) @@ -119,7 +120,7 @@ func write(file string, bytes []byte) error { dir := filepath.Dir(file) if err := os.MkdirAll(dir, 0770); err != nil { return err - } else if err := os.Rename(tmp.Name(), file); err != nil { + } else if err := lib.Rename(tmp.Name(), file); err != nil { return err } diff --git a/go.mod b/go.mod index f060154..69ffc05 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/mattn/go-sqlite3 v1.14.16 github.com/microsoft/go-mssqldb v1.1.0 github.com/uhppoted/uhppote-core v0.8.6-0.20230714164141-912d472ef6df - github.com/uhppoted/uhppoted-lib v0.8.6-0.20230714155133-57e68f2d1360 + github.com/uhppoted/uhppoted-lib v0.8.6-0.20230801163955-16b4119234e5 ) require ( diff --git a/go.sum b/go.sum index 775838c..b95fb53 100644 --- a/go.sum +++ b/go.sum @@ -44,8 +44,8 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/uhppoted/uhppote-core v0.8.6-0.20230714164141-912d472ef6df h1:HdvJy+Idu6E0xRdSeILN4qWt9iGfv7dM5KtoJisg8JA= github.com/uhppoted/uhppote-core v0.8.6-0.20230714164141-912d472ef6df/go.mod h1:q3xZZc7GMkCfpVnKNmdoZQDjvMHfPvH79VNai7HDH3s= -github.com/uhppoted/uhppoted-lib v0.8.6-0.20230714155133-57e68f2d1360 h1:XaVqmMmjwskTrX6iCdUl2I4ezrvuoA/yhLzf/455E10= -github.com/uhppoted/uhppoted-lib v0.8.6-0.20230714155133-57e68f2d1360/go.mod h1:3lLcVCtew+bIr0qftO/VsqmJLEoBaItX9rm9lLVusJE= +github.com/uhppoted/uhppoted-lib v0.8.6-0.20230801163955-16b4119234e5 h1:B4RxLs3eVOZ0GQcQ7A865RSzErxcwnIflG49MGIv4Ls= +github.com/uhppoted/uhppoted-lib v0.8.6-0.20230801163955-16b4119234e5/go.mod h1:3lLcVCtew+bIr0qftO/VsqmJLEoBaItX9rm9lLVusJE= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=