It is highly important to retain code readability at the stage of writing it. Taking care of code formatting, syntax check, and code completion, the PostgreSQL Code Formatter feature built-in dbForge Studio for PostgreSQL will let you stay focused on the task.
To configure formatting options and customize formatting profiles:
1. On the Tools menu, select Options.
2. In the dialog box, that opens click Formatting.
3. Two tabs are available under the Formatting option: General, where you can tune your formatting, and Profiles, where you can customize the existing profiles or add the new ones.
4. Make the necessary configuration changes and click OK.
To format the code of a document, do one of the following:
To format the current statement, do one of the following:
To format a certain code fragment, do one of the following:
Formatting SQL scripts and queries has never been easier.
A formatting profile comprises a saved set of options for your SQL document layout. To create or edit a formatting profile, on the Tools menu, click Options. Then in the menu that opens, select Profiles under the Formatting menu option.
dbForge Studio for PostgreSQL has one default profile. To create your own profile, click New Profile, make the necessary configurations, and click OK to save them.
Your active profile is the formatting profile that is highlighted and given in bold. To make a profile active, select it and click Activate.
To edit a profile, select it and click Edit Profile.
With dbForge SQL formatting tool built-in Studio for PostgreSQL you can switch between formatting profiles within one SQL document.
To apply a different formatting profile for certain segments of code in a query:
1. Select and right-click a code segment you want to format.
2. Under the Active Format Profile menu option switch to a profile you want.
dbForge Studio for PostgreSQL allows you to share formatting styles with your colleagues to enforce common layout and coding standards within your team.
Profiles are stored as XML files. To share styles with your team:
1. In the Formatting profiles window, right-click the body of the window, and select Show in Folder.
2. Copy the profile you want to share.
3. Open or create the shared folder you want to use, and paste the profile you want to share into it.
4. Share the name and location of the folder with the team.
Other dbForge Studio for PostgreSQL users can then use the same formatting profile by providing a path to your profile in the New Profile window.
The PostgreSQL Formatter feature is available in the Standard Edition of dbForge Studio for PostgreSQL.