Pakete, Repositories und App-Kategorien suchen

GitHub-RepositoryVaishnavDatir/sql_conn

sql_conn

sql_conn ist ein Plugin zum Verbinden einer Flutter-Android-Anwendung mit SQL Server.

Projektcover von sql_conn
Sterne
9
Forks
14
Letzter Push (UTC)
30.01.2026
Projektstatus
Aktiv

Original-README

Englischer Projektschnappschuss. Aktuelle Inhalte auf GitHub.

sql_conn

sql_conn is a production-ready Flutter plugin that allows Android applications to connect directly to SQL SERVER databases using JDBC.

It provides a clean, type-safe, null-safe Dart API powered by Pigeon, and a high-performance Android backend.

This plugin is designed for LAN / internal network / enterprise / industrial use-cases where direct database connectivity from a mobile device is required.


✨ Features

  • Android-only direct SQL connectivity
  • Database support:
    • Microsoft SQL Server
  • Prepared statements (parameterized queries)
  • Stored procedure execution
  • SQL script / batch execution
  • Fully null-safe Dart API
  • Type-safe Flutter ↔ Android bridge using Pigeon

📱 Platform Support

Platform Support
Android ✅ Yes
iOS 🚧 Under construction
Web 💭 Planning
Windows 🚫 No
MacOs 🚫 No

Direct database connections from mobile apps should only be used in trusted or internal networks.


🚀 Installation

Add to pubspec.yaml:

dependencies:
  sql_conn: ^2.0.0

⚙️ Basic Usage

Connect to a database
await SqlConn.connect(
  connectionId: "mainDB",
  host: "192.168.1.10",
  port: 1433,
  database: "MyDatabase",
  username: "admin",
  password: "Password@123",
);
Read data
final rows = await SqlConn.read(
  "mainDB",
  "SELECT * FROM users WHERE role = ?",
  params: ["admin"],
);

print(rows);
Write / Update / Delete
final count = await SqlConn.write(
  "mainDB",
  "UPDATE users SET active = ? WHERE id = ?",
  params: [true, 101],
);

print("Rows affected: $count");
Call Stored Procedure
final result = await SqlConn.callProcedure(
  "mainDB",
  "sp_generate_report",
  params: [2026, "JAN"],
);
Execute SQL Script
await SqlConn.executeScript(
  "mainDB",
  """
  CREATE TABLE logs(id INT, message VARCHAR(255));
  CREATE INDEX idx_logs ON logs(id);
  """,
);
Disconnect
await SqlConn.disconnect("mainDB");
🧩 Multiple Connections
await SqlConn.connect(connectionId: "db1", dbType: DatabaseType.sqlServer, ...);
await SqlConn.connect(connectionId: "db2", dbType: DatabaseType.postgres, ...);

final a = await SqlConn.read("db1", "SELECT * FROM table1");
final b = await SqlConn.read("db2", "SELECT * FROM table2");
🔧 Custom JDBC URL
await SqlConn.connect(
  connectionId: "legacy",
  host: "",
  port: 0,
  database: "",
  username: "sysdba",
  password: "masterkey",
  customJdbcUrl: "jdbc:firebirdsql://192.168.1.9/employee",
);

🧠 State Management

sql_conn is a stateless service API. You can integrate it with any state manager:

  • Provider
  • Riverpod
  • Bloc
  • GetX
  • Service Locators
  • Connection lifecycle is fully controlled by your app.

⚡ Performance

  • Prepared statement reuse
  • Non-blocking platform channel
  • Minimal memory overhead

🔐 Security

  • Prepared statements prevent SQL injection
  • No credential logging
Vaishnav Datir GitHub avatar
GitHub-Autor

Vaishnav Datir ↗

Tech-enthusiast and programmer. Mobile Application Developer 📱 Flutter 💙 Android Studio 😉 Node Js, Express, TypeScript 🚀 Java, Spring boot 🍀

Navi Mumbai, Maharashtra, INDIAOffizielle Website ↗
SprachenDartKotlin

Kategorien

Von diesem Repository veröffentlichte Pakete

Verwendete Abhängigkeiten

Abhängigkeiten 4 Einträge

  • flutter{"sdk":"flutter"}
  • flutter_testEntwicklung{"sdk":"flutter"}
  • pigeonEntwicklung^26.1.7
  • flutter_lintsEntwicklung^3.0.0

Wie wähle ich ein passendes Repository?

Nach Anwendungsfall filtern, Aktivität vergleichen und vor der Nutzung das Originalprojekt prüfen.

  1. Nach Name, Autor oder Beschreibung suchen und nach Thema eingrenzen.
  2. Sterne, Forks und letzte Pushes vergleichen. Sterne zeigen Interesse, garantieren aber keine Qualität.
  3. Vor der Nutzung README, Lizenz und Issues auf GitHub prüfen.

Quellen und Pflege

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗