@@ -12887,13 +12887,13 @@ namespace sqlite_orm {
12887
12887
}
12888
12888
};
12889
12889
12890
- template<class T, class O >
12891
- struct ast_iterator<left_join_t<T, O>, void > {
12892
- using node_type = left_join_t<T, O> ;
12890
+ template<class Join >
12891
+ struct ast_iterator<Join, match_if<is_constrained_join, Join> > {
12892
+ using node_type = Join ;
12893
12893
12894
12894
template<class L>
12895
- void operator()(const node_type& j , L& lambda) const {
12896
- iterate_ast(j .constraint, lambda);
12895
+ void operator()(const node_type& join , L& lambda) const {
12896
+ iterate_ast(join .constraint, lambda);
12897
12897
}
12898
12898
};
12899
12899
@@ -12902,8 +12902,8 @@ namespace sqlite_orm {
12902
12902
using node_type = on_t<T>;
12903
12903
12904
12904
template<class L>
12905
- void operator()(const node_type& o , L& lambda) const {
12906
- iterate_ast(o .arg, lambda);
12905
+ void operator()(const node_type& on , L& lambda) const {
12906
+ iterate_ast(on .arg, lambda);
12907
12907
}
12908
12908
};
12909
12909
@@ -12919,36 +12919,6 @@ namespace sqlite_orm {
12919
12919
}
12920
12920
};
12921
12921
12922
- template<class T, class O>
12923
- struct ast_iterator<join_t<T, O>, void> {
12924
- using node_type = join_t<T, O>;
12925
-
12926
- template<class L>
12927
- void operator()(const node_type& j, L& lambda) const {
12928
- iterate_ast(j.constraint, lambda);
12929
- }
12930
- };
12931
-
12932
- template<class T, class O>
12933
- struct ast_iterator<left_outer_join_t<T, O>, void> {
12934
- using node_type = left_outer_join_t<T, O>;
12935
-
12936
- template<class L>
12937
- void operator()(const node_type& j, L& lambda) const {
12938
- iterate_ast(j.constraint, lambda);
12939
- }
12940
- };
12941
-
12942
- template<class T, class O>
12943
- struct ast_iterator<inner_join_t<T, O>, void> {
12944
- using node_type = inner_join_t<T, O>;
12945
-
12946
- template<class L>
12947
- void operator()(const node_type& j, L& lambda) const {
12948
- iterate_ast(j.constraint, lambda);
12949
- }
12950
- };
12951
-
12952
12922
template<class R, class T, class E, class... Args>
12953
12923
struct ast_iterator<simple_case_t<R, T, E, Args...>, void> {
12954
12924
using node_type = simple_case_t<R, T, E, Args...>;
@@ -17288,30 +17258,33 @@ namespace sqlite_orm {
17288
17258
}
17289
17259
};
17290
17260
17291
- template<class O>
17292
- struct statement_serializer<cross_join_t<O>, void> {
17293
- using statement_type = cross_join_t<O>;
17261
+ template<class Join>
17262
+ struct statement_serializer<
17263
+ Join,
17264
+ std::enable_if_t<polyfill::disjunction_v<polyfill::is_specialization_of<Join, cross_join_t>,
17265
+ polyfill::is_specialization_of<Join, natural_join_t>>>> {
17266
+ using statement_type = Join;
17294
17267
17295
17268
template<class Ctx>
17296
- std::string operator()(const statement_type& c , const Ctx& context) const {
17269
+ std::string operator()(const statement_type& join , const Ctx& context) const {
17297
17270
std::stringstream ss;
17298
- ss << static_cast<std::string>(c ) << " "
17299
- << streaming_identifier(lookup_table_name<O >(context.db_objects));
17271
+ ss << static_cast<std::string>(join ) << " "
17272
+ << streaming_identifier(lookup_table_name<type_t<Join> >(context.db_objects));
17300
17273
return ss.str();
17301
17274
}
17302
17275
};
17303
17276
17304
- template<class T, class O >
17305
- struct statement_serializer<inner_join_t<T, O>, void > {
17306
- using statement_type = inner_join_t<T, O> ;
17277
+ template<class Join >
17278
+ struct statement_serializer<Join, match_if<is_constrained_join, Join> > {
17279
+ using statement_type = Join ;
17307
17280
17308
17281
template<class Ctx>
17309
- std::string operator()(const statement_type& l , const Ctx& context) const {
17282
+ std::string operator()(const statement_type& join , const Ctx& context) const {
17310
17283
std::stringstream ss;
17311
- ss << static_cast<std::string>(l ) << " "
17312
- << streaming_identifier(lookup_table_name<mapped_type_proxy_t<T >>(context.db_objects),
17313
- alias_extractor<T >::as_alias())
17314
- << " " << serialize(l .constraint, context);
17284
+ ss << static_cast<std::string>(join ) << " "
17285
+ << streaming_identifier(lookup_table_name<mapped_type_proxy_t<type_t<Join> >>(context.db_objects),
17286
+ alias_extractor<type_t<Join> >::as_alias())
17287
+ << " " << serialize(join .constraint, context);
17315
17288
return ss.str();
17316
17289
}
17317
17290
};
@@ -17321,69 +17294,11 @@ namespace sqlite_orm {
17321
17294
using statement_type = on_t<T>;
17322
17295
17323
17296
template<class Ctx>
17324
- std::string operator()(const statement_type& t , const Ctx& context) const {
17297
+ std::string operator()(const statement_type& on , const Ctx& context) const {
17325
17298
std::stringstream ss;
17326
17299
auto newContext = context;
17327
17300
newContext.skip_table_name = false;
17328
- ss << static_cast<std::string>(t) << " " << serialize(t.arg, newContext) << " ";
17329
- return ss.str();
17330
- }
17331
- };
17332
-
17333
- template<class T, class O>
17334
- struct statement_serializer<join_t<T, O>, void> {
17335
- using statement_type = join_t<T, O>;
17336
-
17337
- template<class Ctx>
17338
- std::string operator()(const statement_type& l, const Ctx& context) const {
17339
- std::stringstream ss;
17340
- ss << static_cast<std::string>(l) << " "
17341
- << streaming_identifier(lookup_table_name<mapped_type_proxy_t<T>>(context.db_objects),
17342
- alias_extractor<T>::as_alias())
17343
- << " " << serialize(l.constraint, context);
17344
- return ss.str();
17345
- }
17346
- };
17347
-
17348
- template<class T, class O>
17349
- struct statement_serializer<left_join_t<T, O>, void> {
17350
- using statement_type = left_join_t<T, O>;
17351
-
17352
- template<class Ctx>
17353
- std::string operator()(const statement_type& l, const Ctx& context) const {
17354
- std::stringstream ss;
17355
- ss << static_cast<std::string>(l) << " "
17356
- << streaming_identifier(lookup_table_name<mapped_type_proxy_t<T>>(context.db_objects),
17357
- alias_extractor<T>::as_alias())
17358
- << " " << serialize(l.constraint, context);
17359
- return ss.str();
17360
- }
17361
- };
17362
-
17363
- template<class T, class O>
17364
- struct statement_serializer<left_outer_join_t<T, O>, void> {
17365
- using statement_type = left_outer_join_t<T, O>;
17366
-
17367
- template<class Ctx>
17368
- std::string operator()(const statement_type& l, const Ctx& context) const {
17369
- std::stringstream ss;
17370
- ss << static_cast<std::string>(l) << " "
17371
- << streaming_identifier(lookup_table_name<mapped_type_proxy_t<T>>(context.db_objects),
17372
- alias_extractor<T>::as_alias())
17373
- << " " << serialize(l.constraint, context);
17374
- return ss.str();
17375
- }
17376
- };
17377
-
17378
- template<class O>
17379
- struct statement_serializer<natural_join_t<O>, void> {
17380
- using statement_type = natural_join_t<O>;
17381
-
17382
- template<class Ctx>
17383
- std::string operator()(const statement_type& c, const Ctx& context) const {
17384
- std::stringstream ss;
17385
- ss << static_cast<std::string>(c) << " "
17386
- << streaming_identifier(lookup_table_name<O>(context.db_objects));
17301
+ ss << static_cast<std::string>(on) << " " << serialize(on.arg, newContext) << " ";
17387
17302
return ss.str();
17388
17303
}
17389
17304
};
0 commit comments