fixup, add docs

This commit is contained in:
2025-07-12 22:49:05 -07:00
parent 686cb97eb3
commit 001992a688
9 changed files with 21 additions and 70 deletions

View File

@@ -32,7 +32,7 @@ type (
ExecuteQueryMsg struct{ Query string }
)
// Main application model
// Model is the main application model
type Model struct {
db *sql.DB
currentView tea.Model
@@ -41,7 +41,7 @@ type Model struct {
err error
}
// Shared data that all models need access to
// SharedData that all models need access to
type SharedData struct {
DB *sql.DB
Tables []string
@@ -602,4 +602,5 @@ func (m *Model) getSharedData() *SharedData {
// Fallback - create new shared data
return NewSharedData(m.db)
}
}
}

2
internal/app/doc.go Normal file
View File

@@ -0,0 +1,2 @@
// Package app provides the main application logic for the sqlite browser.
package app

View File

@@ -6,7 +6,6 @@ import (
tea "github.com/charmbracelet/bubbletea"
)
// Edit Cell Model
type EditCellModel struct {
Shared *SharedData
rowIndex int
@@ -88,4 +87,5 @@ func (m *EditCellModel) View() string {
content += HelpStyle.Render("enter: save • esc: cancel")
return content
}
}

View File

@@ -7,7 +7,6 @@ import (
tea "github.com/charmbracelet/bubbletea"
)
// Query Model
type QueryModel struct {
Shared *SharedData
query string
@@ -228,4 +227,5 @@ func (m *QueryModel) View() string {
}
return content.String()
}
}

View File

@@ -7,7 +7,6 @@ import (
tea "github.com/charmbracelet/bubbletea"
)
// Row Detail Model
type RowDetailModel struct {
Shared *SharedData
rowIndex int
@@ -68,4 +67,5 @@ func (m *RowDetailModel) View() string {
content.WriteString(HelpStyle.Render("e: edit • q: back"))
return content.String()
}
}

View File

@@ -7,7 +7,6 @@ import (
tea "github.com/charmbracelet/bubbletea"
)
// Table Data Model
type TableDataModel struct {
Shared *SharedData
selectedRow int
@@ -202,4 +201,5 @@ func (m *TableDataModel) View() string {
}
return content.String()
}
}

View File

@@ -7,7 +7,6 @@ import (
tea "github.com/charmbracelet/bubbletea"
)
// Table List Model
type TableListModel struct {
Shared *SharedData
searchInput string
@@ -195,4 +194,5 @@ func (m *TableListModel) View() string {
}
return content.String()
}
}