mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 18:57:39 -07:00
PetaPoco now defaults to SQLite, requires WHERE on exists calls
This commit is contained in:
parent
852b1e9bb5
commit
907c508a70
3 changed files with 40 additions and 5 deletions
|
@ -316,7 +316,7 @@ namespace PetaPoco
|
|||
Oracle,
|
||||
SQLite
|
||||
}
|
||||
DBType _dbType = DBType.SqlServer;
|
||||
DBType _dbType = DBType.SQLite;
|
||||
|
||||
// Common initialization
|
||||
private void CommonConstruct()
|
||||
|
@ -1256,18 +1256,18 @@ namespace PetaPoco
|
|||
case DBType.SQLite:
|
||||
case DBType.MySql:
|
||||
{
|
||||
existsTemplate = "SELECT EXISTS (SELECT 1 FROM {0} WHERE {1})";
|
||||
existsTemplate = "SELECT EXISTS (SELECT 1 FROM {0} {1})";
|
||||
break;
|
||||
}
|
||||
|
||||
case DBType.SqlServer:
|
||||
{
|
||||
existsTemplate = "IF EXISTS (SELECT 1 FROM {0} WHERE {1}) SELECT 1 ELSE SELECT 0";
|
||||
existsTemplate = "IF EXISTS (SELECT 1 FROM {0} {1}) SELECT 1 ELSE SELECT 0";
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
existsTemplate = "SELECT COUNT(*) FROM {0} WHERE {1}";
|
||||
existsTemplate = "SELECT COUNT(*) FROM {0} {1}";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue