Beispiel #1
0
// Complete returns true if sql appears to contain a complete statement that is
// ready to be parsed. This does not validate the statement syntax.
// [http://www.sqlite.org/c3ref/complete.html]
func Complete(sql string) bool {
	if initErr != nil {
		return false
	}
	sql += "\x00"
	return C.sqlite3_complete(cStr(sql)) == 1
}
Beispiel #2
0
// Complete determines if an SQL statement is complete.
// (See http://sqlite.org/c3ref/complete.html)
func Complete(sql string) (bool, error) {
	cs := C.CString(sql)
	rv := C.sqlite3_complete(cs)
	C.free(unsafe.Pointer(cs))
	if rv == C.SQLITE_NOMEM {
		return false, ErrNoMem
	}
	return rv != 0, nil
}
Beispiel #3
0
// Complete determines if an SQL statement is complete.
// (See http://sqlite.org/c3ref/complete.html)
func Complete(sql string) bool {
	cs := C.CString(sql)
	defer C.free(unsafe.Pointer(cs))
	return C.sqlite3_complete(cs) != 0
}