Lumus sql builder
About project
Lumus SQL Builder is a Rust library that allows you to programmatically and intuitively construct complex SQL queries for simple projects. It supports a variety of SQL operations, including column selection, joins, WHERE clauses, grouping, sorting, and more.
Features
- Table creation
- Data insertion
- Data selection with support for DISTINCT, GROUP BY, ORDER BY, LIMIT, and OFFSET
- A simple way to make WHERE clauses
Example Usage
Creating a Table
use ;
Output
INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL,
age INTEGER NOT NULL,
department TEXT DEFAULT 'Undefined',
salary REAL,
hired_date DATETIME,
manager_id INTEGER
);
(
id
Inserting Data
use Insert;
Output
INSERT INTO employees (name, age, department, salary, hired_date, manager_id) VALUES ('John', '30', 'IT', '5000.00', '2024-03-20', '1');
Selecting Data
use ;
Output
SELECT name, age, department FROM employees WHERE age > 25 ORDER BY age DESC LIMIT 10;