removed class query and moved their static methods to simple functions

This commit is contained in:
2026-03-26 09:34:32 +01:00
parent 3fc08fb7ff
commit fedce38270
23 changed files with 283 additions and 286 deletions
+11 -11
View File
@@ -126,7 +126,7 @@ const auto statement = QString( "SELECT %5.%6, %1.%2 FROM %3 %1, %4 %5 WHERE %1.
const auto payloads = PAYLOAD.as( "payloads" );
const auto tasks = TASK.as( "tasks" );
const auto stmt1 = query:: query::select( { tasks.payload, payloads.id } )
const auto stmt1 = query::select( { tasks.payload, payloads.id } )
.from( tasks, payloads )
.where ( payloads.id == tasks.payload )
.str( conn->dialect() );
@@ -159,12 +159,12 @@ const auto statement = QString( "SELECT %5.%6, %1.%2 FROM %3 %1, %4 %5 WHERE %1.
const auto iPT = ID_PAYLOAD.as("iPT");
const auto pT = PAYLOAD.as("pT");
const auto stmt2 = query::query::select({ iPT.payload_id })
const auto stmt2 = query::select({ iPT.payload_id })
.from( iPT )
.join_left( pT ).on( iPT.id == pT.id )
.where(
in( pT.id, query::query::select({ JOB.payload }).from( JOB ).where( JOB.state == _) ) &&
in( iPT.payload_id, query::query::select({ temp_id_col }).from( temporary ) )
in( pT.id, query::select({ JOB.payload }).from( JOB ).where( JOB.state == _) ) &&
in( iPT.payload_id, query::select({ temp_id_col }).from( temporary ) )
)
.str( conn->dialect() );
@@ -178,13 +178,13 @@ const auto statement = QString( "SELECT %5.%6, %1.%2 FROM %3 %1, %4 %5 WHERE %1.
// .arg( LoginHistory::staticSqlMetaInfo().columnName( LoginHistory::Attributes::failReasonSqlAttributeId() ) )
// .arg( LoginHistory::staticSqlMetaInfo().columnName( LoginHistory::Attributes::idAttributeId() ) );
const auto q = query::query::select({LOGIN_HISTORY.client, query::maximum(LOGIN_HISTORY.login_time).as( "lastSuccessfulLogin" ) } )
const auto q = query::select({LOGIN_HISTORY.client, query::maximum(LOGIN_HISTORY.login_time).as( "lastSuccessfulLogin" ) } )
.from( LOGIN_HISTORY )
.where( LOGIN_HISTORY.fail_reason == _ )
.group_by( LOGIN_HISTORY.client );
// .as_table("ll");
const auto stmt3 = query::query::select({ LOGIN_HISTORY.client })
const auto stmt3 = query::select({ LOGIN_HISTORY.client })
.from( LOGIN_HISTORY )
.join_left(q/*, "ll"*/ )
.on( LOGIN_HISTORY.client == "ll.client" )
@@ -288,11 +288,11 @@ const auto statement = QString( "SELECT %5.%6, %1.%2 FROM %3 %1, %4 %5 WHERE %1.
// )
// )
const auto stmt4 = query::query::select({JOB.id})
const auto stmt4 = query::select({JOB.id})
.from(JOB)
.where( JOB.id > _ && JOB.name == _ && in( JOB.payload, query::query::select({PAYLOAD.id}).from(PAYLOAD).where(
in( PAYLOAD.id, query::query::select({ID_PAYLOAD.id}).from(ID_PAYLOAD).where(
in( ID_PAYLOAD.id, query::query::select({temp_id_col}).from(temporary))
.where( JOB.id > _ && JOB.name == _ && in( JOB.payload, query::select({PAYLOAD.id}).from(PAYLOAD).where(
in( PAYLOAD.id, query::select({ID_PAYLOAD.id}).from(ID_PAYLOAD).where(
in( ID_PAYLOAD.id, query::select({temp_id_col}).from(temporary))
) ) ) ) )
.str( conn->dialect() );
@@ -307,7 +307,7 @@ const auto statement = QString( "SELECT %5.%6, %1.%2 FROM %3 %1, %4 %5 WHERE %1.
// WHERE nj.ID > ?
// AND nj.TYPE = ?;
const auto stmt5 = query::query::select({JOB.id})
const auto stmt5 = query::select({JOB.id})
.from(JOB)
.join_left(PAYLOAD).on(JOB.payload == PAYLOAD.id)
.join_left(ID_PAYLOAD).on(PAYLOAD.id == ID_PAYLOAD.id)