This PR refactors in several commits the code creating SQL queries in the 
middle. There are two reasons for this:

1. This is the final change switching prepared statements from using `PREPARE` 
to using the special functions of the libpq library (see #2118). With this 
change osm2pgsql should work with setups using load balancers.
2. This moves the code generaring SQL statements from setup to the actual place 
where the SQL statement is used. This makes it somewhat easier to understand 
what's going on.

This is made possible by using a "templating engine" originally 
created for the generalization code which allows us to write templates of SQL 
code that are filled in with values for things such as "schema" or 
"prefix". The first commit moves this code from the 
"src/gen" directory into "src", futher commits refactor the 
code step by step.
You can view, comment on, or merge this pull request online at:

  https://github.com/osm2pgsql-dev/osm2pgsql/pull/2284

-- Commit Summary --

  * Move params.[ch]pp and template.[ch]pp into main src directory
  * Refactor: Use templates to create middle tables
  * Refactor: Use template rendering and explicit prepare function
  * Refactor: Switch index creation to new template code in middle
  * Refactor: Remove the last part of the table_sql struct, the name
  * Refactor: Remove m_users_table member variable

-- File Changes --

    M CMakeLists.txt (2)
    M src/CMakeLists.txt (2)
    M src/middle-pgsql.cpp (454)
    M src/middle-pgsql.hpp (32)
    R src/params.cpp (0)
    R src/params.hpp (0)
    R src/template.cpp (0)
    R src/template.hpp (0)

-- Patch Links --

https://github.com/osm2pgsql-dev/osm2pgsql/pull/2284.patch
https://github.com/osm2pgsql-dev/osm2pgsql/pull/2284.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/osm2pgsql-dev/osm2pgsql/pull/2284
You are receiving this because you are subscribed to this thread.

Message ID: <osm2pgsql-dev/osm2pgsql/pull/[email protected]>
_______________________________________________
Tile-serving mailing list
[email protected]
https://lists.openstreetmap.org/listinfo/tile-serving

Reply via email to