Coder Social home page Coder Social logo

SQL Still problematic about dbeaver HOT 9 OPEN

coleman-rik avatar coleman-rik commented on May 30, 2024
SQL Still problematic

from dbeaver.

Comments (9)

coleman-rik avatar coleman-rik commented on May 30, 2024 1

Is this what you wanted?
dbeaver_outline1_20240508_091113
dbeaver_outline0_20240508_091113

from dbeaver.

philosaur avatar philosaur commented on May 30, 2024 1

This seems pretty clearly related to the bug I reported here. I'm attaching an additional screenshot in hopes of clarifying that "Blank line as a statement delimiter" has no effect under certain conditions. Also, the outline view (which I just learned about, thanks to this post) even shows that the parser doesn't correctly parse these as separate statements.

image

from dbeaver.

E1izabeth avatar E1izabeth commented on May 30, 2024

I can't reproduce your issue on the provided query script neither with Blank line is statement delimiter set to Smart, nor to Never on DBeaver 24.0.4.

from dbeaver.

E1izabeth avatar E1izabeth commented on May 30, 2024

Could you open Outline view and show it to me?
It can be opened here by clicking this button
image

from dbeaver.

E1izabeth avatar E1izabeth commented on May 30, 2024

I don't see something wrong here. Outline shows that statements are correctly separated.
About the second screenshot I could say that lines 1040-1091 does have any features allowing statement delimiter logic to treat them as independent queries to separate from the surrounding parts of the script. So it's not valid to keep them here while using smart mode. Either comment them out, or switch Blank line is statement delimiter to Always, so that it would be enough to have a blank line to separate them - this way DBeaver will assume any text fragment surrounded with empty lines as a separate statement, preventing undesired behavior in this case.

from dbeaver.

coleman-rik avatar coleman-rik commented on May 30, 2024

@E1izabeth I often have multiple statements with no black spaces between them, see example below.
I expect Dbeaver to only use the delimiters to, well, delimite commands. If I place my cursor within the third line, I expect that only the third line will be executed.

Dbeaver should, and used to, only run the SQL statement that my cursor was within.

How do I get back to that behavior?
thanks,
rik.
For example:


-- create tables
create table rxnorm.rxnatomarchive_20240205 as table rxnorm.rxnatomarchive;
create table rxnorm.rxnconso_20240205 as table rxnorm.rxnconso;
create table rxnorm.rxncui_20240205 as table rxnorm.rxncui;
-- create the indicies
create index if not exists x_rxnconso_str on rxnorm.rxnconso (str);
create index if not exists x_rxnconso_rxcui on rxnorm.rxnconso (rxcui);
create index if not exists x_rxnatomarchive_rxcui on rxnorm.rxnatomarchive (rxcui);
create index if not exists x_rxnatomarchive_merged_to on rxnorm.rxnatomarchive (merged_to_rxcui);
-- drop tables
drop table if exists rxnorm.rxnatomarchive_20240102;
drop table if exists rxnorm.rxnconso_20240102;
drop table if exists rxnorm.rxncui_20240102;
drop table if exists rxnorm.rxncuichanges_20240102;

Or:

-- list roles
select usename as username,

  case 
     when usesuper then 
	   cast('superuser' as pg_catalog.text)
     else 
	    cast('No user' AS pg_catalog.text)
  end user_attribute

from pg_catalog.pg_user
order by username asc;

from dbeaver.

E1izabeth avatar E1izabeth commented on May 30, 2024

Thank you for more examples. All of them works right for me on version 24.0.4. We have a bug in 24.0.3, but now it's fixed. I cannot reproduce the behavior you're describing.

from dbeaver.

E1izabeth avatar E1izabeth commented on May 30, 2024

You can change this setting to Always. It should help
image

from dbeaver.

E1izabeth avatar E1izabeth commented on May 30, 2024

#30136 (comment)

from dbeaver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.