Hi,
I’m new on ionic and I’ve some problem with cordova non-native plugin. After few long hours of search and reading I don’t find out how to use non-native plugin…
When I use
import { SqlServer } from 'cordova-plugin-sqlserver'
It’s doesn’t works .
When I uses :
declare var SqlServer : any;
[...]
window.plugins.SqlServer.init(...);
and the other ways likes (window).SqlServer don’t works also…
The error is : Cannot read property ‘SqlServer’ of undefined
Can you help me to solve this, or to use a non-native plugin ? With all this days on this I’m limit to think that is the plugin who doesn’t works and not my ways to uses it.
thanks for the futur answers
Also I’m French so, sorry for the languages errors
I work with sublimText, and I emulate on my browser (google Chrome)
If the app is going to be distributed at all, using this plugin potentially constitutes a huge security risk, as @Judgewest2000 suggested above. Anybody with a copy of the app binary has the ability to execute arbitrary SQL directly against your server.
IMHO, it is always better, even if seeming tedious in the beginning, to write a middleware application server that receives REST requests over HTTP and handles all interaction with the database. If one wants to develop and test a frontend app without having that infrastructure in the backend, instead of resorting to direct SQL access as is described in this thread, I would instead isolate all upstream server interaction into a service (I always call mine MothershipService) and mock out that service with a class that contains dummy data.