modernize, fixup docstring

This commit is contained in:
2025-07-13 20:41:43 -07:00
parent d7c9c055a0
commit 96b10e7b00
3 changed files with 9 additions and 9 deletions

View File

@@ -1,2 +1,2 @@
// package cmd provides the Cobra command-line interface for the TeaQLite application.
// Package cmd provides the Cobra command-line interface for the TeaQLite application.
package cmd

View File

@@ -7,8 +7,8 @@ import (
"strings"
"sync/atomic"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/bubbles/key"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/lipgloss"
_ "modernc.org/sqlite" // Import SQLite driver
)
@@ -26,7 +26,7 @@ func nextID() int {
// Common message types
type blinkMsg struct{}
// KeyMap defines the keybindings for the application
// AppKeyMap defines the keybindings for the application
type AppKeyMap struct {
Quit key.Binding
Suspend key.Binding
@@ -468,6 +468,7 @@ var (
)
// Utility functions
func TruncateString(s string, maxLen int) string {
if len(s) <= maxLen {
return s

View File

@@ -5,10 +5,10 @@ import (
"strings"
"time"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/bubbles/help"
"github.com/charmbracelet/bubbles/key"
"github.com/charmbracelet/bubbles/textarea"
tea "github.com/charmbracelet/bubbletea"
)
type QueryModel struct {
@@ -252,9 +252,7 @@ func (m *QueryModel) ensureIDColumns(query string) string {
// Add primary keys to the beginning
var pkList []string
for _, pk := range primaryKeys {
pkList = append(pkList, pk)
}
pkList = append(pkList, primaryKeys...)
newSelectClause := strings.Join(pkList, ", ") + ", " + selectClause
@@ -458,3 +456,4 @@ func (m *QueryModel) View() string {
return content.String()
}