MCPcopy Create free account
hub / github.com/PostHog/duckgres / ValidateMemoryLimit

Function ValidateMemoryLimit

server/sysinfo/sysinfo.go:96–98  ·  view source on GitHub ↗

ValidateMemoryLimit checks that a memory_limit string is a valid DuckDB size value.

(v string)

Source from the content-addressed store, hash-verified

94
95// ValidateMemoryLimit checks that a memory_limit string is a valid DuckDB size value.
96func ValidateMemoryLimit(v string) bool {
97 return validMemoryLimit.MatchString(v)
98}
99
100// ParseMemoryBytes parses a DuckDB memory size string (e.g., "4GB", "512MB", "1.5GB") into bytes.
101// Supports both integer and fractional values. Returns 0 if the string is empty, invalid, or "0GB".

Callers 1

TestValidateMemoryLimitFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestValidateMemoryLimitFunction · 0.68