// Clear removes all records from the database. // // Returns a KCError in case of failure. func (d *DB) Clear() error { if C.kcdbclear(d.db) == 0 { msg := d.LastError() return KCError(fmt.Sprintf("Failed to clear the database: %s.", msg)) } return nil }
func (kc *KCDB) Clear() (err error) { if C.kcdbclear(kc.db) == 0 { err = kc.error() } return }