Skip to content

A lightweight and modular SQL query builder designed to generate SQL statements dynamically and programmatically.

Notifications You must be signed in to change notification settings

j-p-d-e-v/rQuery-Builder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rQuery Builder (WIP)

rQuery Builder is a lightweight, modular SQL query builder designed to generate SQL statements dynamically and programmatically. It aims to simplify common query construction across various databases—without the heavy abstraction of traditional ORMs.

Unlike most ORMs, rQuery Builder respects the syntax and features unique to each supported database. It provides isolated modules and methods per database, ensuring full flexibility and alignment with native SQL dialects.


✨ Key Features (Planned)

✅ Multi-Database Support (in progress)

  • Modular design with adapters for each database.
  • Initial support for:
    • PostgreSQL
    • MySQL
    • SurrealDB

🐘 PostgreSQL Support

Operators

  • = Equal
  • != Not Equal
  • LIKE
  • > Greater Than
  • >= Greater Than or Equal
  • < Less Than
  • <= Less Than or Equal
  • IN
  • NOT IN
  • IS NULL
  • IS NOT NULL
  • BETWEEN

SELECT

  • DISTINCT
  • ORDER BY
  • GROUP BY
  • WHERE
  • Select specific columns
  • JOIN (inner, left, etc.)
  • Table aliasing
  • Retrieve columns of a table
  • JSONB filtering(where), columns(select fields), group by and order by
  • Placeholder Kinds/Types: (?,$N)

INSERT

  • Single row insert
  • Bulk insert
  • Placeholder Kinds/Types: (?,$N)

UPDATE

  • Single row update
  • Bulk update
  • Placeholder Kinds/Types: (?,$N)

DELETE

  • DELETE queries
  • Placeholder Kinds/Types: (?,$N)

ACTUAL DB TESTING

  • SELECT queries
  • INSERT queries
  • UPDATE queries
  • DELETE queries

🐬 MySQL Support (Planned)

Targeting full feature parity with PostgreSQL support.


🧪 SurrealDB Support (Experimental)

Exploring support for SurrealDB's document-style query language and unique features.


🚀 Getting Started

Coming soon: Installation, setup instructions, and usage examples.


🛠 Development Setup

To speed up builds, it's recommended to use sccache for caching compiled dependencies.

Installing sccache

Linux / macOS (via Cargo):

cargo install sccache

macOS (via Homebrew):

brew install sccache

Windows (via Chocolatey):

choco install sccache

Configure Cargo to Use sccache

Add the following to your .cargo/config.toml:

[build]
rustc-wrapper = "sccache"

Verify it's working:

sccache --show-stats

🤝 Contributing

All contributions are welcome—feature suggestions, bug reports, documentation updates, or pull requests. Feel free to open an issue or contribute directly.


📄 License

MIT License

About

A lightweight and modular SQL query builder designed to generate SQL statements dynamically and programmatically.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages