Sign in Join
Wiki copytemporary

SQLDBRestSchemaEditor: what changed

Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11## Introduction
22
33The SQLDBRestBridge schema editor allows you to edit schema files for a [[SQLDBRestBridge]] schema.
44
55The editor is implemented in the sqldbrestschemadesigner.lpk package and included in the Lazarus IDE if you register the lazsqldbrest.lpk package. It can also be compiled as a standalone application, the application is located in the editor project under the components/sqldbrestb directory.
66
77The standalone editor can be used to create schema files, which can be used to load schemas using the **LoadFromFile** method.
88
99## Workings
1010
1111The schema editor has one form, which looks as follows when a schema is loaded.
1212
13-<figure>
14-<img src="sqldbrestschemaeditor-schema.png" title="sqldbrestschemaeditor-schema.png" />
15-<figcaption>sqldbrestschemaeditor-schema.png</figcaption>
16-</figure>
13+![](/wiki-images/0/06/Sqldbrestschemaeditor-schema.png)
1714
1815The left side *Available connections* shows the known connections, and for each connection to a database, the tables in the database can be shown. Using drag & drop, the tables (you can select multiple tables at once) can be dragged to the middle part of the screen. The known connections can be hidden using the button above the tree.
1916
2017The middle part of the screen *Available Resources* shows the resources defined in the schema. You can add new resources by dragging them from the connections, or using the 'Add resource' button.
2118
2219The right part of the screen shows the details of the item selected in the *Available resources*. This can be one of 4 details
2320
24211. When the schema node is selected, the list of tables is shown (see the above screenshot). You can double click a resource, and the selected resource will be shown for editing.
25222. When a resource node is selected, the resource editor is shown (see below)
26233. When the 'fields' node below a resource node is selected, the list of fields is shown. You can double click a field, and the selected field will be shown for editing.
27244. When a field node is selected, the field editor is shown.
2825
2926Changes to a current node are automatically saved when selecting another node.
3027
3128A double click on a selected node will show the same editor as selecting a node, but in a modal dialog.
3229
3330You can add new resources by dragging them from the connections, or using the 'Add resource' button. The 'expose connection' above the list of connections will add all tables of a connection to the schema.
3431
3532The menu allows several actions:
3633
37-<figure>
38-<img src="sqldbrestschemaeditor-menu.png" title="sqldbrestschemaeditor-menu.png" />
39-<figcaption>sqldbrestschemaeditor-menu.png</figcaption>
40-</figure>
34+![](/wiki-images/2/24/Sqldbrestschemaeditor-menu.png)
4135
42361. **Read connections** Loads a list of connection details from an .ini file.
43372. **Write connections** Saves the list of connections shown in the left panel to an .ini file.
44383. **New schema** Creates a new empty schema.
45394. **Load schema** Loads a schema file and displays the resources.
46405. **Save schema** Saves the resources to a schema file.
47416. **Recent schemas** a MRU menu with recently loaded or saved schema files.
48427. **Quit** exits the program.
4943
5044A schema file has the .srs extension, but this is not obligatory. It is a JSON file created by the SaveToFile method of the TSQLDBRestSchema class, and can be loaded with the LoadFromFile method.
5145
5246## Resource editor
5347
5448The resource editor is shown when a resource is selected in the available resources tree. It looks as follows:
5549
56-<figure>
57-<img src="sqldbrestschemaeditor-table.png" title="sqldbrestschemaeditor-table.png" />
58-<figcaption>sqldbrestschemaeditor-table.png</figcaption>
59-</figure>
50+![](/wiki-images/9/99/Sqldbrestschemaeditor-table.png)
6051
6152The various edits correspond to the properties of the TSQLDBRestResource class.
6253
6354The 4 tabs at the bottom can be used to edit the SQL Statements.
6455
6556The *SELECT* statement can be automatically generated from the table name. The entered statement can also be validated, to check if the SQL is correct. When the SQL SELECT Statement has changed, the list of published fields can be automatically refreshed using the 'Update Fields' button. This will reset the fields list, so any adjustments that were made to the list of fields will be lost.
6657
6758The last tab displays the list of fields defined for the resource.
6859
69-<figure>
70-<img src="sqldbrestschemaeditor-table-fields.png" title="sqldbrestschemaeditor-table-fields.png" />
71-<figcaption>sqldbrestschemaeditor-table-fields.png</figcaption>
72-</figure>
60+![](/wiki-images/a/a9/Sqldbrestschemaeditor-table-fields.png)
7361
7462This list should be identical to the list in the treeview. Double-clicking a field will display the field editor.
7563
7664## Field editor
7765
7866The field editor shows the properties of a selected field. These are the properties of the TSQLDBRestField class. It looks as follows:
7967
80-<figure>
81-<img src="sqldbrestschemaeditor-field.png" title="sqldbrestschemaeditor-field.png" />
82-<figcaption>sqldbrestschemaeditor-field.png</figcaption>
83-</figure>
68+![](/wiki-images/0/08/Sqldbrestschemaeditor-field.png)
8469
8570## Fields editor
8671
8772The fields editor is shown when the 'Fields' node is selected in the resource tree. It is currently read-only, and looks as follows:
8873
89-<figure>
90-<img src="sqldbrestschemaeditor-fields.png" title="sqldbrestschemaeditor-fields.png" />
91-<figcaption>sqldbrestschemaeditor-fields.png</figcaption>
92-</figure>
74+![](/wiki-images/5/51/Sqldbrestschemaeditor-fields.png)
9375
9476Double clicking a field will take you to the field editor for the selected field.
9577
9678---
9779*From the Free Pascal wiki, page "SQLDBRestSchemaEditor", as it stood on 2019-05-11 after a change by Michael, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*

Back to history