From 1ebf0341dd42fde631eb791358ef70a3331f92fe Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Fri, 18 Oct 2024 00:01:50 +0200 Subject: feat(tfstated): allow configuration of version history limit via environment variable --- pkg/database/states.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'pkg/database/states.go') diff --git a/pkg/database/states.go b/pkg/database/states.go index 26a1021..5536533 100644 --- a/pkg/database/states.go +++ b/pkg/database/states.go @@ -102,7 +102,8 @@ func (db *DB) SetState(name string, data []byte, lockID string) (bool, error) { JOIN states ON states.id = versions.state_id WHERE states.name = :name ORDER BY versions.id DESC - LIMIT 64));`, + LIMIT :limit));`, + sql.Named("limit", db.versionsHistoryLimit), sql.Named("name", name), ) if err != nil { -- cgit v1.2.3