Skip to content

fmt: format all .sql with jetbrains builtin sql formatter #136

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/fundamend/sqlmodels/create_ahbtabellen_view.sql
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ WITH consolidated_ahm AS (SELECT id,
coalesce(segment_ahb_status, segmentgroup_ahb_status)))) AS line_ahb_status,
coalesce(code_name, coalesce(dataelement_name, coalesce(dataelementgroup_name,
coalesce(segment_name, segmentgroup_name)))) AS line_name,
type as line_type
type as line_type
FROM ahb_hierarchy_materialized ahm
WHERE ahm.TYPE != 'dataelementgroup'
AND (ahm.TYPE != 'dataelement' OR ahm.dataelement_ahb_status IS NOT NULL))
Expand Down
74 changes: 37 additions & 37 deletions src/fundamend/sqlmodels/materialize_ahb_view.sql
Original file line number Diff line number Diff line change
Expand Up @@ -61,19 +61,19 @@ WITH RECURSIVE
) AS root_order
FROM ordered_roots),

root_hierarchy AS (SELECT o.anwendungsfall_primary_key AS anwendungsfall_pk,
o.primary_key AS current_id,
o.primary_key AS root_id,
NULL AS parent_id,
0 AS depth,
root_hierarchy AS (SELECT o.anwendungsfall_primary_key AS anwendungsfall_pk,
o.primary_key AS current_id,
o.primary_key AS root_id,
NULL AS parent_id,
0 AS depth,
o.position,
o.name AS path,
o.name AS parent_path,
o.name AS path,
o.name AS parent_path,
o.root_order,
o.type,
o.primary_key AS source_id,
substr('00000' || o.position, -5) || '-' AS sort_path,
o.root_id_text || '>' AS id_path,
o.primary_key AS source_id,
substr('00000' || o.position, -5) || '-' AS sort_path,
o.root_id_text || '>' AS id_path,
o.pruefidentifikator,
o.format,
o.versionsnummer,
Expand All @@ -84,35 +84,35 @@ WITH RECURSIVE
o.edifact_format_version,
o.anwendungshandbuch_primary_key,

CASE WHEN o.type = 'segment_group' THEN o.root_id_text ELSE NULL END AS segmentgroup_id,
CASE WHEN o.type = 'segment_group' THEN o.name ELSE NULL END AS segmentgroup_name,
CASE WHEN o.type = 'segment_group' THEN o.ahb_status ELSE NULL END AS segmentgroup_ahb_status,
CASE WHEN o.type = 'segment_group' THEN o.position ELSE NULL END AS segmentgroup_position,
CASE WHEN o.type = 'segment_group' THEN o.root_id_text ELSE NULL END AS segmentgroup_id,
CASE WHEN o.type = 'segment_group' THEN o.name ELSE NULL END AS segmentgroup_name,
CASE WHEN o.type = 'segment_group' THEN o.ahb_status ELSE NULL END AS segmentgroup_ahb_status,
CASE WHEN o.type = 'segment_group' THEN o.position ELSE NULL END AS segmentgroup_position,
CASE
WHEN o.type = 'segment_group' THEN o.anwendungsfall_primary_key
ELSE NULL END AS segmentgroup_anwendungsfall_primary_key,

CASE WHEN o.type = 'segment' THEN o.root_id_text ELSE NULL END AS segment_id,
CASE WHEN o.type = 'segment' THEN o.name ELSE NULL END AS segment_name,
CASE WHEN o.type = 'segment' THEN o.number ELSE NULL END AS segment_number,
CASE WHEN o.type = 'segment' THEN o.ahb_status ELSE NULL END AS segment_ahb_status,
CASE WHEN o.type = 'segment' THEN o.position ELSE NULL END AS segment_position,

NULL AS dataelementgroup_id,
NULL AS dataelementgroup_name,
NULL AS dataelementgroup_position,

NULL AS dataelement_id,
NULL AS dataelement_name,
NULL AS dataelement_position,
NULL AS dataelement_ahb_status,

NULL AS code_id,
NULL AS code_name,
NULL AS code_description,
NULL AS code_value,
NULL AS code_ahb_status,
NULL AS code_position
ELSE NULL END AS segmentgroup_anwendungsfall_primary_key,

CASE WHEN o.type = 'segment' THEN o.root_id_text ELSE NULL END AS segment_id,
CASE WHEN o.type = 'segment' THEN o.name ELSE NULL END AS segment_name,
CASE WHEN o.type = 'segment' THEN o.number ELSE NULL END AS segment_number,
CASE WHEN o.type = 'segment' THEN o.ahb_status ELSE NULL END AS segment_ahb_status,
CASE WHEN o.type = 'segment' THEN o.position ELSE NULL END AS segment_position,

NULL AS dataelementgroup_id,
NULL AS dataelementgroup_name,
NULL AS dataelementgroup_position,

NULL AS dataelement_id,
NULL AS dataelement_name,
NULL AS dataelement_position,
NULL AS dataelement_ahb_status,

NULL AS code_id,
NULL AS code_name,
NULL AS code_description,
NULL AS code_value,
NULL AS code_ahb_status,
NULL AS code_position
FROM ordered_roots_with_order o),

hierarchy AS (SELECT *
Expand Down