Skip to content

Commit

Permalink
Document API entries that can't be used with cgocheck enabled.
Browse files Browse the repository at this point in the history
  • Loading branch information
gwenn committed Feb 21, 2016
1 parent 746114d commit 948bf3c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions function.go
Expand Up @@ -470,6 +470,7 @@ func goXDestroy(pApp unsafe.Pointer) {
const sqliteDeterministic = 0x800 // C.SQLITE_DETERMINISTIC

// CreateScalarFunction creates or redefines SQL scalar functions.
// Cannot be used with Go >= 1.6 and cgocheck enabled.
// TODO Make possible to specify the preferred encoding
// (See http://sqlite.org/c3ref/create_function.html)
func (c *Conn) CreateScalarFunction(functionName string, nArg int32, deterministic bool, pApp interface{},
Expand Down Expand Up @@ -498,6 +499,7 @@ func (c *Conn) CreateScalarFunction(functionName string, nArg int32, determinist
}

// CreateAggregateFunction creates or redefines SQL aggregate functions.
// Cannot be used with Go >= 1.6 and cgocheck enabled.
// TODO Make possible to specify the preferred encoding
// (See http://sqlite.org/c3ref/create_function.html)
func (c *Conn) CreateAggregateFunction(functionName string, nArg int32, pApp interface{},
Expand Down
3 changes: 3 additions & 0 deletions hook.go
Expand Up @@ -34,6 +34,7 @@ func goXCommitHook(udp unsafe.Pointer) C.int {
}

// CommitHook registers a callback function to be invoked whenever a transaction is committed.
// Cannot be used with Go >= 1.6 and cgocheck enabled.
// (See http://sqlite.org/c3ref/commit_hook.html)
func (c *Conn) CommitHook(f CommitHook, udp interface{}) {
if f == nil {
Expand Down Expand Up @@ -61,6 +62,7 @@ func goXRollbackHook(udp unsafe.Pointer) {
}

// RollbackHook registers a callback to be invoked each time a transaction is rolled back.
// Cannot be used with Go >= 1.6 and cgocheck enabled.
// (See http://sqlite.org/c3ref/commit_hook.html)
func (c *Conn) RollbackHook(f RollbackHook, udp interface{}) {
if f == nil {
Expand Down Expand Up @@ -89,6 +91,7 @@ func goXUpdateHook(udp unsafe.Pointer, action int, dbName, tableName *C.char, ro

// UpdateHook registers a callback to be invoked each time a row is updated,
// inserted or deleted using this database connection.
// Cannot be used with Go >= 1.6 and cgocheck enabled.
// (See http://sqlite.org/c3ref/update_hook.html)
func (c *Conn) UpdateHook(f UpdateHook, udp interface{}) {
if f == nil {
Expand Down
6 changes: 6 additions & 0 deletions trace.go
Expand Up @@ -50,6 +50,7 @@ func goXTrace(udp unsafe.Pointer, sql *C.char) {
// There can only be a single tracer defined for each database connection.
// Setting a new tracer clears the old one.
// If f is nil, the current tracer is removed.
// Cannot be used with Go >= 1.6 and cgocheck enabled.
// (See sqlite3_trace, http://sqlite.org/c3ref/profile.html)
func (c *Conn) Trace(f Tracer, udp interface{}) {
if f == nil {
Expand Down Expand Up @@ -82,6 +83,7 @@ func goXProfile(udp unsafe.Pointer, sql *C.char, nanoseconds C.sqlite3_uint64) {
// There can only be a single profiler defined for each database connection.
// Setting a new profiler clears the old one.
// If f is nil, the current profiler is removed.
// Cannot be used with Go >= 1.6 and cgocheck enabled.
// (See sqlite3_profile, http://sqlite.org/c3ref/profile.html)
func (c *Conn) Profile(f Profiler, udp interface{}) {
if f == nil {
Expand Down Expand Up @@ -233,6 +235,7 @@ func goXAuth(udp unsafe.Pointer, action int, arg1, arg2, dbName, triggerName *C.
}

// SetAuthorizer sets or clears the access authorization function.
// Cannot be used with Go >= 1.6 and cgocheck enabled.
// (See http://sqlite.org/c3ref/set_authorizer.html)
func (c *Conn) SetAuthorizer(f Authorizer, udp interface{}) error {
if f == nil {
Expand Down Expand Up @@ -265,6 +268,7 @@ func goXBusy(udp unsafe.Pointer, count int) C.int {
// There can only be a single busy handler defined for each database connection.
// Setting a new busy handler clears any previously set handler.
// If f is nil, the current handler is removed.
// Cannot be used with Go >= 1.6 and cgocheck enabled.
// (See http://sqlite.org/c3ref/busy_handler.html)
func (c *Conn) BusyHandler(f BusyHandler, udp interface{}) error {
if f == nil {
Expand Down Expand Up @@ -299,6 +303,7 @@ func goXProgress(udp unsafe.Pointer) C.int {
// Only a single progress handler may be defined at one time per database connection.
// Setting a new progress handler cancels the old one.
// If f is nil, the current handler is removed.
// Cannot be used with Go >= 1.6 and cgocheck enabled.
// (See http://sqlite.org/c3ref/progress_handler.html)
func (c *Conn) ProgressHandler(f ProgressHandler, numOps int32, udp interface{}) {
if f == nil {
Expand Down Expand Up @@ -396,6 +401,7 @@ var logger *sqliteLogger
// ConfigLog configures the logger of the SQLite library.
// Only one logger can be registered at a time for the whole program.
// The logger must be threadsafe.
// Cannot be used with Go >= 1.6 and cgocheck enabled when udp is not nil.
// (See sqlite3_config(SQLITE_CONFIG_LOG,...): http://sqlite.org/c3ref/config.html and http://www.sqlite.org/errlog.html)
func ConfigLog(f Logger, udp interface{}) error {
var rv C.int
Expand Down
1 change: 1 addition & 0 deletions vtab.go
Expand Up @@ -233,6 +233,7 @@ func (c *Conn) DeclareVTab(sql string) error {
}

// CreateModule registers a virtual table implementation.
// Cannot be used with Go >= 1.6 and cgocheck enabled.
// (See http://sqlite.org/c3ref/create_module.html)
func (c *Conn) CreateModule(moduleName string, module Module) error {
mname := C.CString(moduleName)
Expand Down

0 comments on commit 948bf3c

Please sign in to comment.