https://github.com/mathaou/termdbms Skip to content Toggle navigation Sign in * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code Explore + All features + Documentation + GitHub Skills + Blog * Solutions For + Enterprise + Teams + Startups + Education By Solution + CI/CD & Automation + DevOps + DevSecOps Resources + Learning Pathways + White papers, Ebooks, Webinars + Customer Stories + Partners * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles Repositories + Topics + Trending + Collections * Pricing Search or jump to... Search code, repositories, users, issues, pull requests... Search [ ] Clear Search syntax tips Provide feedback We read every piece of feedback, and take your input very seriously. [ ] [ ] Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Name [ ] Query [ ] To see all available qualifiers, see our documentation. Cancel Create saved search Sign in Sign up You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} mathaou / termdbms Public * Notifications * Fork 33 * Star 1.4k A TUI for viewing and editing database files. License MIT license 1.4k stars 33 forks Activity Star Notifications * Code * Issues 3 * Pull requests 0 * Discussions * Actions * Projects 0 * Security * Insights Additional navigation options * Code * Issues * Pull requests * Discussions * Actions * Projects * Security * Insights mathaou/termdbms This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. master Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags Name already in use A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch? Cancel Create 2 branches 4 tags Code * Local * Codespaces * Clone HTTPS GitHub CLI [https://github.com/m] Use Git or checkout with SVN using the web URL. [gh repo clone mathao] Work fast with our official CLI. Learn more about the CLI. * Open with GitHub Desktop * Download ZIP Sign In Required Please sign in to use Codespaces. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching Xcode If nothing happens, download Xcode and try again. Launching Visual Studio Code Your codespace will open once ready. There was a problem preparing your codespace, please try again. Latest commit @mathaou mathaou Update README.md ... be6f397 Jun 11, 2022 Update README.md be6f397 Git stats * 105 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time .github/workflows Create codeql-analysis.yml October 5, 2021 09:58 database Rename package to github.com/mathaou/termdbms April 15, 2022 13:02 list Rename package to github.com/mathaou/termdbms April 15, 2022 13:02 tuiutil Rename package to github.com/mathaou/termdbms April 15, 2022 13:02 viewer Rename package to github.com/mathaou/termdbms April 15, 2022 13:02 .gitignore fixed navigation and updated readme September 9, 2021 15:42 CHANGELOG.txt added clipboard removal and other various cleanup October 5, 2021 09:50 LICENSE added license September 2, 2021 09:50 README.md Update README.md June 11, 2022 11:15 go.mod Rename package to github.com/mathaou/termdbms April 15, 2022 13:02 go.sum added support for csv files October 29, 2021 08:52 main.go Rename package to github.com/mathaou/termdbms April 15, 2022 13:02 View code [ ] termdbms A TUI for viewing and editing databases, written in pure Go Installation Instructions Go Install Arch Linux Database Support made with modernc.org/sqlite, charmbracelet/bubbletea, and charmbracelet/ lipgloss Works with keyboard and mouse! Navigate tables with any number of columns! Navigate tables with any number of rows! Serialize your changes as a copy or over the database original! (SQLite only) Query your database! Other Features Roadmap Linux ARM (runs kind of slow depending on the specs of the system) Windows OSX Terminal settings Known Issues Help: Controls: MOUSE KEYBOARD EDIT MODE (for quick, single line changes and commands) FORMAT MODE (for editing lines of text) SQL MODE (for querying database) QUERY MODE (specifically when viewing query results) README.md termdbms A TUI for viewing and editing databases, written in pure Go Installation Instructions Go Install go install github.com/mathaou/termdbms@latest Arch Linux // pacman sudo pacman -S termdbms-git // yay yay -S termdbms-git --------------------------------------------------------------------- Database Support SQLite CSV* (see note below) made with modernc.org/sqlite, charmbracelet/bubbletea, and charmbracelet/lipgloss Works with keyboard and mouse! Keyboard Control Navigate tables with any number of columns! Columns and Tables Navigate tables with any number of rows! Lot of Rows Serialize your changes as a copy or over the database original! (SQLite only) Serialization Query your database! querying Other Features * Run SQL queries and display the results! * Save SQL queries to a clipboard! * Update, delete, or insert with SQL, with undo/redo supported for SQLite * Automatic JSON formatting in selection/format mode * Edit multi-line text with vim-like controls * Undo/Redo of changes (SQLite only) * Themes (press T in table mode) * Output query results as a csv * Convert .csv to SQLite database! Export as a SQLite database or .csv file again! Roadmap * MySQL/ PostgreSQL support * Line wrapping / horizontal scroll for format/SQL mode + revamped (faster format mode) How To Build Linux GOOS=linux GOARCH=amd64/386 go build ARM (runs kind of slow depending on the specs of the system) GOOS=linux GOARCH=arm GOARM=7 go build Windows GOOS=windows GOARCH=amd64/386 go build OSX GOOS=darwin GOARCH=amd64 go build Terminal settings Whatever terminal emulator used should support ANSI escape sequences. If there is an option for 256 color mode, enable it. If not available, try running program in ascii mode (-a). Known Issues * Using termdbms over a serial connection works very poorly. This is due to ANSI sequences not being supported natively. Maybe putty/mobaxterm have settings to allow this? * The headers wig out sometimes in selection mode * Line wrapping is not yet implemented, so text in format mode should be less than the maximum number of columns available per line for best use. It's in the works! * Weird combinations of newlines + tabs can break stuff. Tabs at beginning of line and mid-line works in a stable manner. Help: -p / database/.csv path -d / specifies which database driver to use (sqlite/mysql) -a / enable ascii mode -h / prints this message -t / starts app with specific theme (default, nord, solarized) Controls: MOUSE Scroll up + down to navigate table/text Move cursor to select cells for full screen viewing KEYBOARD [WASD] to move around cells, and also move columns if close to edge [ENTER] to select selected cell for full screen view [UP/K and DOWN/J] to navigate schemas [LEFT/H and RIGHT/L] to navigate columns if there are more than the screen allows. Also to control the cursor of the text editor in edit mode [BACKSPACE] to delete text before cursor in edit mode [M(scroll up) and N(scroll down)] to scroll manually [Q or CTRL+C] to quit program [B] to toggle borders! [C] to expand column [T] to cycle through themes! [P] in selection mode to write cell to file, or to print query results as CSV. [R] to redo actions, if applicable [U] to undo actions, if applicable [ESC] to exit full screen view, or to enter edit mode [PGDOWN] to scroll down one views worth of rows [PGUP] to scroll up one views worth of rows EDIT MODE (for quick, single line changes and commands) [ESC] to enter edit mode with no pre-loaded text input from selection When a cell is selected, press [:] to enter edit mode with selection pre-loaded The text field in the header will be populated with the selected cells text. Modifications can be made freely [ESC] to clear text field in edit mode [ENTER] to save text. Anything besides one of the reserved strings below will overwrite the current cell [:q] to exit edit mode/ format mode/ SQL mode [:s] to save database to a new file (SQLite only) [:s!] to overwrite original database file (SQLite only). A confirmation dialog will be added soon [:h] to display help text [:new] opens current cell with a blank buffer [:edit] opens current cell in format mode [:sql] opens blank buffer for creating an SQL statement [:clip] to open clipboard of SQL queries. [/] to filter, [ENTER] to select. [HOME] to set cursor to end of the text [END] to set cursor to the end of the text FORMAT MODE (for editing lines of text) [ESC] to move between top control bar and format buffer [HOME] to set cursor to end of the text [END] to set cursor to the end of the text [:wq] to save changes and quit to main table view [:w] to save changes and remain in format view [:s] to serialize changes, non-destructive (SQLite only) [:s!] to serialize changes, overwriting original file (SQLite only) SQL MODE (for querying database) [ESC] to move between top control bar and text buffer [:q] to quit out of statement [:exec] to execute statement. Errors will be displayed in full screen view. [:stow ] to create a snippet for the clipboard with an optional name. A random number will be used if no name is specified. QUERY MODE (specifically when viewing query results) [:d] to reset table data back to original view [:sql] to query original database again About A TUI for viewing and editing database files. Topics golang terminal database sqlite tui terminal-based Resources Readme License MIT license Activity Stars 1.4k stars Watchers 12 watching Forks 33 forks Report repository Releases 4 tags Contributors 3 * @meowgorithm meowgorithm Christian Rocha * @alphatroya alphatroya Alexey Korolev * @mathaou mathaou Matt Farstad Languages * Go 100.0% Footer (c) 2023 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact * Manage cookies * Do not share my personal information You can't perform that action at this time.