reberhardt7 / cplayground

GNU General Public License v3.0
115 stars 14 forks source link

Add type safety for database queries #23

Open reberhardt7 opened 4 years ago

reberhardt7 commented 4 years ago

We're currently making database queries using the mysql library in db.ts. However, we've had bugs in the past because of simple type issues, since no type checking is done for passing variables as query parameters, or for processing data returned from the database.

To help cut down on these simple mistakes, it would be really helpful to use a typed query builder for db queries. This library seems pretty good from a quick glance: https://github.com/ggmod/type-sql