-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add SQL template for Python v2 #1063
Comments
Is it possible to add multiple rows to the database in one go? |
Yes, in Python you can use SqlRowList to add multiple rows. See this sample: azure-functions-sql-extension/samples/samples-python/AddProductsArray/__init__.py Line 16 in 3a59712
|
@LouisDeconinck, this seems like a functions error, not specific to SQL Bindings. Could you file an issue in the Azure Functions Host repository? |
@lucyzhang929 I'm running into another issue. Getting the following error: Is there anyway how I can detect that the database will not be available and retry writing another time? I have the following code, but this doesn't work as I believe that the .set() happens asynchronously after the function has already ended. max_retries = 10
retries = 0
while retries < max_retries:
try:
r.set(rows_sql)
total_time = time.time() - start_time
logging.info(f"End of scraping. Scraped {len(rows)} groups in {total_time}.")
break
except Exception as e:
logging.error(f"An error occurred: {str(e)}")
retries += 1
if retries < max_retries:
logging.info(f"Retrying after 30 seconds... (retry {retries}/{max_retries})")
time.sleep(30)
else:
logging.error(f"An error occurred: {str(e)}") |
@LouisDeconinck Can you create a separate issue for your question please? https://github.com/Azure/azure-functions-sql-extension/issues/new/choose Thank you! |
Add template here: https://github.com/Azure/azure-functions-templates/tree/dev/Functions.Templates/Templates-v2
The text was updated successfully, but these errors were encountered: