Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Note
titleImportant information:
  • Administrators must ensure to use credentials of database users with read-only privileges for profiles intended for use with the SQL Query macro.
  • At least one data source profile must be configured before using the SQL for Confluence - SQL Query macro.


Info
titleHow database and user type in a profile affects macro behavior:

The SQL Query macro behaves as follows depending on the chosen database and the database privileges the user (configured in the profile) holds:

Macro behaviour w.r.t. Create, Insert, Update, or Delete (CRUD) statements given as SQL statements, or in scripts attached to a pagePostgreSQL

Macro creates a read-only session for the database connection established through the specified profile.

CRUD The CRUD (tick)(tick)
Database typeRead-only userRead-write userPoints to note

PostgreSQL

MySQL

(tick)(error)

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.

(error)(tick)
  • Allows SQL statements or scripts in read-only mode only.
  • Error messages are displayed if
  • Create, Insert, Update, or Delete SQL statements are given in editor or in a script attached to a page.
  • This is because the database itself does not allow
  • . execution of such statements as the logged in user has read-only privileges.
MySQL(error)

Microsoft SQL Server

(error)

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.

(error)(tick)

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,
  • , and
  • the macro
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.


...