Allow setting readonly mode in bookmarks (#707)

This commit is contained in:
Dan Sosedoff
2024-01-12 21:17:14 -06:00
committed by GitHub
parent e560f07de6
commit 408e23adb3
4 changed files with 40 additions and 16 deletions

View File

@@ -679,6 +679,14 @@ func testReadOnlyMode(t *testing.T) {
_, err = client.Query("/* CREATE TABLE foobar(id integer); */ SELECT 'foo';")
assert.NoError(t, err)
t.Run("with local readonly flag", func(t *testing.T) {
command.Opts.ReadOnly = false
client.readonly = true
_, err := client.Query("INSERT INTO foobar(id) VALUES(1)")
assert.Error(t, err, "query contains keywords not allowed in read-only mode")
})
}
func testTablesStats(t *testing.T) {