mirror of
https://github.com/Radarr/Radarr
synced 2024-12-26 17:59:14 +00:00
31 lines
No EOL
750 B
C#
31 lines
No EOL
750 B
C#
using System.Text;
|
|
|
|
namespace Marr.Data.QGen
|
|
{
|
|
public class SqliteRowCountQueryDecorator : IQuery
|
|
{
|
|
private SelectQuery _innerQuery;
|
|
|
|
public SqliteRowCountQueryDecorator(SelectQuery innerQuery)
|
|
{
|
|
_innerQuery = innerQuery;
|
|
}
|
|
|
|
public string Generate()
|
|
{
|
|
StringBuilder sql = new StringBuilder();
|
|
|
|
BuildSelectCountClause(sql);
|
|
_innerQuery.BuildFromClause(sql);
|
|
_innerQuery.BuildJoinClauses(sql);
|
|
_innerQuery.BuildWhereClause(sql);
|
|
|
|
return sql.ToString();
|
|
}
|
|
|
|
private void BuildSelectCountClause(StringBuilder sql)
|
|
{
|
|
sql.AppendLine("SELECT COUNT(*)");
|
|
}
|
|
}
|
|
} |