Repository navigation
Add RQL (RavenDB Query Language) language definition - #4565
Open
leadsoftlucas wants to merge 3 commits into
Open
leadsoftlucas wants to merge 3 commits into
leadsoftlucas wants to merge 3 commits into
Conversation
RQL is RavenDB's query language, widely used in blog posts, docs, and Stack Overflow answers, but previously unrecognized by highlight.js. The keyword/function/operator lists are derived from RavenDB's own production RQL tokenizer and ANTLR4 grammar (github.com/ravendb/ravendb), including recent vector-search/AI tokens (vector.search, embedding.*, ai.task).
Expand the language header with a fuller description and links to the official RavenDB documentation (docs.ravendb.net) for RQL itself, vector search / AI functions, and patch scripts, plus a note on what this first version intentionally leaves out (embedded JS patch-script blocks).
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Adds a language definition for RQL (Raven Query Language), the SQL-like query language of RavenDB, a document database. RQL appears in the RavenDB Studio, the client APIs, the documentation and community answers, where it currently renders as plain text.
src/languages/rql.js: the grammar (idrql, case insensitive). Comments (//,/* */), strings (double, single and backtick quotes), clauses and keywords (from,where,group by,order by,select,load,include,update,declare,with,limit, ...), logical operators, the functions usable inwhereandorder by, order options, type casts, literals, the special tokens@metadataand@all_docs, numbers.test/markup/rql/: three markup tests (default,vector-search,where-functions).SUPPORTED_LANGUAGES.md: one line forRQL (RavenDB)/rql.The keyword, function and operator lists are derived from RavenDB's own public tooling: the tokenizer of the Studio query editor and the ANTLR4 grammar of its autocomplete service, both in https://github.com/ravendb/ravendb (
src/Raven.Studio). They include the recent vector search and AI functions (vector.search,embedding.*,ai.task). Reference: https://docs.ravendb.net/7.2/querying/rql/what-is-rqlKnown limitation: RQL
select { ... }andupdate { ... }can embed JavaScript patch scripts. They are highlighted as plain RQL here (no JavaScript sub-mode).A note on the contribution guide. We read
docs/language-contribution.rstand understand that new grammars are no longer merged into core. If you prefer the third-party route, please say so: we will move the grammar to a standalonehighlightjs-rqlmodule under the RavenDB organization, publish it, and send a small PR listing it inSUPPORTED_LANGUAGES.md. We are happy to close this PR in favor of that, and we will maintain the grammar either way.Checklist
Tests: the markup tests pass locally (606 passing, including the 3 new ones) and the build succeeds.
Assisted-by: Claude Code