SqlDbx Forum

SqlDbx

You are not logged in.

#1 2013-05-17 14:54:35

FabricioAraujo
Member

Permanent Collapsable sections of sql (a.k.a. regions)

Just an idea, I think it's not that difficult since you already have
the ability to collapse sections of code previously selected.

In Delphi, C#, VB.NET and other languages you have the ability
to mark certain parts of source-code with special comments delimiting
an collapsable section. Ex.:
-- Delphi

{$region Name of region}
begin 
  writeln('Test');
end;
{$end region}

-- C#

#region Name of the region
int i; string j;
#endregion

--VB.NET

#Region "Name of the region"
Dim S as String
Dim I as Integer
#End Region

The effect? The '-' appear on left of the start region marker like what already happens in
SQLDbx when you select SQL code, allowing to collapse the section delimited by the
directives. When the text collapse, the "Name of the region" will be displayed instead of collapsed
text (or just "region" if a name was not given). SQLDbx when collapse text shows the first line of
the collapsed text, in comparison.

Region directives does not have any other effect on code except to allowing the code
to be collapsed without previous selection.

What you think about it?

Offline

#2 2013-05-19 22:09:12

sqldbxhelp
Administrator

Re: Permanent Collapsable sections of sql (a.k.a. regions)

That sound's interesting and should not be hard to implement.
Not really sure how useful this feature is for SQL

Offline

#3 2013-05-20 14:29:55

FabricioAraujo
Member

Re: Permanent Collapsable sections of sql (a.k.a. regions)

sqldbxhelp wrote:

That sound's interesting and should not be hard to implement.
Not really sure how useful this feature is for SQL

Since procedures in TSQL (and other SQL dialects) can be quite extense, so regions
allows for the database developer to break the SQL in sections which (s)he can hide
so only the interesting code is shown. As actually is, the developer have to re-break
the sections each time the sql file/code is open/extracted.

Actually, the extense the code, more interesting it is.

Offline

#4 2014-10-29 01:42:41

zluis0
Member

Re: Permanent Collapsable sections of sql (a.k.a. regions)

In SqlDbx Modify large objects is difficult.

Code folding is the perfect solution.

The regions can be simulated with blocks "begin-end"

Examples:
- /*
    ...
    ...
    ...
  */
+ /*
   */


- begin
    ...
    ...
    ...
  end
+ begin
   end


- case
    when a = 'x' then 1
    when b = 'y' then 2
    when c = 'z' then 3
  end
+ case
   end


They could use the scintilla editor component . Already have implemented many functions.

http://www.scintilla.org/
http://en.wikipedia.org/wiki/Scintilla_(software )

Last edited by zluis0 (2014-10-29 01:49:59)

Offline

Board footer

Powered by FluxBB