frida_query_builder 1.1.0
frida_query_builder: ^1.1.0 copied to clipboard
A dart library that helps you create SQLITE queries using statements and the builder design pattern.
π¨ Frida query builder #
Frida Query Builder is a lightweight Dart library designed to build basic SQLite queries in a clear and structured way, without code generators, without heavy ORMs, and without complex configurations.
Its goal is to provide a minimal abstraction layer that allows developers to create SELECT, INSERT, UPDATE, and DELETE statements using Dart classes and methods, while keeping full control over the generated SQL.
Frida is built for developers who:
- Want explicit and predictable SQL
- Do not need automatic migrations or generated models
- Prefer simplicity over feature-heavy ORMs
- Work with SQLite in local applications (Flutter or pure Dart)
Frida Query Builder does not try to hide SQLβinstead, it makes it more readable, reusable, and safer, reducing common string-concatenation errors and improving code maintainability.
Examples #
DDL
final createUsers = Create(
tableName: "users",
columns: [
ColumnInteger(
name: "id",
isPrimaryKey: true,
isAutoIncrement: true,
),
ColumnText(
name: "name",
isNotNull: true,
),
],
);
print(FridaQueryBuilder(createUsers).build());
/* Output:
CREATE TABLE users(
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL
);
*/
DML
// Insert
final insertUser = Insert(
into: "users",
values: {
"name": "Felipe",
},
);
print(FridaQueryBuilder(insertUser).build());
/* Output:
INSERT INTO users(name) VALUES("Felipe");
*/
DQL
// Select
final selectUsers = Select(
from: "users",
columns: ["id".field, "name".field],
);
print(FridaQueryBuilder(selectUsers).build());
/* Output:
SELECT id, name
FROM users;
*/
π Supported SQLite Functionalities #
Data types
| Functionality | Supported |
|---|---|
| INTEGER | β |
| REAL | β |
| TEXT | β |
| BLOB | β |
Data definition
| Functionality | Supported |
|---|---|
| CREATE TABLE | β |
| DROP TABLE | β |
| ALTER TABLE (rename, add column) | β |
Data Manipulation
| Functionality | Supported |
|---|---|
| INSERT INTO (single row) | β |
| INSERT INTO (multiple rows) | β |
| UPDATE (with WHERE) | β |
| DELETE (with WHERE) | β |
Querying (SELECT)
| Functionality | Supported |
|---|---|
| SELECT (specific columns / *) | β |
| DISTINCT | β |
| WHERE conditions | β |
| ORDER BY | β |
| GROUP BY + HAVING | β |
| LIMIT + OFFSET | β |
| INNER JOIN | β |
| LEFT JOIN | β |
| Subqueries (WHERE, FROM, SELECT) | β |
| Aggregate functions (COUNT, SUM, AVG, MIN, MAX) | β |
Constraints & Expr.
| Functionality | Supported |
|---|---|
| CHECK | β |
| NOT NULL | β |
| DEFAULT | β |
| UNIQUE | β |
| PRIMARY KEY | β |
| FOREIGN KEY | β |
| Arithmetic operators (+, -, *, /) | β |
| Comparison operators (=, <>, <, <=, >, >=) | β |
| AND | β |
| OR | β |
| NOT | β |
| IN | β |
| BETWEEN | β |
| LIKE | β |
Transactions
| Functionality | Supported |
|---|---|
| BEGIN TRANSACTION | β |
| COMMIT | β |
| ROLLBACK | β |
| CREATE INDEX | β |
| DROP INDEX | β |
| Unique indexes | β |
Advanced
| Functionality | Supported |
|---|---|
| WITH (CTE) | β |
| Window functions | β |
| Full-text search (FTS5) | β |
| JSON functions | β |
π UML Diagram classes #
Statements classes
Builders classes