@@ -282,14 +282,14 @@ def nullAndCastField(self, field):
282282
283283 # SQLite version 2 does not support neither CAST() nor IFNULL(),
284284 # introduced only in SQLite version 3
285- if Backend .getIdentifiedDbms () == DBMS .SQLITE :
285+ if Backend .isDbms ( DBMS .SQLITE ) :
286286 return field
287287
288288 if field .startswith ("(CASE" ):
289289 nulledCastedField = field
290290 else :
291291 nulledCastedField = queries [Backend .getIdentifiedDbms ()].cast .query % field
292- if Backend .getIdentifiedDbms () == DBMS .ACCESS :
292+ if Backend .isDbms ( DBMS .ACCESS ) :
293293 nulledCastedField = queries [Backend .getIdentifiedDbms ()].isnull .query % (nulledCastedField , nulledCastedField )
294294 else :
295295 nulledCastedField = queries [Backend .getIdentifiedDbms ()].isnull .query % nulledCastedField
@@ -401,7 +401,7 @@ def getFields(self, query):
401401 def simpleConcatQuery (self , query1 , query2 ):
402402 concatenatedQuery = ""
403403
404- if Backend .getIdentifiedDbms () == DBMS .MYSQL :
404+ if Backend .isDbms ( DBMS .MYSQL ) :
405405 concatenatedQuery = "CONCAT(%s,%s)" % (query1 , query2 )
406406
407407 elif Backend .getIdentifiedDbms () in (DBMS .PGSQL , DBMS .ORACLE , DBMS .SQLITE ):
@@ -447,7 +447,7 @@ def concatQuery(self, query, unpack=True):
447447 else :
448448 return query
449449
450- if Backend .getIdentifiedDbms () == DBMS .MYSQL :
450+ if Backend .isDbms ( DBMS .MYSQL ) :
451451 if fieldsExists :
452452 concatenatedQuery = concatenatedQuery .replace ("SELECT " , "CONCAT('%s'," % kb .misc .start , 1 )
453453 concatenatedQuery += ",'%s')" % kb .misc .stop
@@ -540,7 +540,7 @@ def forgeInbandQuery(self, query, position, count, comment, prefix, suffix, char
540540 if query .startswith ("TOP" ):
541541 # TOP enumeration on DBMS.MSSQL is too specific and it has to go into it's own brackets
542542 # because those NULLs cause problems with ORDER BY clause
543- if Backend .getIdentifiedDbms () == DBMS .MSSQL :
543+ if Backend .isDbms ( DBMS .MSSQL ) :
544544 inbandQuery += "," .join (map (lambda x : char if x != position else '(SELECT %s)' % query , range (0 , count )))
545545 inbandQuery = self .suffixQuery (inbandQuery , comment , suffix )
546546 return inbandQuery
@@ -633,11 +633,11 @@ def limitQuery(self, num, query, field=None, uniqueField=None):
633633 limitStr = queries [Backend .getIdentifiedDbms ()].limit .query % (num , 1 )
634634 limitedQuery += " %s" % limitStr
635635
636- elif Backend .getIdentifiedDbms () == DBMS .FIREBIRD :
636+ elif Backend .isDbms ( DBMS .FIREBIRD ) :
637637 limitStr = queries [Backend .getIdentifiedDbms ()].limit .query % (num + 1 , num + 1 )
638638 limitedQuery += " %s" % limitStr
639639
640- elif Backend .getIdentifiedDbms () == DBMS .ORACLE :
640+ elif Backend .isDbms ( DBMS .ORACLE ) :
641641 if " ORDER BY " in limitedQuery and "(SELECT " in limitedQuery :
642642 orderBy = limitedQuery [limitedQuery .index (" ORDER BY " ):]
643643 limitedQuery = limitedQuery [:limitedQuery .index (" ORDER BY " )]
@@ -650,7 +650,7 @@ def limitQuery(self, num, query, field=None, uniqueField=None):
650650 limitedQuery = limitedQuery % fromFrom
651651 limitedQuery += "=%d" % (num + 1 )
652652
653- elif Backend .getIdentifiedDbms () == DBMS .MSSQL :
653+ elif Backend .isDbms ( DBMS .MSSQL ) :
654654 forgeNotIn = True
655655
656656 if " ORDER BY " in limitedQuery :
0 commit comments