GET {url localhost } net::ERR_SSL_PROTOCOL_ERROR problem with my custom api

I develop an api with a partner. This one if you want to check.. https://github.com/korodum/TrainingAppBack When I try to connect to this endpoint. I get this error. ListTrainings.js:19 GET https://localhost:4000/trainings net::ERR_SSL_PROTOCOL_ERROR The fetch is fine, as is the endpoint. const [token] = useToken(); const [ trainings, setTrainings] = useState(); const [error, setError] = useState(); const… Read More GET {url localhost } net::ERR_SSL_PROTOCOL_ERROR problem with my custom api

SQLAlchemy connection autoclose on function failure

Say I have the following function: @app.route("/function") def function(): engine = sqlalchemy.getEngine() # simplified to indicate we get an engine connection = engine.connect() result = utils.doThings(connection) connection.close() If utils.doThings fails and my api call would usually just crash and write a report of the crash. Will my connection remain alive indefinitely? Or will overtime, the… Read More SQLAlchemy connection autoclose on function failure

Export Postgresql Table to excel with header in Python

My code works but it doesn’t bring the header with the names, it only brings the numbers 0 1 … 10 , what can I do ? Utils_db.py def consulta_sql(sql): try: connection = psycopg2.connect(user="postgres", password="postgres", host="localhost", port="5432", database="tb_cliente") cursor = connection.cursor() except (Exception, psycopg2.Error) as error: try: cursor.execute(sql) connection.commit() except (Exception, psycopg2.Error) as error: finally:… Read More Export Postgresql Table to excel with header in Python

How to handle "The given header was not found" when paging records in c# API GET request?

I’m requesting data from an API that requires paging records based on a custom header called "cursor". Only 100 records may be retrieved per call and as such I’ve created a while loop to execute. The loop functions… until it doesn’t. Once all records are paged, the headers get dropped and my program errors out… Read More How to handle "The given header was not found" when paging records in c# API GET request?

How can I create the columns to my table when using pandas.to_sql?

I was creating a test SQL database with the following code: import sqlite3 connection = sqlite3.connect(‘tv.sqlite’) cursor = connection.cursor() #Create database sql_query = """ CREATE TABLE tvshows ( id integer PRIMARY KEY, producer text NOT NULL, language text NOT NULL, title text NOT NULL )""" #Execute the SQL query cursor.execute(sql_query) I get to define the… Read More How can I create the columns to my table when using pandas.to_sql?

Unable to retrieve multiple values from database

The following data exists in the database: [ { "_id": { "$oid": "628c787de53612aad30021ab" }, "ticker": "EURUSD", "dtyyyymmdd": "20030505", "time": "030000", "open": "1.12161", "high": "1.12209", "low": "1.12161", "close": "1.12209", "vol": "561", "id": 1 }, { "_id": { "$oid": "628c787de53612aad30021ac" }, "ticker": "EURUSD", "dtyyyymmdd": "20030505", "time": "030100", "open": "1.12206", "high": "1.1225", "low": "1.12206", "close": "1.1225", "vol": "1223",… Read More Unable to retrieve multiple values from database