Esempio n. 1
0
func (b *Backup) Finish() error {
	ret := C.sqlite3_backup_finish(b.b)
	if ret != 0 {
		return Error{Code: ErrNo(ret)}
	}
	return nil
}
Esempio n. 2
0
func (b *Backup) Close() error {
	if b.sb == nil {
		return errors.New("backup already closed")
	}
	C.sqlite3_backup_finish(b.sb)
	b.sb = nil
	return nil
}
Esempio n. 3
0
func (b *Backup) Close() os.Error {
	if b.sb == nil {
		return os.EINVAL
	}
	C.sqlite3_backup_finish(b.sb)
	b.sb = nil
	return nil
}
Esempio n. 4
0
func (b *Backup) Close() error {
	if b.sb == nil {
		return os.ErrInvalid
	}
	C.sqlite3_backup_finish(b.sb)
	b.sb = nil
	return nil
}
Esempio n. 5
0
func (b *SQLiteBackup) Close() error {
	ret := C.sqlite3_backup_finish(b.b)
	if ret != 0 {
		return Error{Code: ErrNo(ret)}
	}
	b.b = nil
	runtime.SetFinalizer(b, nil)
	return nil
}
Esempio n. 6
0
// Close releases all resources associated with the backup operation. It is safe
// to call this method prior to backup completion to abort the operation.
// [http://www.sqlite.org/c3ref/backup_finish.html#sqlite3backupfinish]
func (b *Backup) Close() error {
	if bkup := b.bkup; bkup != nil {
		b.bkup = nil
		runtime.SetFinalizer(b, nil)
		if rc := C.sqlite3_backup_finish(bkup); rc != OK {
			return libErr(rc, b.dst.db)
		}
	}
	return nil
}
Esempio n. 7
0
// Close finishes/stops the backup.
// (See http://sqlite.org/c3ref/backup_finish.html#sqlite3backupfinish)
func (b *Backup) Close() error {
	if b == nil {
		return errors.New("nil sqlite backup")
	}
	rv := C.sqlite3_backup_finish(b.sb)
	if rv != C.SQLITE_OK {
		return b.dst.error(rv, "backup finish failed")
	}
	b.sb = nil
	return nil
}
Esempio n. 8
0
// Close finishes/stops the backup.
// (See http://sqlite.org/c3ref/backup_finish.html#sqlite3backupfinish)
func (b *Backup) Close() error {
	if b == nil {
		return errors.New("nil sqlite backup")
	}
	rv := C.sqlite3_backup_finish(b.sb)
	if rv != C.SQLITE_OK {
		return Errno(rv)
	}
	b.sb = nil
	return nil
}
Esempio n. 9
0
// Close finishes/stops the backup.
// (See http://sqlite.org/c3ref/backup_finish.html#sqlite3backupfinish)
func (b *Backup) Close() error {
	if b == nil {
		return errors.New("nil sqlite backup")
	}
	if b.sb == nil {
		return nil
	}
	rv := C.sqlite3_backup_finish(b.sb) // must be called only once
	b.sb = nil
	if rv != C.SQLITE_OK {
		return b.dst.error(rv, "backup finish failed")
	}
	return nil
}
Esempio n. 10
0
func (b *SQLiteBackup) Close() error {
	ret := C.sqlite3_backup_finish(b.b)

	// sqlite3_backup_finish() never fails, it just returns the
	// error code from previous operations, so clean up before
	// checking and returning an error
	b.b = nil
	runtime.SetFinalizer(b, nil)

	if ret != 0 {
		return Error{Code: ErrNo(ret)}
	}
	return nil
}
Esempio n. 11
0
func (b *Backup) Finish() error {
	return Error{Code: ErrNo(C.sqlite3_backup_finish(b.b))}
}
Esempio n. 12
0
func (b *Backup) Finish() error {
	if e := Errno(C.sqlite3_backup_finish(b.cptr)); e != OK {
		return e
	}
	return nil
}
Esempio n. 13
0
// Finish should be called when the backup is done, an error occured or when
// the application wants to abandon the backup operation.
func (b *Backup) Finish() error {
	return SQLiteError(C.sqlite3_backup_finish(b.cptr))
}