fluent_query_builder
5.5.0, released 4 years ago by galileodart.com
A fluent SQL query builder library for PostgreSQL and MySQL databases in Dart.
What it does
Allows developers to construct and execute SQL queries (inserts, updates, deletes, selects) in a fluent, method-chaining manner for PostgreSQL and MySQL. It also implements connection pooling and a basic pre-ORM model mapping feature without code generation.
AI-written summary of version 5.5.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to execute raw or structured SQL queries against PostgreSQL or MySQL databases from Dart.
- You want a fluent query-building API without dealing with heavy ORM code generation.
Skip it when
- You are using a non-SQL database like Firebase or Hive.
- You require a full-featured, complex ORM with advanced relationships and lazy loading.
Strengths
- Supports both PostgreSQL and MySQL drivers.
- Fluent API style for common SQL clauses, transactions, and relation mapping.
- Built-in connection pooling and reconnection resiliency.
Weaknesses
- Requires manual handling of field and table name escaping in certain contexts.
- Pre-ORM features are relatively basic compared to full ORM solutions.
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 5
Requires database connection parameters (host, port, username, password) configured via DBConnectionInfo.
import 'package:fluent_query_builder/fluent_query_builder.dart';
void main() {
final pgsqlCom = DBConnectionInfo(
host: 'localhost',
database: 'banco_teste',
driver: ConnectionDriver.pgsql,
port: 5432,
username: 'user',
password: 'pass',
);
DbLayer().connect(pgsqlCom).then((db) async {
final result = await db.select().from('usuarios').getAsMap();
print(result);
});
}Alternatives
Packages that do the same job and could replace fluent_query_builder.
- dart_odbc
Dart library for connecting to ODBC data sources and executing SQL queries.
69Compare - sqflite_common_ffi_web
Sqflite web implementation using sqlite3 ffi and sqlite3 wasm.
90Compare - sqlite3
Lightweight and convenient SQLite bindings for Dart using dart:ffi
92Compare - cbl
An offline-first NoSQL document database with SQL++ queries, full-text search, and bi-directional sync.
86Compare
Works with
Packages commonly used together with fluent_query_builder: ones it builds on, ones built on it, and its own family.
- poolfluent_query_builder depends on itManage a finite pool of resources to control concurrent operations.
- loggingfluent_query_builder depends on itProvides configurable logging with levels and stream listeners for Dart apps.
- postgresfluent_query_builder depends on itPostgreSQL driver for Dart supporting binary protocol, pooling and statement reuse.