@@ -42,8 +42,8 @@ struct on_duplicate_key_update {
4242 return *this ;
4343 }
4444
45- auto get () const -> sqlpp::verbatim_t<::sqlpp::no_value_t> {
46- return ::sqlpp::verbatim (_serialized);
45+ auto get () const -> sqlpp::verbatim_clause_t {
46+ return ::sqlpp::verbatim_clause (_serialized);
4747 }
4848};
4949} // namespace
@@ -57,7 +57,7 @@ int CustomQuery(int, char*[]) {
5757
5858 // A void custom query
5959 auto x = sqlpp::statement_t {}
60- << sqlpp::verbatim (" PRAGMA writeable_schema = 1" );
60+ << sqlpp::verbatim_clause (" PRAGMA writeable_schema = 1" );
6161 std::cerr << to_sql_string (printer, x) << std::endl;
6262 db (x);
6363
@@ -76,14 +76,14 @@ int CustomQuery(int, char*[]) {
7676 }
7777
7878 // Create a custom "insert or ignore"
79- db (sqlpp::insert () << sqlpp::verbatim (" OR IGNORE" ) << into (t)
79+ db (sqlpp::insert () << sqlpp::verbatim_clause (" OR IGNORE" ) << into (t)
8080 << insert_set (t.textN = " sample" , t.boolNn = true ));
8181
8282 // Create a custom multi-row "insert or ignore"
8383 auto batch = insert_columns (t.textN , t.boolNn );
8484 batch.add_values (t.textN = " sample" , t.boolNn = true );
8585 batch.add_values (t.textN = " ample" , t.boolNn = false );
86- db (sqlpp::insert () << sqlpp::verbatim (" OR IGNORE" ) << into (t) << batch);
86+ db (sqlpp::insert () << sqlpp::verbatim_clause (" OR IGNORE" ) << into (t) << batch);
8787
8888 // Create a MYSQL style custom "insert on duplicate update"
8989 db (sqlpp::insert_into (t).set (t.textN = " sample" , t.boolNn = true )
@@ -102,22 +102,24 @@ int CustomQuery(int, char*[]) {
102102 " insert yields an integral value" );
103103
104104 auto d = sqlpp::statement_t {}
105- << sqlpp::verbatim (" INSERT INTO tab_sample VALUES()" )
105+ << sqlpp::verbatim_clause (" INSERT INTO tab_sample VALUES()" )
106106 << with_result_type_of (sqlpp::insert ());
107107 auto j = db (d).last_insert_id ;
108108 static_assert (std::is_integral<decltype (j)>::value,
109109 " insert yields an integral value" );
110110
111111 for (const auto & row :
112- db (sqlpp::statement_t {} << sqlpp::verbatim (" PRAGMA user_version" )
112+ db (sqlpp::statement_t {} << sqlpp::verbatim_clause (" PRAGMA user_version" )
113113 << with_result_type_of (select (all_of (t))))) {
114114 (void )row.id ;
115115 }
116116
117+ (select (all_of (t)).from (t) << sqlpp::verbatim_clause (" something" )).as (sqlpp::alias::a);
118+
117119 // If you really want the statement to contain "SELECT *" instead of every
118120 // column explicitly (maybe you are running into size limits?)
119121 for (const auto & row :
120- db (sqlpp::statement_t {} << sqlpp::verbatim (" SELECT *" ) << from (t)
122+ db (sqlpp::statement_t {} << sqlpp::verbatim_clause (" SELECT *" ) << from (t)
121123 << where (t.id > 17 )
122124 << with_result_type_of (select (all_of (t))))) {
123125 (void )row.id ;
0 commit comments