Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to connect Ms SQL from a Flutter App? [closed]

Some context: The Db already exists and the app is for internal use of the company, that's why I'm not doing an API.

I need to connect my app to an SQL server to execute a query and retreive data from it.

I've already tried with this plugin but no succes SqlJocky5

Someone have done something similar already with flutter? How you did it? there's another library for connecting the app with a sql server? So, What I'm looking for is if there's a library to do it like in Xamarin Forms (SqlClient) or in Android Studio Java (JDBC Driver).

like image 215
Joaquín Avatar asked Jul 11 '18 22:07

Joaquín


1 Answers

I tried to ask a question and I got block because I didn’t answer some question.

Here is the answer:

From https://groups.google.com/forum/#!topic/flutter-dev/GO9ilukcoN4 from @Abner Hernandez

First: you need a SQLServerSocket: https://github.com/nippur72/SqlServerSocket is free and works! Second: you need a client https://github.com/nippur72/SqlServerSocket (look in DartClient folder). I did several connections and it works very well.

Of course, it is not as "easy to use, with 2 or 3 clicks and less programming..." but yes, you can "implement a simple SELECT * FROM XXX and show the results on both devices (IOS and Android) with Flutter." I did it.!

Yes I tested it with my remote sql and is working on CRUD. I didn't test for extensive query yet.

günter-zöchbauer gives the best practices.

You should use AQUEDUCT aqueduct.io and create a web api so your Flutter app connects to the server more securely.

like image 61
NTMS Avatar answered Sep 22 '22 00:09

NTMS