Re: WIP: SQL Formatter

2020-08-20 Thread Akshay Joshi
Thanks, patch applied. On Tue, Aug 18, 2020 at 3:53 PM Dave Page wrote: > Hi > > On Tue, Aug 18, 2020 at 7:33 AM Aditya Toshniwal < > aditya.toshni...@enterprisedb.com> wrote: > >> Hi Dave, >> >> The patch looks good to me except pep8 issues. >> > > Thanks, fixed. > > >> In the below SQL - BEGIN

Re: WIP: SQL Formatter

2020-08-17 Thread Aditya Toshniwal
Hi Dave, The patch looks good to me except pep8 issues. In the below SQL - BEGIN, RETURN, END are not formatted. But when only the BEGIN line is selected and the format button is clicked then it gets formatted. This seems to be a bug in sqlparse. Create or replace Function public.simple_func(i_var

Re: WIP: SQL Formatter

2020-08-17 Thread Akshay Joshi
Hi Aditya Can you please review it On Mon, Aug 10, 2020 at 11:11 AM Akshay Joshi wrote: > Hi Aditya > > Can you please review and test. > > On Fri, Aug 7, 2020 at 9:28 PM Dave Page wrote: > >> >> >> On Mon, Aug 3, 2020 at 10:51 AM Aditya Toshniwal < >> aditya.toshni...@enterprisedb.com> wrote:

Re: WIP: SQL Formatter

2020-08-09 Thread Akshay Joshi
Hi Aditya Can you please review and test. On Fri, Aug 7, 2020 at 9:28 PM Dave Page wrote: > > > On Mon, Aug 3, 2020 at 10:51 AM Aditya Toshniwal < > aditya.toshni...@enterprisedb.com> wrote: > >> Hi, >> >> On Mon, Aug 3, 2020 at 3:06 PM Dave Page wrote: >> >>> >>> >>> On Mon, Aug 3, 2020 at 10

Re: WIP: SQL Formatter

2020-08-07 Thread Dave Page
On Mon, Aug 3, 2020 at 10:51 AM Aditya Toshniwal < aditya.toshni...@enterprisedb.com> wrote: > Hi, > > On Mon, Aug 3, 2020 at 3:06 PM Dave Page wrote: > >> >> >> On Mon, Aug 3, 2020 at 10:31 AM Aditya Toshniwal < >> aditya.toshni...@enterprisedb.com> wrote: >> >>> Hi, >>> >>> On Fri, Jul 31, 2020

Re: WIP: SQL Formatter

2020-08-03 Thread Aditya Toshniwal
Hi, On Mon, Aug 3, 2020 at 3:06 PM Dave Page wrote: > > > On Mon, Aug 3, 2020 at 10:31 AM Aditya Toshniwal < > aditya.toshni...@enterprisedb.com> wrote: > >> Hi, >> >> On Fri, Jul 31, 2020 at 6:03 PM Dave Page wrote: >> >>> Hi >>> >>> Currently, all the CodeMirrors in pgAdmin use the settings f

Re: WIP: SQL Formatter

2020-08-03 Thread Dave Page
On Mon, Aug 3, 2020 at 10:31 AM Aditya Toshniwal < aditya.toshni...@enterprisedb.com> wrote: > Hi, > > On Fri, Jul 31, 2020 at 6:03 PM Dave Page wrote: > >> Hi >> >> Currently, all the CodeMirrors in pgAdmin use the settings from the Query >>> tool -> Editor, even though they're not related. I t

Re: WIP: SQL Formatter

2020-08-03 Thread Aditya Toshniwal
Hi, On Fri, Jul 31, 2020 at 6:03 PM Dave Page wrote: > Hi > > Currently, all the CodeMirrors in pgAdmin use the settings from the Query >> tool -> Editor, even though they're not related. I think you're right. >> We should move all CodeMirror settings out of the Query tool and move it to >> a n

Re: WIP: SQL Formatter

2020-07-31 Thread Dave Page
Hi Currently, all the CodeMirrors in pgAdmin use the settings from the Query > tool -> Editor, even though they're not related. I think you're right. > We should move all CodeMirror settings out of the Query tool and move it to > a new node - "SQL" may be. Editor and Auto-format would be sub node

Re: WIP: SQL Formatter

2020-07-30 Thread Aditya Toshniwal
Hi, On Thu, Jul 30, 2020 at 1:54 PM Dave Page wrote: > > > On Thu, Jul 30, 2020 at 6:29 AM Aditya Toshniwal < > aditya.toshni...@enterprisedb.com> wrote: > >> Hi Dave, >> >> On Wed, Jul 29, 2020 at 9:34 PM Dave Page wrote: >> >>> The attached WIP patch adds a menu option to the Query Tool to fo

Re: WIP: SQL Formatter

2020-07-30 Thread Dave Page
On Thu, Jul 30, 2020 at 6:29 AM Aditya Toshniwal < aditya.toshni...@enterprisedb.com> wrote: > Hi Dave, > > On Wed, Jul 29, 2020 at 9:34 PM Dave Page wrote: > >> The attached WIP patch adds a menu option to the Query Tool to format the >> SQL in the editor. It does so per options that can be set

Re: WIP: SQL Formatter

2020-07-29 Thread Aditya Toshniwal
Hi Dave, On Wed, Jul 29, 2020 at 9:34 PM Dave Page wrote: > The attached WIP patch adds a menu option to the Query Tool to format the > SQL in the editor. It does so per options that can be set in the > Preferences panel (essentially, most of these: > https://sqlparse.readthedocs.io/en/latest/ap

WIP: SQL Formatter

2020-07-29 Thread Dave Page
The attached WIP patch adds a menu option to the Query Tool to format the SQL in the editor. It does so per options that can be set in the Preferences panel (essentially, most of these: https://sqlparse.readthedocs.io/en/latest/api/#formatting-of-sql-statements) Some thoughts before I continue: -