The SQL Query macro behaves as follows depending on the chosen database and the database privileges the user (configured in the profile) holds: Database type | Read-only user | Read-write user | Macro behaviour w.r.t. Create, Insert, Update, or Delete (CRUD) statements given as SQL statements, or in scripts attached to a page | Points to note |
---|
PostgreSQL MySQL | | | Macro creates a read-only session for the database connection established through the specified profile. Given SQL statement(s) or the script file is executed, and results are displayed in a table in the Preview panel of the macro editor. | PostgreSQL | | | Macro creates a read-only session for the database connection established through the specified profile. - Allows SQL statements or scripts in read-only mode only.
- Error messages are displayed if
| CRUD - Create, Insert, Update, or Delete SQL statements are given in editor or in a script attached to a page.
| The - This is because the database itself does not allow
| CRUD - . execution of such statements as the logged in user has read-only privileges.
| MySQL | | | Microsoft SQL Server | | | Given SQL statement(s) or the script file is executed, and results are displayed in a table in the Preview panel of the macro editor. | | | Macro executes the given SQL statement or attached script file and Once the statements are run: - the database reflects the operations performed
. Once the statements are run, then executes - executes a rollback that reverts the database to its previous state.
Thus, Confluence administrators must make sure to provide credentials of a user with read-only privileges configured in the database. |
|