edgedb icon indicating copy to clipboard operation
edgedb copied to clipboard

SQL support for Tableau (declare cursor)

Open Jady891213 opened this issue 1 year ago • 4 comments

  • EdgeDB Version:3.1
  • EdgeDB CLI Version: none
  • OS Version:macOS Ventura 13.1

Steps to Reproduce: I am using Tableau Desktop client and have connected it to the edgeDB PostgreSQL connector for my local server. It is able to fetch the list of schemas, but throws an exception when configuring the chart (see the screenshot at the bottom). Upon investigation, I found that it may not yet support cursor queries, such as:

DECLARE my_cursor CURSOR FOR
    SELECT proj_code, proj_status
    FROM appczjniw005."Project";

OPEN my_cursor;

FETCH NEXT FROM my_cursor INTO @proj_code, @proj_status;

WHILE @@FETCH_STATUS = 0
BEGIN
    PRINT 'Project Code: ' + @proj_code + ', Project Status: ' + @proj_status;
    
    FETCH NEXT FROM my_cursor INTO @proj_code, @proj_status;
END;

CLOSE my_cursor;
DEALLOCATE my_cursor;

However, I have reviewed the official documentation of edgeDB, and it mentions that Tableau has been tested. I couldn't find any configuration to disable cursor queries either. I would like to confirm if this is a bug? Attached are the relevant screenshots: image image

Schema:none

Jady891213 avatar Dec 22 '23 10:12 Jady891213

Just talked with someone about this, and we'll need to have a discussion with the team about it. Adding support for cursors will not be trivial.

In the meantime, you may want to move your data into a Postgres instance and connect that to Tableau. You can use pg_dump and then restore the dump to a Postgres database, or you can use AirByte or Fivetran (or something like them).

raddevon avatar Dec 22 '23 13:12 raddevon

Looking at this issue, I'm a bit confused.

@Jady891213 Where is the code snippet you've attached coming from? Is this query being issued to EdgeDB over SQL adapter?

If so, you've probably misconfigured your connector to use "Microsoft SQL Server adapter" instead of "PostgreSQL adapter".

I'm saying that because the snippet contains syntax that is not supported by PostgreSQL (WHILE, PRINT) and will not be supported by EdgeDB.


We've discussed supporting PostgreSQL cursors and it should be quite easy to do, if we limit to only NO SCROLL cursors.

aljazerzen avatar Jan 03 '24 18:01 aljazerzen

I remember it was still working last time, but I just tested it now and it's definitely showing some abnormalities. It's okay, I just wanted to find out the tutorial or documentation for using the Tableau desktop client. I couldn't figure it out myself. image

Jady891213 avatar Jan 26 '24 15:01 Jady891213

The query file you posted contains syntax that is not supported. More specifically, FETCH NEXT FROM, WHILE, BEGIN and END will never be supported by EdgeDB. DECLARE and DEALLOCATE could be supported, but are currently a low priority feature.

I'm not familiar with this SQL dialect, but I'm sure you are doing something wrong to be using it with EdgeDB.

aljazerzen avatar Jan 26 '24 19:01 aljazerzen