Esempio n. 1
0
// Limit queries the current value of a limit.
// (See http://www.sqlite.org/c3ref/limit.html)
func (c *Conn) Limit(id Limit) int32 {
	return int32(C.sqlite3_limit(c.db, C.int(id), -1))
}
Esempio n. 2
0
// SetLimit changes the value of a limit.
// (See http://www.sqlite.org/c3ref/limit.html)
func (c *Conn) SetLimit(id Limit, newVal int32) int32 {
	return int32(C.sqlite3_limit(c.db, C.int(id), C.int(newVal)))
}
Esempio n. 3
0
// Limit changes a per-connection resource usage or performance limit, specified
// by one of the LIMIT constants, returning its previous value. If the new value
// is negative, the limit is left unchanged and its current value is returned.
// [http://www.sqlite.org/c3ref/limit.html]
func (c *Conn) Limit(id, value int) (prev int) {
	if c.db != nil {
		prev = int(C.sqlite3_limit(c.db, C.int(id), C.int(value)))
	}
	return
}