Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sjCzU-00GNpi-Bx for pgadmin-hackers@arkaria.postgresql.org; Wed, 28 Aug 2024 07:21:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sjCyT-001BXe-OV for pgadmin-hackers@arkaria.postgresql.org; Wed, 28 Aug 2024 07:20:14 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sjCyT-001BXU-C8 for pgadmin-hackers@lists.postgresql.org; Wed, 28 Aug 2024 07:20:14 +0000 Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sjCyO-001sjE-UU for pgadmin-hackers@postgresql.org; Wed, 28 Aug 2024 07:20:12 +0000 Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-5c210e23651so814121a12.3 for ; Wed, 28 Aug 2024 00:20:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; t=1724829608; x=1725434408; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=p3GsXIvq5S8368Em03qQ/+upZ8vLGJNwAVQymQ3wQ00=; b=mt3JdD3oMrfxXYkL+4Kyhfw5LYizaFcfht4LLnDn0KnJ856Jb88qFM4/Mi9uxacTGD QEZE4HdIfwRODartPpBDvrqs7gIXC/SpDrDB8uavZ/uYqJSyPV3ezz+BHH3uRMVh/xTf 7H01dJW4BJr5NSABBeJbp6rKdwHonEsb2Xg3pOmCjintaWHEcgLclIWcCa7bpVd0qgU2 hxJNHP8ORnXdntfvuupPbiYaPQvRuL4sabvBD82+0YMmoGVqr3jq4sNiUrQcJIQwU9GV 5mKRKWRu2RMF+sQuPQtAWdkFkWK6MIus+KOj+oGQq+FF4DlvF7RJZdNqaq3RXpXMiG19 omVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724829608; x=1725434408; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=p3GsXIvq5S8368Em03qQ/+upZ8vLGJNwAVQymQ3wQ00=; b=ZOSF9KI0fAHOzNz/L1yhKXTjuTS5jvyIKhVuXrWr4DYrDjoO94LcDYgm+MushlcDA/ nKDehHGPxWgSwlh863GDD+ifW8pGFFedb51GTzzLBXBOYcXFU50wzs+kgkbyzwlAkuP9 MxHs386E6dxYrrw6bD/HbTnqqk3MyTk4wLyhl0LuAJ8hE1RVxE4uF58RGJCK2yJHUe/u OS3F4eMzK1035R86GI65FALedqrdzRFQtETL2VKEVdMheS6uY9yiYMsuoWBFpYZf999M W5Xzq2tSGk3uYTR+pGjtSA1KNS4O6FF1Z8M/lxozkYDOQo9KvAOTlPXz35Odg0CTxksY JVWQ== X-Forwarded-Encrypted: i=1; AJvYcCWLKXMQv2s2ig4jy4T6vd+s03KClM53KMh1GoCSriC2G0z6Zjn9PN78pw8WpbH4eekj+75R+u5KFSuYZA9L3hg=@postgresql.org X-Gm-Message-State: AOJu0YwSaZx8tdTX2WaRyj0CFSEQv5GFP/EpSDewUHtmwn0dyu7BwgcN yJkZ48sRYGzxfCWZ9VN2w8XBRheFOs6a59j1eQtf+GyuWjLagVWESYrpexfY0bDZ7DXSTwhnNH8 9oqvoI52v9Y5WK8V17LpVNnXux1jS20W2/CSVFhRdJK1ycD7DRg== X-Google-Smtp-Source: AGHT+IHSE5pTRGzUV8+T8z2BWkwX4G966fmcVbu2lhzfDk1DWvkk3h9COGtC6Q1f1HGsIHWygvNGXRk/g/6nmvUNcA0= X-Received: by 2002:a05:6402:3710:b0:5c2:18d2:7136 with SMTP id 4fb4d7f45d1cf-5c218d274fcmr495653a12.34.1724829607706; Wed, 28 Aug 2024 00:20:07 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Anil Sahoo Date: Wed, 28 Aug 2024 12:49:31 +0530 Message-ID: Subject: Re: Regarding feature #3319 To: Aditya Toshniwal Cc: Dave Page , pgadmin-hackers Content-Type: multipart/alternative; boundary="00000000000010ec8b0620b93037" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000010ec8b0620b93037 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Hackers, We are going to store the below details 1. List of Query tools opened 2. List of connections present in each query tool 3. Each connection=E2=80=99s details that are required to make the conne= ction once the application restarts 4. Active connection details of each query tool opened 5. Store the query that is written in the editor that may or may not be executed 6. Store the contents of the scratch pad 7. Store the file which is opened in the query tool with any unsaved changes Some questions that I have are mentioned below, 1. For desktop mode the application is opened with some query tools and the user closes the application and on restarts the tabs will open as it= is and will restore the workspace and connections on query tool tabs. But f= or server mode do we need to restore the query tool tabs and workspace? Because we see most of the desktop applications have this feature. 2. I came across one issue reported by one user i.e https://github.com/pgadmin-org/pgadmin4/issues/6666, where pgAdmin crashed due to long SQL scripts that can be in Megabytes stored as query history. We fixed it by giving MAX_QUERY_LENGTH to 1000000, and checking if any query length is below the value then it gets stored in t= he database as query history else not. Should we go with storing the worksp= ace and query tool details in SQLite DB or use a file system to store the details and retrieve the content accordingly? Please let me know your suggestions on this. Thanks Anil -- *Anil Sahoo* Software Engineer www.enterprisedb.com Power to Postgres On Tue, Aug 20, 2024 at 10:14=E2=80=AFAM Aditya Toshniwal < aditya.toshniwal@enterprisedb.com> wrote: > Hi Anil, > > There can be multiple query tools open with large files. Not entirely sur= e > if storing in SQLite DB is a good idea. > External databases won't come in the picture as 99.99% users will not use > external DB for desktop app. We're only doing this for desktop app. > And also consider the case where a SQL file is opened with some unsaved > changes. > > On Tue, Aug 20, 2024 at 9:11=E2=80=AFAM Anil Sahoo > wrote: > >> Hi Aditya, >> >> As we are already storing the query history in the pgAdmin 4's database >> file. >> I am planning to store the information the same way. That can be an >> internal database file like SQLite or external database. >> >> Let me know if you all have any suggestions on this. >> >> Thanks >> Anil >> -- >> >> >> >> *Anil Sahoo* >> >> Software Engineer >> >> www.enterprisedb.com >> >> Power to Postgres >> >> >> >> >> >> >> >> On Mon, Aug 19, 2024 at 11:40=E2=80=AFAM Aditya Toshniwal < >> aditya.toshniwal@enterprisedb.com> wrote: >> >>> Hi Anil, >>> >>> On Mon, Aug 12, 2024 at 3:02=E2=80=AFPM Anil Sahoo >>> wrote: >>> >>>> Hi, >>>> >>>> Yes, We will store the details that are needed to re-establish the >>>> connection. >>>> >>> >>> How/Where are you planning to store the information? Query text could b= e >>> large. >>> >>>> >>>> Regards >>>> Anil >>>> -- >>>> >>>> >>>> >>>> *Anil Sahoo* >>>> >>>> Software Engineer >>>> >>>> www.enterprisedb.com >>>> >>>> Power to Postgres >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> On Mon, Aug 12, 2024 at 2:08=E2=80=AFPM Dave Page = wrote: >>>> >>>>> Hi >>>>> >>>>> On Mon, 12 Aug 2024 at 06:50, Anil Sahoo >>>>> wrote: >>>>> >>>>>> Hi Hackers, >>>>>> >>>>>> >>>>>> This feature #3319 >>>>>> , demands the >>>>>> Workspace and the Query tool panel to be saved before exiting the >>>>>> application and on restart it will show earlier opened panels. >>>>>> >>>>>> >>>>>> We are already saving the Browser layout, Query tool layout and the >>>>>> Object explorer tree state but to save the contents of panels we wil= l >>>>>> initially start with the Query tool. The below implementation will b= e done, >>>>>> >>>>>> 1. Store the query tool panels and the list of connections >>>>>> present in each query tool panel and the active connection >>>>>> 2. Store the query that is written in the editor >>>>>> 3. Store the contents of scratch pad >>>>>> >>>>>> The main reason that this has never been worked on is that there is >>>>> no way to restore the state of a connection to what it was and be sur= e >>>>> we've got it right. How do you propose to handle that? I assume in a >>>>> similar way to the warnings we give if a connection has to be >>>>> re-established? >>>>> >>>>>> >>>>>> >>>>>> >>>>>> We will use debouncing to store the workspace data and all other dat= a >>>>>> related to panels in the pgAdmin 4's configured database file. Throu= gh >>>>>> debouncing we will be able to call the API at certain intervals of u= ser >>>>>> interaction, and it will update the stored data related to workspace= and >>>>>> all other panels. >>>>>> >>>>> >>>>> OK. >>>>> >>>>> -- >>>>> Dave Page >>>>> pgAdmin: https://www.pgadmin.org >>>>> PostgreSQL: https://www.postgresql.org >>>>> EDB: https://www.enterprisedb.com >>>>> >>>>> PGDay UK 2024, 11th September, London: https://2024.pgday.uk/ >>>>> >>>>> >>> >>> -- >>> Thanks, >>> Aditya Toshniwal >>> pgAdmin Hacker | Sr. Software Architect | *enterprisedb.com* >>> >>> "Don't Complain about Heat, Plant a TREE" >>> >> > > -- > Thanks, > Aditya Toshniwal > pgAdmin Hacker | Sr. Software Architect | *enterprisedb.com* > > "Don't Complain about Heat, Plant a TREE" > --00000000000010ec8b0620b93037 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Hi Hackers,


We are going to store the = below details

  1. List of Query tools open= ed
  2. List of connections pres= ent in each query tool
  3. Each connection=E2=80=99= s details that are required to make the connection once the application res= tarts
  4. Active connection detail= s of each query tool opened
  5. Store the query that is = written in the editor that may or may not be executed
  6. Store the contents of th= e scratch pad
  7. Store the file which is = opened in the query tool with any unsaved changes

Some questions that I have= are mentioned below,

  1. For desktop mode the app= lication is opened with some query tools and the user closes the applicatio= n and on restarts the tabs will open as it is and will restore the workspac= e and connections on query tool tabs. But for server mode do we need to res= tore the query tool tabs and workspace? Because we see most of the desktop = applications have this feature.= =C2=A0
  2. I came across= one issue reported by one user i.e https://github.com/pgadmin-org/pgadmin4/issues/6666, where pgAdmin crashed due to long SQL scripts that can be in Megabyt= es stored as query history.=C2=A0 We fixed it by giving MAX_QUERY_LENGTH=C2=A0 to 1000000, and checki= ng if any query length is below the value then it gets stored in the databa= se as query history else not. Should we go with storing the workspace and q= uery tool details in SQLite DB or use a file system to store the details an= d retrieve the content accordingly?

Please let me know your suggesti= ons on this.

<= /div>
Thanks
Anil
--
<= td colspan=3D"2" style=3D"vertical-align:top;padding:5pt 5pt 5pt 5pt;overfl= ow:hidden">

=C2= =A0 =C2=A0 =C2=A0 <= span style=3D"border:none;display:inline-block;overflow:hidden;width:29px;h= eight:29px"> =C2=A0 =C2=A0 =C2=A0 =C2=A0 <= span style=3D"border:none;display:inline-block;overflow:hidden;width:33px;h= eight:33px">

Anil Sahoo

Software Engineer

www.enterprise= db.com

Power to Postgres



On Tue, Aug 20, 2024 at 10:14=E2=80=AFAM Aditya Tos= hniwal <aditya.tosh= niwal@enterprisedb.com> wrote:
Hi Anil,

There can be multiple que= ry tools open with large files. Not entirely sure if storing in SQLite DB i= s a good idea.
External databases won't come in the picture as 99.99% u= sers will not use external DB for desktop app. We're only doing this fo= r desktop app.
And also consider the case where a SQL file is opened with s= ome unsaved changes.

On Tue, Aug 20, 2024 at 9:11=E2=80=AFAM Anil Saho= o <anil= .sahoo@enterprisedb.com> wrote:
Hi Aditya,

As we= are already storing the query history in the pgAdmin 4's database file= .
I am planning to store the information the same way. That can b= e an internal database file like SQLite or external database.=C2=A0

Let me know if you all have any suggestions on this.<= /div>

Thanks
Anil
--

<= col width=3D"245">

Anil Sahoo<= /b>

Software Engineer

= www.ent= erprisedb.com

Power to Postgres

=C2=A0 =C2=A0 =C2=A0 <= a href=3D"https://twitter.com/edbpostgres?lang=3Den" target=3D"_blank"> =C2=A0 =C2=A0 = <= span style=3D"font-size:11pt;font-family:Roboto,sans-serif;color:rgb(17,85,= 204);vertical-align:baseline;white-space:pre-wrap"> =C2=A0 =C2= =A0



On Mon, Aug 19, 2024 at 11:40=E2=80=AFAM Aditya Toshniwal = <= aditya.toshniwal@enterprisedb.com> wrote:
Hi=C2=A0Anil,=

On Mon, Aug 12, 2024 at 3:02=E2=80=AFPM Anil Sahoo <anil.sahoo@enterprisedb.= com> wrote:
Hi,

Yes, We will store the details that are need= ed to re-establish the connection.

How/Where ar= e you planning=C2=A0to store the information? Query text could be large.
=
Regards
Anil
--
=

Anil Sahoo

Software Engineer

www.enterprisedb.com

Power t= o Postgres

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0

=

On Mon, = Aug 12, 2024 at 2:08=E2=80=AFPM Dave Page <dpage@pgadmin.org> wrote:
Hi
On Mon, = 12 Aug 2024 at 06:50, Anil Sahoo <anil.sahoo@enterprisedb.com> wrote:

Hi Hackers,


This feature=C2=A0#3319, demands the Wor= kspace and the Query tool panel to be saved before exiting the application = and on restart it will show earlier opened panels.


We are already saving the Browser layout, Query tool layout and the= Object explorer tree state but to save the contents of panels we will init= ially start with the Query tool. The below implementation will be done,

  1. Store the query tool panels and the list of connections present in= each query tool panel and the active connection
  2. Store the query that is written in the editor
  3. Store the contents of scratch pad
The main reason that this has never been worked on is that there is= no way to restore the state of a connection to what it was and be sure we&= #39;ve got it right. How do you propose to handle that? I assume in a simil= ar way to the warnings we give if a connection has to be re-established?=C2= =A0


We will use debouncing to store the workspace data and all other da= ta related to panels in the pgAdmin 4's configured database file. Throu= gh debouncing we will be able to call the API at certain intervals of user = interaction, and it will update the stored data related to workspace and al= l other panels.


OK.=C2=A0<= /div>

-- =
Dave PagepgAdmin: https://w= ww.pgadmin.org
PostgreSQL: https://www.postgresql.org

PGDay UK 2024, 11th September, Londo= n: https://2024.pgday.= uk/



--
Thanks,
Aditya Toshniwal
pgAdmin Hacker=C2=A0| Sr. Software Architect=C2=A0| enterprisedb.com

--
Thanks,
Aditya Toshniwal
pgAdmin Hacker=C2=A0| Sr. Software Architect=C2=A0| enterprisedb.com