@@ -12887,13 +12887,13 @@ namespace sqlite_orm {
1288712887 }
1288812888 };
1288912889
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 ;
1289312893
1289412894 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);
1289712897 }
1289812898 };
1289912899
@@ -12902,8 +12902,8 @@ namespace sqlite_orm {
1290212902 using node_type = on_t<T>;
1290312903
1290412904 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);
1290712907 }
1290812908 };
1290912909
@@ -12919,36 +12919,6 @@ namespace sqlite_orm {
1291912919 }
1292012920 };
1292112921
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-
1295212922 template<class R, class T, class E, class... Args>
1295312923 struct ast_iterator<simple_case_t<R, T, E, Args...>, void> {
1295412924 using node_type = simple_case_t<R, T, E, Args...>;
@@ -17288,30 +17258,33 @@ namespace sqlite_orm {
1728817258 }
1728917259 };
1729017260
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;
1729417267
1729517268 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 {
1729717270 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));
1730017273 return ss.str();
1730117274 }
1730217275 };
1730317276
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 ;
1730717280
1730817281 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 {
1731017283 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);
1731517288 return ss.str();
1731617289 }
1731717290 };
@@ -17321,69 +17294,11 @@ namespace sqlite_orm {
1732117294 using statement_type = on_t<T>;
1732217295
1732317296 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 {
1732517298 std::stringstream ss;
1732617299 auto newContext = context;
1732717300 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) << " ";
1738717302 return ss.str();
1738817303 }
1738917304 };
0 commit comments