Esempio n. 1
0
func (self *KcDb) Close() error {
	defer C.kcdbdel(self.cdb)
	if C.kcdbclose(self.cdb) == kcFalse {
		return errors.New(fmt.Sprintf("close: %s", C.GoString(C.kcecodename(C.kcdbecode(self.cdb)))))
	}
	return nil
}
Esempio n. 2
0
// Closes the database, make sure you always call this method after using the database.
//
// You can do it using the defer statement:
//
//     db := Open("my_db.kch", WRITE)
//     defer db.Close()
func (d *DB) Close() {
	C.kcdbclose(d.db)
	C.kcdbdel(d.db)
}
Esempio n. 3
0
func (kc *KCDB) Close() (err error) {
	if C.kcdbclose(kc.db) == 0 {
		err = kc.error()
	}
	return
}