What is OmniQL?
OmniQL is an open-source Go library that compiles a single query language into native PostgreSQL, MySQL, MongoDB, and Redis syntax. It wraps your existing database connection, allowing you to decouple your business logic from your database implementation.Why OmniQL?
Problem: Switching databases (e.g., from Postgres to Mongo) usually requires rewriting your entire data access layer. Supporting multiple databases in one product requires maintaining multiple codebases. Solution: OmniQL acts as a compiler. You write your queries once in OmniQL syntax, and the engine instantly translates them into native commands for your target database.Key Features
- Universal Syntax: Learn one syntax (
:GET,:CREATE,:UPDATE,:DELETE) instead of memorizing SQL dialects, BSON maps, and Redis commands. - Plug and Play: Wrap your existing database connection with
WrapSQL(),WrapMongo(), orWrapRedis()and start querying immediately. - Zero Overhead: OmniQL translates queries instantly. No ORM magic, no reflection—just native query strings executed by your standard drivers.
- TrueAST Architecture: Queries are parsed into a recursive Abstract Syntax Tree, enabling complex nested expressions and type safety.
- Polyglot Persistence: Use relational, document, and key-value stores with the same query syntax.
Supported Databases
How It Works
- Wrap: Connect OmniQL to your existing database connection.
- Query: Pass an OmniQL string (starting with
:) toclient.Query(). - Compile: The parser validates syntax and builds the AST.
- Translate: The translator generates native commands for your database.
- Execute: OmniQL runs the query and returns results as
[]map[string]any.
Quick Example
Next Steps
Quickstart
Install the Go package and run your first query
Syntax Basics
Learn the : prefix and syntax rules

