@@ -150,15 +150,16 @@ flex_table_column_t &flex_table_t::add_column(std::string const &name,
150150std::string flex_table_t::build_sql_prepare_get_wkb () const
151151{
152152 if (has_multicolumn_id_index ()) {
153- return " PREPARE get_wkb(char(1), bigint) AS"
154- " SELECT \" {}\" FROM {} WHERE \" {}\" = $1 AND \" {}\" = $2" _format (
155- geom_column ().name (), full_name (), m_columns[0 ].name (),
156- m_columns[1 ].name ());
153+ return fmt::format (
154+ " PREPARE get_wkb(char(1), bigint) AS"
155+ " SELECT \" {}\" FROM {} WHERE \" {}\" = $1 AND \" {}\" = $2" ,
156+ geom_column ().name (), full_name (), m_columns[0 ].name (),
157+ m_columns[1 ].name ());
157158 }
158159
159- return " PREPARE get_wkb(bigint) AS"
160- " SELECT \" {}\" FROM {} WHERE \" {}\" = $1" _format (
161- geom_column ().name (), full_name (), id_column_names ());
160+ return fmt::format ( " PREPARE get_wkb(bigint) AS"
161+ " SELECT \" {}\" FROM {} WHERE \" {}\" = $1" ,
162+ geom_column ().name (), full_name (), id_column_names ());
162163}
163164
164165std::string
@@ -167,8 +168,9 @@ flex_table_t::build_sql_create_table(table_type ttype,
167168{
168169 assert (!m_columns.empty ());
169170
170- std::string sql = " CREATE {} TABLE IF NOT EXISTS {} (" _format (
171- ttype == table_type::interim ? " UNLOGGED" : " " , table_name);
171+ std::string sql =
172+ fmt::format (" CREATE {} TABLE IF NOT EXISTS {} (" ,
173+ ttype == table_type::interim ? " UNLOGGED" : " " , table_name);
172174
173175 util::string_joiner_t joiner{' ,' };
174176 for (auto const &column : m_columns) {
@@ -208,8 +210,9 @@ std::string flex_table_t::build_sql_column_list() const
208210
209211std::string flex_table_t::build_sql_create_id_index () const
210212{
211- return " CREATE INDEX ON {} USING BTREE ({}) {}" _format (
212- full_name (), id_column_names (), tablespace_clause (index_tablespace ()));
213+ return fmt::format (" CREATE INDEX ON {} USING BTREE ({}) {}" , full_name (),
214+ id_column_names (),
215+ tablespace_clause (index_tablespace ()));
213216}
214217
215218flex_index_t &flex_table_t ::add_index(std::string method)
@@ -232,9 +235,9 @@ enable_check_trigger(pg_conn_t *db_connection, flex_table_t const &table)
232235
233236 for (auto const &column : table) {
234237 if (column.is_geometry_column () && column.needs_isvalid ()) {
235- checks.append (
236- R"( (NEW."{0}" IS NULL OR ST_IsValid(NEW."{0}")) AND )" _format (
237- column.name ()));
238+ checks.append (fmt::format (
239+ R"( (NEW."{0}" IS NULL OR ST_IsValid(NEW."{0}")) AND )" ,
240+ column.name ()));
238241 }
239242 }
240243
@@ -303,8 +306,9 @@ void table_connection_t::stop(bool updateable, bool append)
303306 flex_table_t ::table_type::permanent, table ().full_tmp_name ()));
304307
305308 std::string const columns = table ().build_sql_column_list ();
306- std::string sql = " INSERT INTO {} ({}) SELECT {} FROM {}" _format (
307- table ().full_tmp_name (), columns, columns, table ().full_name ());
309+ std::string sql = fmt::format (" INSERT INTO {} ({}) SELECT {} FROM {}" ,
310+ table ().full_tmp_name (), columns, columns,
311+ table ().full_name ());
308312
309313 auto const postgis_version = get_postgis_version ();
310314
@@ -316,11 +320,11 @@ void table_connection_t::stop(bool updateable, bool append)
316320 log_debug (" Using GeoHash for clustering table '{}'" ,
317321 table ().name ());
318322 if (table ().geom_column ().srid () == 4326 ) {
319- sql += " ST_GeoHash({},10)" _format ( geom_column_name);
323+ sql += fmt::format ( " ST_GeoHash({},10)" , geom_column_name);
320324 } else {
321- sql +=
322- " ST_GeoHash(ST_Transform(ST_Envelope({}),4326),10)" _format (
323- geom_column_name);
325+ sql += fmt::format (
326+ " ST_GeoHash(ST_Transform(ST_Envelope({}),4326),10)" ,
327+ geom_column_name);
324328 }
325329 sql += " COLLATE \" C\" " ;
326330 } else {
0 commit comments