A
A
AirronBark2021-11-18 15:47:07
Database
AirronBark, 2021-11-18 15:47:07

What is closer in terms of queries to sqlite3 - MySQL or PostgreSQL?

I’m making a telegram bot and decided to run it on heroku, because it doesn’t accept sqlite as a subd, I’ll have to choose from what remains, and accordingly the question (because I haven’t studied other DBMS):
Is the code for accessing the database the same in all these DBMS or does the syntax change? And which would be easier to switch to?

*for example:

def get_user_id(self, user_id):
        """Достаем id юзера в базе по его user_id"""
        result = self.connection.execute("""SELECT id FROM clients WHERE user_id = ?""", (user_id,))
        return result.fetchone()

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Ronald McDonald, 2021-11-18
@Zoominger

Simple queries can be left unchanged.
SQL is a universal language.
Switch to mySQL.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question