From df0c034d7ca47ba165e5a81eeb2802589005e9b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Grzegorz=20Marsza=C5=82ek?= Date: Thu, 30 Aug 2018 10:25:56 +0200 Subject: [PATCH] clearer const formatting with comments what const are used for what --- sqlite3.go | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/sqlite3.go b/sqlite3.go index 0dc9b04..364ce8a 100644 --- a/sqlite3.go +++ b/sqlite3.go @@ -202,9 +202,17 @@ func Version() (libVersion string, libVersionNumber int, sourceID string) { } const ( - SQLITE_OK = C.SQLITE_OK - SQLITE_IGNORE = C.SQLITE_IGNORE - SQLITE_DENY = C.SQLITE_DENY + // used by authorizer and pre_update_hook + SQLITE_DELETE = C.SQLITE_DELETE + SQLITE_INSERT = C.SQLITE_INSERT + SQLITE_UPDATE = C.SQLITE_UPDATE + + // used by authorzier - as return value + SQLITE_OK = C.SQLITE_OK + SQLITE_IGNORE = C.SQLITE_IGNORE + SQLITE_DENY = C.SQLITE_DENY + + // different actions query tries to do - passed as argument to authorizer SQLITE_CREATE_INDEX = C.SQLITE_CREATE_INDEX SQLITE_CREATE_TABLE = C.SQLITE_CREATE_TABLE SQLITE_CREATE_TEMP_INDEX = C.SQLITE_CREATE_TEMP_INDEX @@ -213,7 +221,7 @@ const ( SQLITE_CREATE_TEMP_VIEW = C.SQLITE_CREATE_TEMP_VIEW SQLITE_CREATE_TRIGGER = C.SQLITE_CREATE_TRIGGER SQLITE_CREATE_VIEW = C.SQLITE_CREATE_VIEW - SQLITE_DELETE = C.SQLITE_DELETE + SQLITE_CREATE_VTABLE = C.SQLITE_CREATE_VTABLE SQLITE_DROP_INDEX = C.SQLITE_DROP_INDEX SQLITE_DROP_TABLE = C.SQLITE_DROP_TABLE SQLITE_DROP_TEMP_INDEX = C.SQLITE_DROP_TEMP_INDEX @@ -222,19 +230,16 @@ const ( SQLITE_DROP_TEMP_VIEW = C.SQLITE_DROP_TEMP_VIEW SQLITE_DROP_TRIGGER = C.SQLITE_DROP_TRIGGER SQLITE_DROP_VIEW = C.SQLITE_DROP_VIEW - SQLITE_INSERT = C.SQLITE_INSERT + SQLITE_DROP_VTABLE = C.SQLITE_DROP_VTABLE SQLITE_PRAGMA = C.SQLITE_PRAGMA SQLITE_READ = C.SQLITE_READ SQLITE_SELECT = C.SQLITE_SELECT SQLITE_TRANSACTION = C.SQLITE_TRANSACTION - SQLITE_UPDATE = C.SQLITE_UPDATE SQLITE_ATTACH = C.SQLITE_ATTACH SQLITE_DETACH = C.SQLITE_DETACH SQLITE_ALTER_TABLE = C.SQLITE_ALTER_TABLE SQLITE_REINDEX = C.SQLITE_REINDEX SQLITE_ANALYZE = C.SQLITE_ANALYZE - SQLITE_CREATE_VTABLE = C.SQLITE_CREATE_VTABLE - SQLITE_DROP_VTABLE = C.SQLITE_DROP_VTABLE SQLITE_FUNCTION = C.SQLITE_FUNCTION SQLITE_SAVEPOINT = C.SQLITE_SAVEPOINT SQLITE_COPY = C.SQLITE_COPY