I am writing a new project in angular and ionic, and coding in Visual Studio Code, using a tutorial from Udemy. In this tutorial, a API is used as an example ( newsapi.org ), for fetching data and displaying it etc. I also use cordova to build for android as this is a app that will be installed on a tablet.
In my project, I want to connect to a locally hosted database (SQL server 2017) that is simply installed on a windows 10 machine at each of our customers. I need basic CRUD operations (like inserting a new client that is captured on the tablet). From what I have seen, almost everyone recomends writing an API to form the connection. Is this the only way to connect to a locally hosted db? I also came across a cordova plugin (https://github.com/SergioDosSantos/cordova-plugin-sqlserver
), but this does not explain nicely how to implement it, and I was unable to get it to work correctly, when built, a error message "Tab1Page.html:21 ERROR TypeError: Cannot read property 'init' of undefined" is given.
What is the best way to connect to a local db?