How do i can convert python list to an array to include in mysql query? im using a mysql connector module, and got this error
Failed processing pyformat-parameters; Python 'tuple' cannot be converted to a MySQL type
im using this construction to get my values from url
from fastapi import FastAPI, Query
from typing import List
app = FastAPI()
@app.get("/myurl")
async def my_url(my_id: int = Query(...), my_type: List[int] = Query(None)):
query_inc = ("SELECT * from v_comments WHERE id=%(id)s and my_typeIN (%(my_type)s) ;")
i tried to make this type=tuple(type) but got error i\ve listed below
if im not using tuple convert i got this mysql.connector.errors.ProgrammingError: Failed processing pyformat-parameters; Python 'list' cannot be converted to a MySQL type