本文整理汇总了Golang中C.sqlite3_next_stmt函数的典型用法代码示例。如果您正苦于以下问题:Golang sqlite3_next_stmt函数的具体用法?Golang sqlite3_next_stmt怎么用?Golang sqlite3_next_stmt使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sqlite3_next_stmt函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: Close
// Close closes a database connection and any dangling statements.
// (See http://sqlite.org/c3ref/close.html)
func (c *Conn) Close() error {
if c == nil {
return errors.New("nil sqlite database")
}
if c.db == nil {
return nil
}
c.stmtCache.flush()
// Dangling statements
stmt := C.sqlite3_next_stmt(c.db, nil)
for stmt != nil {
if C.sqlite3_stmt_busy(stmt) != 0 {
Log(C.SQLITE_MISUSE, "Dangling statement (not reset): \""+C.GoString(C.sqlite3_sql(stmt))+"\"")
} else {
Log(C.SQLITE_MISUSE, "Dangling statement (not finalize): \""+C.GoString(C.sqlite3_sql(stmt))+"\"")
}
C.sqlite3_finalize(stmt)
stmt = C.sqlite3_next_stmt(c.db, nil)
}
rv := C.sqlite3_close(c.db)
if rv != C.SQLITE_OK {
Log(int(rv), "error while closing Conn")
return c.error(rv, "Conn.Close")
}
c.db = nil
return nil
}
示例2: Close
func (c *SQLiteConn) Close() error {
s := C.sqlite3_next_stmt(c.db, nil)
for s != nil {
C.sqlite3_finalize(s)
s = C.sqlite3_next_stmt(c.db, nil)
}
rv := C.sqlite3_close(c.db)
if rv != C.SQLITE_OK {
return errors.New("sqlite succeeded without returning a database")
}
c.db = nil
return nil
}
示例3: Close
// Close the connection.
func (c *SQLiteConn) Close() error {
s := C.sqlite3_next_stmt(c.db, nil)
for s != nil {
C.sqlite3_finalize(s)
s = C.sqlite3_next_stmt(c.db, nil)
}
rv := C.sqlite3_close(c.db)
if rv != C.SQLITE_OK {
return errors.New("error while closing sqlite database connection")
}
c.db = nil
return nil
}
示例4: Close
// Close the connection.
func (c *SQLiteConn) Close() error {
s := C.sqlite3_next_stmt(c.db, nil)
for s != nil {
C.sqlite3_finalize(s)
s = C.sqlite3_next_stmt(c.db, nil)
}
rv := C.sqlite3_close(c.db)
if rv != C.SQLITE_OK {
return ErrNo(rv)
}
c.db = nil
return nil
}