mirror of
https://github.com/taigrr/teaqlite.git
synced 2026-04-02 04:59:03 -07:00
fixup, add docs
This commit is contained in:
@@ -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
2
internal/app/doc.go
Normal file
@@ -0,0 +1,2 @@
|
||||
// Package app provides the main application logic for the sqlite browser.
|
||||
package app
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user