MCPcopy Create free account
hub / github.com/chris2511/xca / rewriteQuery

Method rewriteQuery

lib/sql.cpp:122–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120}
121
122QString XSqlQuery::rewriteQuery(QString _q)
123{
124 static const QStringList tables {
125 "items" , "crls" , "private_keys" , "public_keys" ,
126 "tokens" , "token_mechanism" , "templates" , "certs" ,
127 "authority" , "revocations" , "requests" , "x509super" ,
128 "settings" , "takeys",
129
130 "view_public_keys" , "view_certs" , "view_requests" ,
131 "view_crls" , "view_templates" , "view_private",
132 };
133
134 lastq = query = _q;
135 if (table_prefix.isEmpty())
136 return query;
137
138 QString m = tables.join("|") + "|i_" + tables.join("|i_");
139 m = QString("\\b(%1)").arg(m);
140 query = query.replace(QRegularExpression(m), table_prefix + "\\1");
141
142 return query;
143}
144
145QString XSqlQuery::query_details()
146{

Callers

nothing calls this directly

Calls 2

QStringClass · 0.70
isEmptyMethod · 0.45

Tested by

no test coverage detected