@@ -125,14 +125,15 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
125125 }
126126
127127 case "h" :
128- if m .focus == focusInput {
128+ if m .focus == focusInput && ! m . showHelp {
129129 m .input , cmd = m .input .Update (msg )
130130 return m , cmd
131131 }
132132 m .showHelp = ! m .showHelp
133133 if m .showHelp {
134134 m .showDetail = false
135135 }
136+ return m , nil
136137
137138 case "c" :
138139 if m .focus == focusTable && m .result != nil {
@@ -196,6 +197,10 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
196197 }
197198
198199 case "esc" :
200+ if m .showHelp {
201+ m .showHelp = false
202+ return m , nil
203+ }
199204 if m .showDetail {
200205 m .showDetail = false
201206 return m , nil
@@ -444,6 +449,13 @@ func (m Model) helpView() string {
444449 tutorial .Render (" SELECT * FROM users WHERE age > 18;" ),
445450 tutorial .Render (" -- Join tables" ),
446451 tutorial .Render (" SELECT u.name, p.title FROM users u JOIN posts p ON u.id = p.user_id;" ),
452+ "" ,
453+ tutorial .Render (" -- Create / Insert / Update / Delete" ),
454+ tutorial .Render (" CREATE TABLE items (id INTEGER PRIMARY KEY, name TEXT);" ),
455+ tutorial .Render (" INSERT INTO items (name) VALUES ('Laptop'), ('Mouse');" ),
456+ tutorial .Render (" UPDATE items SET name = 'Mechanical Mouse' WHERE id = 2;" ),
457+ tutorial .Render (" DELETE FROM items WHERE id = 1;" ),
458+ "" ,
447459 tutorial .Render (" -- SQLite Meta: List Tables / Schema" ),
448460 tutorial .Render (" SELECT name FROM sqlite_master WHERE type='table';" ),
449461 tutorial .Render (" PRAGMA table_info(table_name); -- Describe table" ),
0 commit comments