本文整理汇总了Golang中C.sqlite3_close_v2函数的典型用法代码示例。如果您正苦于以下问题:Golang sqlite3_close_v2函数的具体用法?Golang sqlite3_close_v2怎么用?Golang sqlite3_close_v2使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sqlite3_close_v2函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: Close
// Close the connection.
func (c *SQLiteConn) Close() error {
rv := C.sqlite3_close_v2(c.db)
if rv != C.SQLITE_OK {
return c.lastError()
}
c.db = nil
return nil
}
示例2: Close
// Close the connection.
func (c *SQLiteConn) Close() error {
rv := C.sqlite3_close_v2(c.db)
if rv != C.SQLITE_OK {
return c.lastError()
}
c.db = nil
runtime.SetFinalizer(c, nil)
return nil
}
示例3: Close
// Close releases all resources associated with the connection. If any prepared
// statements, incremental I/O operations, or backup operations are still
// active, the connection becomes an unusable "zombie" and is closed after all
// remaining statements and operations are destroyed. A BUSY error code is
// returned if the connection is left in this "zombie" status, which may
// indicate a programming error where some previously allocated resource is not
// properly released.
// [http://www.sqlite.org/c3ref/close.html]
func (c *Conn) Close() error {
if db := c.db; db != nil {
c.db = nil
runtime.SetFinalizer(c, nil)
if rc := C.sqlite3_close(db); rc != OK {
err := libErr(rc, db)
if rc == BUSY {
C.sqlite3_close_v2(db)
}
return err
}
*c = Conn{} // Clear callback handlers only if db was closed
}
return nil
}