Files
lerko 026e969b74
CI / test (push) Successful in 2m41s
CI / lint (push) Successful in 1m11s
CI / vulncheck (push) Successful in 56s
chore: TUI screenshots, README polish, changelog rewrite (#32)
- Add 6 TUI screenshots to assets/ (monitors, alerts, logs, nodes, detail, theme)
- Rewrite README with hero image, badges, collapsible install sections
- Rewrite changelog to match actual CalVer tag history
- VHS tooling extracted to lerko/uptop-vhs

Reviewed-on: lerko/uptop#32
2026-05-29 17:45:31 +00:00

37 lines
699 B
Go

package store
import (
"database/sql"
"strconv"
)
type Dialect interface {
DriverName() string
CreateTablesSQL() []string
MigrationsSQL() []string
BoolFalse() string
ResetSequenceOnEmpty(db *sql.DB, table string)
ImportWipe(tx *sql.Tx)
ImportResetSequences(tx *sql.Tx)
UpsertNodeSQL() string
UpsertAlertHealthSQL() string
}
func rewritePlaceholders(query string, dollarStyle bool) string {
if !dollarStyle {
return query
}
buf := make([]byte, 0, len(query)+32)
n := 0
for i := 0; i < len(query); i++ {
if query[i] == '?' {
n++
buf = append(buf, '$')
buf = append(buf, []byte(strconv.Itoa(n))...)
} else {
buf = append(buf, query[i])
}
}
return string(buf)
}