[xorm] Remove some unused functions && mssql related logics (#60788)

* remove some unused functions

* more

* put back the pakcage replace
This commit is contained in:
ying-jeanne
2022-12-28 22:23:25 -05:00
committed by GitHub
parent 497ce81867
commit a3a0c01301
15 changed files with 17 additions and 311 deletions
+2 -6
View File
@@ -45,18 +45,14 @@ func (session *Session) Exist(bean ...interface{}) (bool, error) {
return false, err
}
if session.engine.dialect.DBType() == core.MSSQL {
sqlStr = fmt.Sprintf("SELECT TOP 1 * FROM %s %s WHERE %s", tableName, joinStr, condSQL)
} else if session.engine.dialect.DBType() == core.ORACLE {
if session.engine.dialect.DBType() == core.ORACLE {
sqlStr = fmt.Sprintf("SELECT * FROM %s WHERE (%s) %s AND ROWNUM=1", tableName, joinStr, condSQL)
} else {
sqlStr = fmt.Sprintf("SELECT * FROM %s %s WHERE %s LIMIT 1", tableName, joinStr, condSQL)
}
args = condArgs
} else {
if session.engine.dialect.DBType() == core.MSSQL {
sqlStr = fmt.Sprintf("SELECT TOP 1 * FROM %s %s", tableName, joinStr)
} else if session.engine.dialect.DBType() == core.ORACLE {
if session.engine.dialect.DBType() == core.ORACLE {
sqlStr = fmt.Sprintf("SELECT * FROM %s %s WHERE ROWNUM=1", tableName, joinStr)
} else {
sqlStr = fmt.Sprintf("SELECT * FROM %s %s LIMIT 1", tableName, joinStr)