示例#1
0
func (b *Backup) Finish() error {
	ret := C.sqlite3_backup_finish(b.b)
	if ret != 0 {
		return Error{Code: ErrNo(ret)}
	}
	return nil
}
示例#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
}
示例#3
0
文件: sqlite.go 项目: pcgod/grumble
func (b *Backup) Close() os.Error {
	if b.sb == nil {
		return os.EINVAL
	}
	C.sqlite3_backup_finish(b.sb)
	b.sb = nil
	return nil
}
示例#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
}
示例#5
0
文件: backup.go 项目: fclairamb/drone
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
}
示例#6
0
文件: backup.go 项目: gidden/cloudlus
// 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
}
示例#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
}
示例#8
0
文件: backup.go 项目: pkf/gosqlite
// 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
}
示例#9
0
文件: backup.go 项目: gwenn/gosqlite
// 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
}
示例#10
0
文件: backup.go 项目: petertseng/p2
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
}
示例#11
0
func (b *Backup) Finish() error {
	return Error{Code: ErrNo(C.sqlite3_backup_finish(b.b))}
}
示例#12
0
文件: backup.go 项目: rwj/gosqlite3
func (b *Backup) Finish() error {
	if e := Errno(C.sqlite3_backup_finish(b.cptr)); e != OK {
		return e
	}
	return nil
}
示例#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))
}