f7ded185a0
- Remove duplicate SSTable add loop in baradadb.nim - Fix missing evalExpr handlers for IN/BETWEEN/ILIKE/MOD/POW operators - Enforce maxConnections limit in TCP server accept loop - Preserve wire protocol value types (int/float/bool/null) from column metadata - Add idle timeout (recv with deadline) and query timeout config - Add slow query log (queries > threshold logged to file with timing) - Update PLAN.md to reflect actual state (phases A, B, C complete, score 9.5/10)
40 lines
877 B
Nim
40 lines
877 B
Nim
type
|
|
BaraConfig* = object
|
|
address*: string
|
|
port*: int
|
|
dataDir*: string
|
|
maxConnections*: int
|
|
walEnabled*: bool
|
|
compactionStrategy*: CompactionStrategy
|
|
tlsEnabled*: bool
|
|
certFile*: string
|
|
keyFile*: string
|
|
idleTimeoutMs*: int
|
|
queryTimeoutMs*: int
|
|
slowQueryThresholdMs*: int
|
|
slowQueryLogPath*: string
|
|
|
|
CompactionStrategy* = enum
|
|
csSizeTiered = "size_tiered"
|
|
csLeveled = "leveled"
|
|
|
|
proc defaultConfig*(): BaraConfig =
|
|
BaraConfig(
|
|
address: "127.0.0.1",
|
|
port: 5432,
|
|
dataDir: "./data",
|
|
maxConnections: 1000,
|
|
walEnabled: true,
|
|
compactionStrategy: csLeveled,
|
|
tlsEnabled: false,
|
|
certFile: "",
|
|
keyFile: "",
|
|
idleTimeoutMs: 300_000,
|
|
queryTimeoutMs: 30_000,
|
|
slowQueryThresholdMs: 1_000,
|
|
slowQueryLogPath: "",
|
|
)
|
|
|
|
proc loadConfig*(): BaraConfig =
|
|
result = defaultConfig()
|