AI prompts
base on A TUI for viewing and editing database files. # termdbms
## A TUI for viewing and editing databases, written in pure Go
#### Installation Instructions
###### Go Install
```go
go install github.com/mathaou/termdbms@latest
```
###### Arch Linux
```bash
// 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](https://i.imgur.com/vmK0DVn.gif)
#### Navigate tables with any number of columns!
![Columns and Tables](https://i.imgur.com/EqZRPqO.gif)
#### Navigate tables with any number of rows!
![Lot of Rows](https://i.imgur.com/yo7DMaa.gif)
#### Serialize your changes as a copy or over the database original! (SQLite only)
![Serialization](https://i.imgur.com/GhMcnid.gif)
#### Query your database!
![querying](https://i.imgur.com/9FB3ETs.gif)
#### 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)
####
<details>
<summary>How To Build</summary>
##### 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
</details>
#### 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 <NAME>] 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
", Assign "at most 3 tags" to the expected json: {"id":"6333","tags":[]} "only from the tags list I provide: [{"id":77,"name":"3d"},{"id":89,"name":"agent"},{"id":17,"name":"ai"},{"id":54,"name":"algorithm"},{"id":24,"name":"api"},{"id":44,"name":"authentication"},{"id":3,"name":"aws"},{"id":27,"name":"backend"},{"id":60,"name":"benchmark"},{"id":72,"name":"best-practices"},{"id":39,"name":"bitcoin"},{"id":37,"name":"blockchain"},{"id":1,"name":"blog"},{"id":45,"name":"bundler"},{"id":58,"name":"cache"},{"id":21,"name":"chat"},{"id":49,"name":"cicd"},{"id":4,"name":"cli"},{"id":64,"name":"cloud-native"},{"id":48,"name":"cms"},{"id":61,"name":"compiler"},{"id":68,"name":"containerization"},{"id":92,"name":"crm"},{"id":34,"name":"data"},{"id":47,"name":"database"},{"id":8,"name":"declarative-gui "},{"id":9,"name":"deploy-tool"},{"id":53,"name":"desktop-app"},{"id":6,"name":"dev-exp-lib"},{"id":59,"name":"dev-tool"},{"id":13,"name":"ecommerce"},{"id":26,"name":"editor"},{"id":66,"name":"emulator"},{"id":62,"name":"filesystem"},{"id":80,"name":"finance"},{"id":15,"name":"firmware"},{"id":73,"name":"for-fun"},{"id":2,"name":"framework"},{"id":11,"name":"frontend"},{"id":22,"name":"game"},{"id":81,"name":"game-engine "},{"id":23,"name":"graphql"},{"id":84,"name":"gui"},{"id":91,"name":"http"},{"id":5,"name":"http-client"},{"id":51,"name":"iac"},{"id":30,"name":"ide"},{"id":78,"name":"iot"},{"id":40,"name":"json"},{"id":83,"name":"julian"},{"id":38,"name":"k8s"},{"id":31,"name":"language"},{"id":10,"name":"learning-resource"},{"id":33,"name":"lib"},{"id":41,"name":"linter"},{"id":28,"name":"lms"},{"id":16,"name":"logging"},{"id":76,"name":"low-code"},{"id":90,"name":"message-queue"},{"id":42,"name":"mobile-app"},{"id":18,"name":"monitoring"},{"id":36,"name":"networking"},{"id":7,"name":"node-version"},{"id":55,"name":"nosql"},{"id":57,"name":"observability"},{"id":46,"name":"orm"},{"id":52,"name":"os"},{"id":14,"name":"parser"},{"id":74,"name":"react"},{"id":82,"name":"real-time"},{"id":56,"name":"robot"},{"id":65,"name":"runtime"},{"id":32,"name":"sdk"},{"id":71,"name":"search"},{"id":63,"name":"secrets"},{"id":25,"name":"security"},{"id":85,"name":"server"},{"id":86,"name":"serverless"},{"id":70,"name":"storage"},{"id":75,"name":"system-design"},{"id":79,"name":"terminal"},{"id":29,"name":"testing"},{"id":12,"name":"ui"},{"id":50,"name":"ux"},{"id":88,"name":"video"},{"id":20,"name":"web-app"},{"id":35,"name":"web-server"},{"id":43,"name":"webassembly"},{"id":69,"name":"workflow"},{"id":87,"name":"yaml"}]" returns me the "expected json"