Comments (12)
Hi, your project looks very interesting. I found this while looking for a alternative to jq
, and also looking for a better syntax for rush
. Since rq
looks very similar to jq
feature wise, my suggestions would be to base the overall syntax on jq
's. This should make it easier for people to (hopefully) switch from jq
to rq
. These are some of the important parts:
- Indexing arrays/dictionaries shouldn't have its own command/process. Having
jq
-like indexing means you can have more flexibility; - Invoking/calling commands/processes without parentheses is a good idea. This should improve ergonomics while using it in the shell, and also get rid of the weird semicolon argument separator in
jq
; - Lambda/anonymous functions are a new thing in
rq
. When I took a look at the old examples, I find some of the lambdas would've been useless injq
because of the.
(dot) input, although in some other cases I can also see why lambdas would be useful. I saw that the old lambda syntax is based on JS's. That should be fine with most people, although expression grouping for the body of the lambda should be done with()
instead of{}
(unlike the first example here).
Edit: If rq
would be available as a library with a query language that would make it very easy to revive rush
, which should be a very useful tool.
Edit 2: If anyone wants to try out rush
but find the original is too outdated, here is my fork with minimal changes just to make it compile and work.
from rq.
Pardon me if this has been asked before, but does rq
really need a query language? I've been using this purely as a format conversion tool and it's kind of awesome. I can import a yaml file and query it with jq
, easily test MessagePack APIs by converting from plain JSON (and interpret responses), run CSV tools against JSON with xsv
, and if it supported TSV output, then even datamash
could join the fun.
Point is, rq
is immensely useful even without a query language. Why not focus on conversions and offload data manipulation to more specialized tools?
from rq.
With jq
I personally don't like some "shugary" aspects of the query language like square bracket surrounding for array creation:
jq '[.[] | {message: .commit.message, name: .commit.committer.name}]'
I'd prefer more linear "functional" pipeline akin to
jq '.[] | {message: .commit.message, name: .commit.committer.name} | :into []'
Another consideration is more functionality to work with table data. I would love to see for a query language at least something like Nu shell and at best something like Q. 😃
from rq.
@johantiden on the "success" and "how small" GNU utils are you might find https://danluu.com/cli-complexity/ quite amusing. wink
Nice one! Thanks for sharing!
Amusing and depressing at the same time.
from rq.
I'm an outsider here, as I only discovered this project while it's still considering a next query language, but think it's worth mentioning two different and IMO quite good structured data access and manipulation tools and corresponding syntaxes:
from rq.
@johantiden on the "success" and "how small" GNU utils are you might find https://danluu.com/cli-complexity/ quite amusing. 😉
from rq.
So just to be clear, this tool cannot be currently used to make queries?
Yes, if you're using the 1.0 version. You can still use pre 1.0 if you want.
Also, is it right that the previous query used JavaScript? If so why didnt it use Rust like the rest of the code?
Yes. I believe it's because it makes it easier for the users to customize the functionalities without digging into Rust code. But I need confirmation from @dflemstr .
Finally, if this tool cant query then why does it say "Record Query" here:
As you said, rq
currently cannot be used to make queries. Personally I don't think it's a good idea to release a 1.0 version with the core functionalities ripped out, while the new direction (this issue) is not settled as it causes confusion. But this is the author's choice, and he probably has a good reason for it.
Note: I'm also new here, just trying to help when possible.
from rq.
Another JSON query language. Rather verbose and SQL-like but still has nice features worth considering, IMO.
from rq.
@gabriel-fallen the Operon link is dead.
from rq.
@XVilka but the Operon itself is evidently not. 😃 Thanks for the heads-up, I've updated the comment.
from rq.
Great point! Even though I stumbled upon rq
while searching for an alternative to jq
for queries. I guess that could be a separate project though!
The longevity and success of GNU projects in the past have been how small they can stay. Do one thing and do it really well! It will be easier to take over ownership (or keep maintaining) if the scope is as small as possible.
from rq.
Hello,
I came here while looking for a tool to query/modify CBOR data. It could be very useful for CBOR, as there is no tool to manipulate this kind of data right now. At the moment, I need to convert my data to JSON, manipulate it with jq, and convert is back. However this is complex, especially because JSON does not support well binary formats.
from rq.
Related Issues (20)
- fail to build on ubuntu 18.04 using cargo install record-query HOT 1
- JSON5 support? HOT 1
- Improve description
- rq failed to parse valid toml HOT 1
- Not able to select fields HOT 2
- MacOS cargo install record-query fails to install HOT 3
- Do not use git desribe in the release HOT 1
- "at" syntax doesn't work starting from 1.0.0 HOT 1
- Is rq still a *query* tool? HOT 4
- Ordered Map HOT 1
- Protobuf base directory behavior unclear
- Invalid syntax when tapping with Homebrew
- AUR Build fails HOT 4
- Support for config/ini files
- Round trip CBOR -> JSON -> CBOR not working HOT 1
- rq v1.0.2 fails to build with Rust 1.56.1 and Cargo 1.56.0 HOT 7
- How to select a specific field? HOT 1
- Generic installer fails in Docker container
- Package this tool for Debian (apt) repos
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rq.