The database editor changes the definition of one database: its name, its data containers, the way each data container connects and what the log-on window asks for. A change is written to a settings file; see [[Invantive UniversalSQL/General/Settings|Settings]]. The editor is available from release 28.0, and it follows the editor of Invantive Query Tool for Microsoft Windows described in [[Invantive UniversalSQL/General/Discover Databases|Discover Databases]]. The editor is reached through "Edit" in the menu of a database of the log-on window, through the name of a tile or "Edit" in the menu of a tile of [[Invantive Query Tool Multi-Platform/Discover Databases|Discover Databases]], and through "Duplicate", which opens the editor on the copy. The title reads "Edit database" followed by the group and the name of the database. On the left stands the tree of the database and its data containers, on the right the pages of the selected node: ![[20261008-qtm-database-editor.png]] The line under the pages says whose file holds the database, when the file was last written in UTC, the identifier of the database and the file itself. The first words tell the owner of the file: "Your file" for the settings file of the user and "From elsewhere" for every other file. ## The Tree The first node is the database, and under it stands one node for every data container, in the order in which the data containers are opened at log-on. Four buttons under the tree work on the data containers: - "Add" adds a data container to the database; see [[#Adding a Data Container]]. - The up arrow and the down arrow open the selected data container earlier or later. - "Delete" removes the selected data container from the database. The last data container of a database stays. A settings file can still hold members which the product no longer uses. They stand under a node "Obsolete Members", with the number of fail-over clusters and providers in its name. They are shown so that they can be recognised and removed; nothing new is written with them. ## Pages of a Database The pages of the first node are "Database", "Advanced" and "Audit". "Database" holds the members which every database has: - "Name" is what the log-on window shows. Together with the name of the group it identifies the database in a statement and in the favourites. - "Short Description" follows the name in the tree of the log-on window, and "Description" is the longer text. - "Sort Order" is the place of the database in its group. - "Starred" proposes the database as a favourite to every user who reads this settings file, until that user takes it off; see [[Favorite Databases]]. "Advanced" holds what a database rarely states: - "Native Connection" makes the statements travel without handling by Invantive UniversalSQL. - "Data Cache Connection String" and "Data Dictionary Connection String" name the SQL platform which keeps the data cache and the data dictionary of the database. A field which is empty shows what belongs in it: `provider=SqlServer;connectionString={Server=...;Database=...;User Id=...;Password=...}`. The button "Build..." beside each field asks for the platform and then for the keywords of that platform; see [[#Connection String Builder]]. - "Data Container Whose User Identity Is Reported" names the alias of the data container which tells who the user is. - "Test Data Cache..." and "Test Data Dictionary..." open the connection string and close it again, and report the outcome. "Audit" shows the identifier of the database, who created it and on which machine, and whether the database was defined by the user. The page is read only. ## Pages of a Data Container The pages of a data container are "Data Container", "Attributes" and "Audit". "Data Container" holds the account and the log-on behaviour: - "Driver" names the driver which reaches the platform. It is shown and not changed. - "Alias" is the name with which a statement addresses the data container, the name which follows the `@` behind a table. A database with several data containers needs an alias on each of them. - "Order" is the position in which the data containers are opened. - "Description" is shown at log-on in place of the description of the driver. - "Default User Name" and "Default Password" are what the log-on window starts with. Each has three choices: "Asked" lets the user type a value, "Shown" shows the default and does not let it be changed, and "Hidden" leaves the field out of the window. A default password is stored readable in the settings file, and an empty default password makes the product ask for the password at log-on. - "Labels and Hints" opens four more fields: the label and the hint of the user name, and the label and the hint of the password. "Audit" shows who created the data container and on which machine. A data container which is handed over by the Invantive Credentials Server has a page of its own instead of "Attributes". It asks for three things: "Database", the segment of the address with which Invantive Cloud knows the database, such as `my-company-exact`; "Credentials Server", which stays empty for the standard server; and "Data Containers", a list of aliases in which an asterisk means all of them. The alias of such a data container is stated by Invantive Cloud and cannot be set here. ## Attributes The page "Attributes" is a form built from what the driver states, and not a connection string to type. It holds the keywords of the platform and the attributes of the Invantive layer which the log-on window shows. Every attribute has a label, a control that suits its value and a line of explanation: ![[20261008-qtm-database-editor-attributes.png]] A bar in front of the label tells where the attribute comes from: blue for an attribute of Invantive, grey for a keyword of the platform. The name of an attribute which is set in the settings file is bold. An attribute which is not set shows the default of the driver in grey italics. A keyword which is written under another name that the platform knows, such as `Server` for `Host` or `User Id` for `Username` on PostgreSQL, fills the field of the keyword it stands for. The attributes which are set stand first, and the other attributes of the data container follow, sorted by label. The order is settled when the page opens, so a value typed into a field leaves the field where it stands. A changed field rewrites only its own pair in the connection string: every other pair keeps its text, its spelling and its place, and a keyword which neither source declares stays and is shown under "Other". The box at the top right narrows the page down to the attributes whose label, code or explanation contains the text. ## More Attributes The button at the bottom of the page, captioned with the number of attributes which are not on the page and "More...", opens the window with the remaining attributes of the driver: ![[20261008-qtm-database-editor-more-attributes.png]] The window starts with a search box and the check box "Hide Unset". Under them stands a row of buttons with the categories of the driver and the number of attributes in each, such as "Behaviour (39)" and "Performance (25)"; "All" shows every attribute. The list has the columns "Attribute", "Value", "Clear", "Default", "Category" and "Code". What is set stands first, then the categories from where the platform is to what support needs, and within a category the order of the driver. Searching does not change that order. Only a value which is set reaches the connection string, and "Clear" on a row takes the value back to what the driver uses. A value which equals the default of today counts as set and stays written, so that a later release which changes the default leaves the connection as it is. "OK" takes the values over and "Cancel" leaves the page as it was. ## Edit as Text "Edit as Text" shows the connection string of the data container in a box, such as `Host=db.acme.eu;Port=5432;Database=sales`. "Apply" rebuilds the form from the text and "Cancel" leaves the form as it was. The form is unavailable while the text is open. ## Connection String Builder A connection string to a SQL platform holds the keywords of the platform inside the connection string of the product. "Build..." opens the window "Connection String", which asks for the platform in a list and then shows the fields of that platform. The text under the fields is what is stored; "OK" puts it in the field of the editor and "Cancel" leaves the field as it was. ## Adding a Data Container "Add" opens the window "Select Driver". The window lists the drivers of the product, with a search box and the name of the driver as the settings file writes it. A driver which the licence does not cover is listed and greyed, so that the platform is known to be reachable and what it takes. "Select" adds the data container to the tree and opens its page. The alias is made from the name of the driver, for example `dummy`, and can be changed. ## Saving "Save" writes the definition into the settings file the database came from and closes the window. A copy of that file is written to the backup folder first, named after the file and the moment. A change only touches the parts which were edited: "Save" refuses a change to a part of the definition which was not edited, and then leaves the settings file as it was. "Save" also refuses a definition which the log-on window would not offer, such as a database with several data containers of which one has no alias, and names the reason. A database which comes from a settings file the product does not change, such as a discovered database or a file which cannot be written, shows a line under the title: "This database comes from a settings file this product does not change. Save stores your own copy of the database in your own settings file, which the products then prefer; the original stays where it is." The other buttons at the bottom of the editor are: - "Test..." opens the window which tries every data container; see [[Invantive Query Tool Multi-Platform/Testing a Database|Testing a Database]]. - "Delete" removes the database after a confirmation; see [[Invantive Query Tool Multi-Platform/Deleting a Database|Deleting a Database]]. - "Cancel" closes the editor and leaves the files as they were.