Skip to content

ehfeng/ted

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

174 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ted logo

ted displays database tables as markdown table and provides spreadsheet-like editing, including mouse support for selecting/editing cells.

ted demo

ted [dbname] [tbl]
ted test users
ted --pg test users
ted --pg test --sql "select * from users"

dbname can either be a database file (sqlite or duckdb) or a database name.

Installation

brew tap ehfeng/ted
brew install ted

Common cli flags

Connection info

  • -d or --database
  • -h or --host
  • -p or --port
  • -u or --username
  • --password

Database shorthands

  • --postgres or --pg
  • --mysql or --my

Supported keyboard shortcuts

Navigation

  1. tab
  2. shift+tab
  3. arrows
  4. home
  5. end
  6. page up
  7. page down
  8. ctrl+home/end*
  9. home/end
  10. cmd+page up/down (fn+cmd+up/down for mac users)

*cmd+up/down are captured by Ghostty

Data

  1. enter: edit/down/new row (if at bottom)
  2. esc: exit from editing, discarding changes
  3. ctrl+f: find in column
  4. alt+←/→: rearranges column display order
  5. ctrl+</>: increase/decrease column width
  6. ctrl+q: exit
  7. ctrl+r: start insert row
  8. ctrl+enter: execute insert row
  9. ctrl+del: delete row
  10. shift+enter: start tx
  11. shift+enter: commit tx
  12. ctrl+c: rollback tx

vim

  1. hjkl: arrows

  2. g: home

  3. G: end

  4. ctrl+b: page up

  5. i: edit mode

  6. a: append mode

Mouse

You can select cells, resize columns, and scroll with the mouse.

Non-goals

Schema changes. ted is for browsing and editing data, schema changes better done in dedicated clients

Filtering: better to use Find to jump to the value.

Sorting: better to use views and ORDER BY

Development

# initial
go install
ted completion zsh > /usr/local/share/zsh/site-functions/_ted
exec zsh

# development
make watch
ted test.db users 2>/tmp/ted.log
tail -f /tmp/ted.log

# testing completions
ted __complete "pg" "t" 2>&1

Release

git tag -a v0.1.2 -m "Release notes"
git push origin v0.1.2

About

tabular editor cli

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •