Because Cloud SQL utilizes the MySQL wire protocol and lacks support for JavaScript (or even the underlying socket requirements), it is not feasible to directly connect JavaScript to Cloud SQL.
Even if this were possible, it is not recommended due to the significant security risks involved. Embedding the username/password for the database in your extension would prevent any data separation among users.
Typically, a backend is necessary to enforce Access Control Lists (ACLs) and simplify future development (such as an app, website, desktop app, API, etc). This backend does not need to be overly complex - Firebase offers a user-friendly backend solution that requires no coding expertise (although it does not rely on MySQL).