force right type in requete
This commit is contained in:
parent
eb02269bbb
commit
2af04ba300
1 changed files with 3 additions and 1 deletions
|
@ -1,7 +1,7 @@
|
|||
import sqlite3
|
||||
|
||||
class Database:
|
||||
def __init__(self, urlDatabase):
|
||||
def __init__(self, urlDatabase: str):
|
||||
self.connexion = self.createConnection(urlDatabase)
|
||||
|
||||
def createConnection(self, path):
|
||||
|
@ -29,6 +29,8 @@ class Database:
|
|||
try:
|
||||
curseur = self.connexion.cursor()
|
||||
if valeurs:
|
||||
if type(valeurs) not in [list, tuple]:
|
||||
valeurs = [valeurs]
|
||||
curseur.execute(requete, valeurs)
|
||||
else:
|
||||
curseur.execute(requete)
|
||||
|
|
Reference in a new issue