Context menu

So called "Context" is the set of operation you can use for the selected object in the object tree browser. You can use the alternative access to this menu by the right mouse button (for right handed mouse).

Not all operations are available for all database objects.

Create Table...

Raise a dialog for table creation. You can use two ways to create table here.

First – as you see in the screenshot – you can create a table with mouse and only a few keyboard typing in the "Design" tab. And the second one by pure SQL statement.

  • Database: a combobox with databases attached. Select one and the table will be created in this schema.
  • Table Name: name of new table. It must be given.
  • Columns: use "Add" and "Remove" buttons to create columns for this table. Every column must have a table-unique name, chosen data type (prepared combobox), optional NOT NULL constraint, and optional DEFAULT value. Consult Sqlite documentation for data type, NOT NULL, and DEFAULT handling specials, please.
  • Create: press this button to create table. The result of this operation is shown in the text area below.
  • Advanced (SQL) tab: you can write full featured SQL CREATE TABLE statement here. A helper template is prepared for you.

Describe Table

Show database physical information in the result table.

Alter Table

Raise a dialog for table changing. This dialog looks quite similar like that "Create Table" one except a few things:

  • If you will change the name then the table will be renamed.
  • If you add some new columns then these will be appended into the table.

Sqlite ALTER TABLE command is very limited so there is no DROP COLUMN clause etc. use CREATE AS SELECT instead. (this feature can be introduced in the next versions of Sqliteman)

Drop Table

Really drop the table.

Reindex

Perform REINDEX command. If is it called against index there is only this index recreated. If is it called against the table then all indexes are recreated.

Create View...

Raise a dialog for the new view. There is the list of required properties you should fill:

  • Database: select a database schema from this combobox.
  • View Name: required unique (related to the Database) view name.
  • Select Statement: valid SQL statement. Please do not write any CREATE or ALTER like commands. Your statement fails if you will do so.

Describe View

Show database physical information in the result table.

Alter View...

A very similar dialog like "Create View". You can change only SQL statement here.

Drop View

Really drop the view.

Create Index...

Raise a dialog for the new index. There is the list of required properties you should fill:

  • Index Name: you have to specify a index name.
  • Unique?: check it if you want to have an unique index. Default is not unique.
  • Use?: check it if you want to have this column contained in index.
  • Asc/Desc: specify the index sort direction. Default is "ASC".

Describe Index

Show database physical information in the result table.

Drop Index

Really drop the index.

Detach Database

Detach the chosen database. The database will be removed from this session but the file will be saved. You cannot detach the "main" database.

Create Trigger...

Raise a dialog for the new trigger. There is a trigger template prepared for you. Just modify it to your needs. Then press the "Create" button and check the result.

Alter Trigger...

Raise a similar dialog to the "Create Trigger" one with current trigger body preset. Sqlite does not support direct ALTER TRIGGER so there is a DROP and new CREATE performed after you click the "Alter" button.

Drop Trigger

Really drop the trigger.

Constraint Triggers...

There is one more unsupported SQL feauture. Sqlite does not enforce foreign keys and not null constraints. This action will create a workaround triggers for you. Your SQL DML statements will be checked against these triggers before their execution.

There are three kind of constraint triggers – one for each I/U/D operations. This tool suggests trigger names but you can change it in the "Name" widgets.

All triggers will be created after the "Create" click. Then check the results carefully.