Help home > Tables

Tables

When you open a table or view, you can switch between three views: Definition, Data and DDL. You can also create tables in a GUI.

What you can do

ViewContents
DefinitionColumns (logical name, physical name, type, NULL, default, description), indexes and foreign keys. You can edit logical names (except in SQLite).
DataShows and edits the data in a grid. Narrow down rows with WHERE, ORDER BY or the GUI filter.
DDLThe SQL that creates the table, including comment definitions. For a view, the view definition.

In the tree, double-clicking a table opens its data; double-clicking a view opens its definition. Generate SELECT opens a SELECT statement in a SQL tab, with each column commented with its logical name.

Definition

Editing data

  1. Change values, add and delete rows

    Type or paste into cells (see Working with grids), click + Add Row, or select rows and click - Delete Row. NULL sets the selected cells to NULL.
  2. Review your changes

    Changed cells are yellow, added rows are green (row number "+"), and rows to be deleted are red with a strikethrough (row number "×"). The footer shows "X rows with unapplied changes", Apply pulses in blue, and Revert turns red.
  3. Apply

    Apply runs INSERT, UPDATE and DELETE statements, using the primary key as the condition. Revert discards all changes.
Tables without a primary keyUpdates and deletes target rows whose values match in every column (you are asked to confirm). If several rows have identical values, all of them change.
In manual commit modeApplying alone does not commit the changes. Click Commit in the SQL tab.

Columns you leave empty (still NULL) are left out of the INSERT, so the database fills in defaults and auto-increment values.

Filtering

▽ Filter shows the filter panel (closing it keeps the conditions). Choose a column, a value and an operator, then click Apply or press Enter to reload. You can also add conditions by right-clicking a cell and choosing "Filter by …" or "Exclude …".

OperatorMeaning
= ≠ > ≥ < ≤Compares with the value
contains, starts with, ends with, does not containMatches part of the text (% and _ act as wildcards)
is one of, is none ofAny of the comma-separated values
betweenBetween two values (inclusive)
is NULL, is not NULLThe value is missing / present

"Match all (AND)" or "Match any (OR)" sets how conditions are combined. Unchecked conditions are ignored. The filter is combined with the WHERE box at the top using AND.

DDL

Musubi SQL builds the CREATE TABLE, comment and index SQL from the table definition, in the dialect of the selected connection (for SQLite, the CREATE statement stored in the database). Open in SQL Tab lets you edit and run it.

Creating a table in the GUI

Right-click a schema in the tree and choose "Create New Table (GUI)...", or open it from a new entity in an ER diagram.

Altering a table in the GUI

Right-click a table in the tree and choose "Alter Table (GUI)...", or click Alter (GUI) in the table tab. The screen is the same as Creating a table in the GUI and starts from the current definition.

Changes the database can't make with ALTER are written out as "-- " comments (in SQLite: column type, NOT NULL, default, foreign keys and primary key; in SQL Server Compact: column names; and turning auto increment on or off). In those cases, recreate the table.

Generating test data

Right-click a table in the tree and choose "Generate Test Data...". Choose a row count and a generation method for each column, and Musubi SQL INSERTs many rows at once. Use it for performance testing or checking screens.

MethodValues
Not specified (default)The column is left out of the INSERT, so it gets its default or auto-increment value. Auto-increment columns start with this method
NULLNULL
SequenceStarts at Start and increases by Step. Text columns can have a "Prefix" and "Digits" (zero-padded); for example, prefix E and 4 digits give E0001. Date columns advance one day at a time from the base date
RandomNumbers, dates and times between Min and Max; text is alphanumeric with the given length
Fixed valueThe same value in every row
Pick from listPicks randomly from comma-separated values (for example, Tokyo,Osaka,Nagoya; write NULL for NULL)
Parent table valuesPicks randomly from the values in the table that the foreign key references, so parent-child relationships stay valid. For multi-column foreign keys, the values come from the same parent row
UUIDA random UUID

For nullable columns, "NULL %" sets the share of NULLs. Settings are remembered per table and reused the next time you open it.

Duplicate primary keysWhen a numeric primary key uses "Sequence", it starts after the current maximum, so there are no duplicates. Use "Sequence" for columns with unique keys too.
Delete existing data before insertingWhen on, Musubi SQL first DELETEs every row in the table. This can't be undone, so use it only on test databases. In manual commit mode, commit in the SQL tab when it finishes.

Importing data (CSV / Excel)

Right-click a table in the tree and choose "Import Data (CSV / Excel)...", or click Import... in the table tab.

  1. Click Choose File... and pick a CSV, TSV, text or Excel (.xlsx) file. For CSV, the encoding (UTF-8 / Shift_JIS) and delimiter are detected automatically; change them if they are wrong. For Excel, you can choose the sheet.
  2. For each table column, choose the file column to import. Columns whose header matches the physical or logical name are selected automatically. Columns set to "(Don't import)" are left out of the INSERT (they get their default or auto-increment value).
  3. Import INSERTs 1000 rows at a time. You can stop with Abort. Show SQL (Don't Run) puts the INSERT statements in a SQL tab instead.

In auto-commit mode, if an error occurs partway, the rows imported up to that point stay in the table. If you want to be able to start over, switch to manual commit before importing.

FAQ

There is no "Apply" button

You can't edit the data of views, materialized views or read-only connections.

I can't edit logical names in SQLite, or they don't appear

SQLite has no comment feature, so you can't edit them in the app. Logical names are read from line comments in the CREATE TABLE statement (-- Employee ID). See Logical names in SQLite for the format.

The row count stops partway

Only up to the maximum row count is fetched. Filter the rows, or raise the maximum row count in the settings.

▲ Back to top

← Musubi SQL website (download)