10 Commits

Author SHA1 Message Date
Yuri Astrakhan
6457419e0d
NOOP: Format all layer's SQL code (#917)
I would like to reformat all of our SQL to have a concise coding style.
This makes it far easier to understand the code for a casual contributor,
and lets us spot errors more easily.

Most importantly, it makes it much easier to grep (search) the code because it is more likely to be in the same syntax

Some key changes:
* SQL keywords are always UPPERCASE, e.g. `SELECT WHEN AS END ...`
* types, variables, aliases, and field names (identifiers) are always lower case
* `LANGUAGE 'plpgsql'` is now `LANGUAGE plpgsql` (no quotes)
* a few minor spacing/semicolon cleanups

P.S. Per @TomPohys request, `TABLE` is spelled using upper case despite being a type for consistency with PG Docs. Same for `LANGUAGE SQL` vs `LANGUAGE plpgsql`.
2020-06-08 12:19:55 -04:00
Yuri Astrakhan
c9e7ad90c6
Remove unneeded "else null" in conditions (#732)
Minor code cleanup:
SQL already returns NULL in the "WHEN" condition
if it is not matched by any of the cases.

Co-authored-by: Eva Jelinkova <evka.jelinkova@gmail.com>
2020-01-22 17:24:28 -05:00
Yuri Astrakhan
1d91b9ef6e
Noop: tag sql MAT VIEWS with a special comment (#733)
Tag all SQL materialized views with a machine-readable comment
to indicate that this materialized view can be created without
data:

   /* DELAY_MATERIALIZED_VIEW_CREATION */

In the next version of tools this comment can be optionally
replaced with the "WITH NO DATA" parameter, thus allowing
a much faster execution of the SQL script. All materialized
viewes will be populated with data in parallel afterwards
using the `refresh-views` tools script.
2020-01-20 12:02:49 -05:00
golubev
73307a610b layers/transportation_name/: add roads under construction, fix SQL error (#321) 2019-10-04 14:50:05 +03:00
jirik
92a056ab78 Abbreviate also name:latin of streets 2018-11-30 15:32:26 +01:00
jirik
bae5f21bb4 Respect current grouping of osm_transportation_name_network 2018-11-07 11:08:06 +01:00
Joakim Kronqvist
7ec9e49a44 Only group transportation name based on language tags 2018-11-07 11:08:06 +01:00
jirik
63f6915fab Add missing transportation_name features
Fix #372
2017-11-25 11:10:01 +01:00
jirik
e95f2d476b Add layer, level, and indoor tags for footways and steps 2017-11-09 10:13:53 +01:00
jirik
893918761c Fix SQL update logic (patch from 3.6.2) 2017-08-01 09:12:15 +02:00