diff --git a/const.go b/const.go index 63e5c5af..5b7e4126 100644 --- a/const.go +++ b/const.go @@ -256,41 +256,41 @@ const ( type AuthorizerActionCode uint32 const ( - /************************************************ 3rd ************ 4th ***********/ - CREATE_INDEX AuthorizerActionCode = 1 /* Index Name Table Name */ - CREATE_TABLE AuthorizerActionCode = 2 /* Table Name NULL */ - CREATE_TEMP_INDEX AuthorizerActionCode = 3 /* Index Name Table Name */ - CREATE_TEMP_TABLE AuthorizerActionCode = 4 /* Table Name NULL */ - CREATE_TEMP_TRIGGER AuthorizerActionCode = 5 /* Trigger Name Table Name */ - CREATE_TEMP_VIEW AuthorizerActionCode = 6 /* View Name NULL */ - CREATE_TRIGGER AuthorizerActionCode = 7 /* Trigger Name Table Name */ - CREATE_VIEW AuthorizerActionCode = 8 /* View Name NULL */ - DELETE AuthorizerActionCode = 9 /* Table Name NULL */ - DROP_INDEX AuthorizerActionCode = 10 /* Index Name Table Name */ - DROP_TABLE AuthorizerActionCode = 11 /* Table Name NULL */ - DROP_TEMP_INDEX AuthorizerActionCode = 12 /* Index Name Table Name */ - DROP_TEMP_TABLE AuthorizerActionCode = 13 /* Table Name NULL */ - DROP_TEMP_TRIGGER AuthorizerActionCode = 14 /* Trigger Name Table Name */ - DROP_TEMP_VIEW AuthorizerActionCode = 15 /* View Name NULL */ - DROP_TRIGGER AuthorizerActionCode = 16 /* Trigger Name Table Name */ - DROP_VIEW AuthorizerActionCode = 17 /* View Name NULL */ - INSERT AuthorizerActionCode = 18 /* Table Name NULL */ - PRAGMA AuthorizerActionCode = 19 /* Pragma Name 1st arg or NULL */ - READ AuthorizerActionCode = 20 /* Table Name Column Name */ - SELECT AuthorizerActionCode = 21 /* NULL NULL */ - TRANSACTION AuthorizerActionCode = 22 /* Operation NULL */ - UPDATE AuthorizerActionCode = 23 /* Table Name Column Name */ - ATTACH AuthorizerActionCode = 24 /* Filename NULL */ - DETACH AuthorizerActionCode = 25 /* Database Name NULL */ - ALTER_TABLE AuthorizerActionCode = 26 /* Database Name Table Name */ - REINDEX AuthorizerActionCode = 27 /* Index Name NULL */ - ANALYZE AuthorizerActionCode = 28 /* Table Name NULL */ - CREATE_VTABLE AuthorizerActionCode = 29 /* Table Name Module Name */ - DROP_VTABLE AuthorizerActionCode = 30 /* Table Name Module Name */ - FUNCTION AuthorizerActionCode = 31 /* NULL Function Name */ - SAVEPOINT AuthorizerActionCode = 32 /* Operation Savepoint Name */ - COPY AuthorizerActionCode = 0 /* No longer used */ - RECURSIVE AuthorizerActionCode = 33 /* NULL NULL */ + /***************************************************** 3rd ************ 4th ***********/ + AUTH_CREATE_INDEX AuthorizerActionCode = 1 /* Index Name Table Name */ + AUTH_CREATE_TABLE AuthorizerActionCode = 2 /* Table Name NULL */ + AUTH_CREATE_TEMP_INDEX AuthorizerActionCode = 3 /* Index Name Table Name */ + AUTH_CREATE_TEMP_TABLE AuthorizerActionCode = 4 /* Table Name NULL */ + AUTH_CREATE_TEMP_TRIGGER AuthorizerActionCode = 5 /* Trigger Name Table Name */ + AUTH_CREATE_TEMP_VIEW AuthorizerActionCode = 6 /* View Name NULL */ + AUTH_CREATE_TRIGGER AuthorizerActionCode = 7 /* Trigger Name Table Name */ + AUTH_CREATE_VIEW AuthorizerActionCode = 8 /* View Name NULL */ + AUTH_DELETE AuthorizerActionCode = 9 /* Table Name NULL */ + AUTH_DROP_INDEX AuthorizerActionCode = 10 /* Index Name Table Name */ + AUTH_DROP_TABLE AuthorizerActionCode = 11 /* Table Name NULL */ + AUTH_DROP_TEMP_INDEX AuthorizerActionCode = 12 /* Index Name Table Name */ + AUTH_DROP_TEMP_TABLE AuthorizerActionCode = 13 /* Table Name NULL */ + AUTH_DROP_TEMP_TRIGGER AuthorizerActionCode = 14 /* Trigger Name Table Name */ + AUTH_DROP_TEMP_VIEW AuthorizerActionCode = 15 /* View Name NULL */ + AUTH_DROP_TRIGGER AuthorizerActionCode = 16 /* Trigger Name Table Name */ + AUTH_DROP_VIEW AuthorizerActionCode = 17 /* View Name NULL */ + AUTH_INSERT AuthorizerActionCode = 18 /* Table Name NULL */ + AUTH_PRAGMA AuthorizerActionCode = 19 /* Pragma Name 1st arg or NULL */ + AUTH_READ AuthorizerActionCode = 20 /* Table Name Column Name */ + AUTH_SELECT AuthorizerActionCode = 21 /* NULL NULL */ + AUTH_TRANSACTION AuthorizerActionCode = 22 /* Operation NULL */ + AUTH_UPDATE AuthorizerActionCode = 23 /* Table Name Column Name */ + AUTH_ATTACH AuthorizerActionCode = 24 /* Filename NULL */ + AUTH_DETACH AuthorizerActionCode = 25 /* Database Name NULL */ + AUTH_ALTER_TABLE AuthorizerActionCode = 26 /* Database Name Table Name */ + AUTH_REINDEX AuthorizerActionCode = 27 /* Index Name NULL */ + AUTH_ANALYZE AuthorizerActionCode = 28 /* Table Name NULL */ + AUTH_CREATE_VTABLE AuthorizerActionCode = 29 /* Table Name Module Name */ + AUTH_DROP_VTABLE AuthorizerActionCode = 30 /* Table Name Module Name */ + AUTH_FUNCTION AuthorizerActionCode = 31 /* NULL Function Name */ + AUTH_SAVEPOINT AuthorizerActionCode = 32 /* Operation Savepoint Name */ + AUTH_COPY AuthorizerActionCode = 0 /* No longer used */ + AUTH_RECURSIVE AuthorizerActionCode = 33 /* NULL NULL */ ) // AuthorizerReturnCode are the integer codes diff --git a/tests/conn_test.go b/tests/conn_test.go index f2937fa9..2e3dbeaa 100644 --- a/tests/conn_test.go +++ b/tests/conn_test.go @@ -6,7 +6,6 @@ import ( "math" "os" "path/filepath" - "reflect" "strings" "testing" @@ -111,41 +110,6 @@ func TestConn_Close_BUSY(t *testing.T) { } } -func TestConn_Pragma(t *testing.T) { - t.Parallel() - - db, err := sqlite3.Open("file::memory:?_pragma=busy_timeout(1000)") - if err != nil { - t.Fatal(err) - } - defer db.Close() - - got, err := db.Pragma("busy_timeout") - if err != nil { - t.Fatal(err) - } - want := []string{"1000"} - - if !reflect.DeepEqual(got, want) { - t.Errorf("got %v, want %v", got, want) - } - - var serr *sqlite3.Error - _, err = db.Pragma("+") - if err == nil { - t.Error("want: error") - } - if !errors.As(err, &serr) { - t.Fatalf("got %T, want sqlite3.Error", err) - } - if rc := serr.Code(); rc != sqlite3.ERROR { - t.Errorf("got %d, want sqlite3.ERROR", rc) - } - if got := err.Error(); got != `sqlite3: SQL logic error: near "+": syntax error` { - t.Error("got message:", got) - } -} - func TestConn_SetInterrupt(t *testing.T) { t.Parallel() diff --git a/txn.go b/txn.go index 263c0d93..0f96f3b8 100644 --- a/txn.go +++ b/txn.go @@ -230,9 +230,6 @@ func (c *Conn) TxnState(schema string) TxnState { return TxnState(r) } -// Deprecated: renamed for consistency with [Conn.TxnState]. -type Tx = Txn - // CommitHook registers a callback function to be invoked // whenever a transaction is committed. // Return true to allow the commit operation to continue normally. diff --git a/vtab.go b/vtab.go index 4fb63223..982b1d48 100644 --- a/vtab.go +++ b/vtab.go @@ -206,9 +206,6 @@ type VTabTxn interface { Rollback() error } -// Deprecated: renamed for consistency with [Conn.TxnState]. -type VTabTx = VTabTxn - // A VTabSavepointer allows a virtual table to implement // nested transactions. //