Download the PHP package myneid/laravel-db-tui without Composer

On this page you can find all versions of the php package myneid/laravel-db-tui. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-db-tui

laravel-db-tui

I built this because I kept getting frustrated bouncing between TablePlus, my terminal, and VSCode just to check on data or run a quick query. SSHing into a server to use the MySQL CLI is painful, and switching apps constantly breaks the flow. I wanted something that lived right in the console — where I already spend most of my time — that could handle the things I actually reach for a GUI to do: browse tables, sort, inspect a row, edit a value, run ad-hoc SQL. This is that tool.

An interactive terminal UI for browsing and editing your Laravel application's database — or any remote MySQL, PostgreSQL, or SQLite database — without leaving the command line.

Features

Requirements

Installation

Laravel's package auto-discovery will register the db:tui command automatically. No service provider registration needed.

First time publishing this package? Replace myneid with your actual Packagist vendor name in composer.json and in all namespace declarations across the src/ files.

Quick start

Usage

Option Description
--connection=<name> Use a named connection from config/database.php (e.g. mysql, pgsql, sqlite)
--url=<url> Connect to a remote database via URL — bypasses Laravel's config entirely
--save-as=<name> Save the --url connection under a name for future use
--saved=<name> Connect using a previously saved connection
--list-saved Print all saved connection names and exit
--forget=<name> Remove a saved connection and exit

--url format

Passwords with special characters should be URL-encoded (e.g. p@ss → p%40ss).

Saved connections

Connection URLs (including passwords) are stored in ~/.laravel-db-tui.json in your home directory. This file is never inside a project, so it cannot be accidentally committed.

Key bindings

Tables panel (left)

Key Action
↑ / k Move up
↓ / j Move down
Enter, Tab, → Load the selected table and switch focus to the data panel
s, :, Ctrl+E Open SQL popup
q / Ctrl+C Quit

Data panel (right)

Columns are fixed-width (sized from their header/content, capped at 40 chars by default) instead of being split evenly, so a short id column doesn't get the same width as a long email column. When the visible columns are wider than the panel, the title shows ←N/→N for how many columns are scrolled off each side.

Key Action
↑ / k Previous row
↓ / j Next row
Enter Open row detail view
Tab, ←, Shift+Tab Switch focus to the table list
[ / ] Scroll columns left/right
c Open the Columns popup (show/hide, resize)
1–9 Sort by the Nth visible column (press again to toggle ASC ↔ DESC)
PgUp / p Previous page
PgDn / n Next page
Home First page, first row
End Last page, last row
s, :, Ctrl+E Open SQL popup
q / Ctrl+C Quit

Columns popup

Opened with c from the data panel. Lists every column on the current table with a checkbox and its current width.

Key Action
↑ / k Previous column
↓ / j Next column
Space / Enter Show/hide the selected column (at least one must stay visible)
← / - Narrow the selected column
→ / + Widen the selected column
r Reset the selected column back to its auto-computed width
Esc Close and return to the data panel

Hidden columns and custom widths are remembered per table for the rest of the session.

Row detail view

Fields are word-wrapped. Edited-but-unsaved fields are shown in yellow with a ● marker. The title bar shows [UNSAVED CHANGES] when there is anything pending.

Key Action
↑ / k Move to previous field
↓ / j Move to next field
e or Enter Start editing the focused field
Backspace Delete last character (while editing)
Enter Confirm the edit — marks field as dirty
Esc Cancel the current edit without saving
s Save all dirty fields to the database (UPDATE)
Esc (not editing) Back to data panel
q Quit

Storing null: type the literal word NULL (uppercase) in the edit buffer and confirm — the field will be written as a database NULL.

Saving uses the table's primary key as the WHERE clause when one is detected, and falls back to matching all original column values if no primary key is found.

SQL editor

Key Action
Type normally Build your query
Backspace Delete last character
Tab Accept the selected suggestion
↑ / ↓ Move through suggestions (or results when no suggestions are shown)
Enter Execute the query
Esc Close popup and return to previous mode

Autocomplete is context-aware:

Non-SELECT statements (INSERT, UPDATE, DELETE, CREATE, etc.) are supported — the results panel shows the number of affected rows.

SQL result row detail

Click any result row to open the same full key/value edit view used for table rows (see Row detail (edit mode) below).

Key Action
↑ / k Previous field
↓ / j Next field
e / Enter Edit the focused field
s Save staged changes
y Copy the focused field
Esc Back to SQL results
q Quit

Editing is only enabled when the query is a plain SELECT from a single table (no JOIN, and every selected column maps to a real column on that table). Anything else — joins, computed/aliased columns, non-SELECT statements — opens the same view read-only, marked [READ-ONLY] in the title.

Mouse

Action Effect
Scroll up/down Navigate rows or tables in the focused panel
Click a table name Select that table and load its data
Click a data row Select that row
Click a selected row Open row detail view
Click a SQL result row Open that row's detail view

UI panels

Browse mode

The active panel is indicated by a double-line border (╔═╗) and brackets around the title. Inactive panels use a rounded border (╭─╮).

Row detail (edit mode)

Architecture

The package follows a simple four-layer design:

State machine (App): The Mode enum drives which key bindings are active and which panel is rendered. State transitions are:

Editing (App): Row detail tracks editFieldIndex, isEditing, editBuffer, and dirtyValues. Confirming an edit stages the change in dirtyValues; pressing s flushes all staged changes in a single UPDATE statement and refreshes the page. Row and SqlRow share this same mechanism — SqlRow resolves its target table via sqlResultTable, detected from the executed SQL (null when the query isn't a single plain table, which disables saving).

Column layout (App): columnWidths and hiddenColumns are override maps keyed by "table.column", so preferences are scoped per table. Auto-computed default widths are cached in defaultColumnWidths whenever a page of rows is fetched (based on header/content length, capped at 40 chars); columnWidth() returns the user override if one exists, otherwise the cached default. The Data table only sends Renderer as many fixed-width columns as fit the panel, starting at columnOffset, so a wide table scrolls horizontally instead of every column being squeezed into an even percentage.

Rendering (Renderer): Stateless — called every frame (~60 fps), reads App and builds a GridWidget tree. It also receives the current terminal width (fetched each frame in DbTuiCommand) so the Data table can decide how many fixed-width columns fit. php-tui diffs the widget tree against the previous frame before writing to the terminal.

Database (PdoConnection): Raw PDO only — no Eloquent, no query builder. Identifiers are quoted per-driver to prevent injection from schema-derived names. Raw SQL mode executes user input directly (intentional for a developer tool). updateRow() uses the primary key as the WHERE predicate when available.

Performance (App): While the TUI is open, per-table metadata (columns, COUNT(*)) and fetched pages are cached in memory. Moving through the table list no longer eagerly loads every highlighted table; load happens when you open a table with Enter/Tab/→ (or click into the data panel).

Customising

Page size

The default page size is 200 rows. To change it, set $app->limit before calling $app->init() in DbTuiCommand::handle():

Adding a connection type

PdoConnection handles the three standard drivers. To add another (e.g. SQL Server via sqlsrv), extend PdoConnection and override getTables(), getColumns(), getPrimaryKey(), and qi().

License

MIT — do whatever you want with it.


All versions of laravel-db-tui with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
php-tui/php-tui Version ^0.2
illuminate/support Version ^10.0|^11.0|^12.0|^13.0
illuminate/console Version ^10.0|^11.0|^12.0|^13.0
illuminate/database Version ^10.0|^11.0|^12.0|^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package myneid/laravel-db-tui contains the following files

Loading the files please wait ...