Reputation: 325
I'm having a problem with flutter + SQL Server. Is there a way to communicate them without using an API?
I know its not recommended, but the company I work is making a very simple solution and they need it that way.
To explain what I want to do: its a very simple app, I just need to connect to the database to verify the user and password to login and some queries to get the items on a Service Order and add new items.
I have found the dart_mssql dependency but from what I understand doesn't work for mobile apps, only server side applications.
I'm not very experienced, so what is the simplest and quickest way to solve this?
Upvotes: 1
Views: 1195
Reputation: 473
The App simply should not communicate with the database directly.
Flutter is a client side UI toolkit, which means it will run on client devices like mobile phones, browsers, or native desktops. Connecting so many devices to a single sql server db only means you have another trouble coming.
Ideally there should be a server app in the middle, which takes in client requests (http, grpc, tcp or whatever) coming from flutter apps, processes them, makes appropriate changes on the database and returns a response back to the flutter apps.
Firebase is an easy way out. But if you want an sql server db, you'll need a server side app as bridge between flutter apps and db.
Upvotes: 0