A column is a piece of data that is stored by a table. This data belongs to a particular type. A column may include text, numbers, or pointers to files in the operating system. Some relational database systems allow columns to include more complex data types like whole documents, images, or video clips.
Each object in the Database tool window has its own icon. You can see a reference on object icons in the following reference topic.
Add a column
Right-click a table and select.
Specify a column name and settings.
Delete a column
Right-click a column and select Drop. Alternatively, press Delete.
(Optional) Click the Settings icon () to configure the drop process.
Modify a column
In the Database tool window ( ), right-click a column and select Modify Column.
In the Modify Table dialog, specify the column settings that you need.
Starting with GoLand 2022.1, you can change database-specific parameters of a column. The IDE generates fields for the new Modify dialog automatically according to the properties received during the introspection. For example, by using this dialog in PostgreSQL, you can add and edit column check constraints.
Modify a database-specific parameters of an object
In the Database tool window ( ), right-click a column and select Modify Column (New UI).
In the Modify dialog, specify object settings that you need.
To reorder columns, use dragging for the corresponding cells in the header row.
To hide a column, right-click the corresponding header cell and select Hide column.
Alternatively, you can right-click any of the cells in the header row and select Columns List Ctrl+F12. In the Columns List window, select a column name and press Space. You can hide all columns. To search through the column list, just start typing a column name in the Columns List window.
Select the hidden column (a strikethrough column name) and press Space.
Reset the table view to the initial state
Click the settings icon () and select Reset View. As a result, the data becomes unsorted, the columns appear in the order they were defined initially, and all the columns are shown.
Inject a language for a column
You can assign HTML, CSS, XML, RegExp, or any other formal language for the whole column. So, when you have a piece of code inside the cell that belongs to the column, you can use code generation, code completion, and other IDE features.
To inject a language for the whole column, right-click the corresponding header cell, and select Set Highlighting Language. In the list of supported languages, select the language that you want to inject.
Change the column width
Position a cursor between two columns, so it changes to the resize mode. Drag it to the preferred position.
To expand a cell to edit a value, use the Maximize action (Shift+Enter).