jay0072007

joined 1 week ago
[–] jay0072007 1 points 6 days ago

Thanks for your feedback! Will definitely look forward and add the missing features.

[–] jay0072007 2 points 6 days ago* (last edited 6 days ago)

jq and JSONPath are awesome projects, and JQLite is not a replacement for existing tools, but a learning project.

[–] jay0072007 1 points 6 days ago

JQLite is not any replacement for existing tools, it's just a learning/hobby project.

[–] jay0072007 1 points 6 days ago* (last edited 6 days ago)

That's actually great to query JSON with SQL! But as you can see the example from DuckDB is quite complex and unreadable as well.

And I have made this project for learning purpose and to challenge myself.

However, Thanks for sharing the project.

[–] jay0072007 9 points 1 week ago (1 children)

100% agreed. It's just a learning/hobby project, to know more about parsers, and how languages work. Some of the features like Wildcard, Multiple key selection/omission comes handy, and might add more features like that.

[–] jay0072007 4 points 1 week ago (3 children)

Thanks for sharing the project! JQLite is aimed to run in browsers and node, but will definitely take inspiration from "jq".

[–] jay0072007 5 points 1 week ago

That's a great project! JQLite is mainly focused on query-style approach. Also it's a hobby project for learning parsers and stuff.

[–] jay0072007 3 points 1 week ago

Thanks for your suggestion! It's definitely something I'll look into.

9
submitted 1 week ago by jay0072007 to c/opensource
 

JQLite - The query language for JSON.

Created a simple query language in Typescript.

Features:

  • Basic query selection
  • Fallback Mechanism
  • Wildcard support
  • Array Slices
  • Multiple Key Selection
  • Key Omission
  • Single Key Omission
  • Functions
  • Comparison Operators
  • Conditions
  • Configurable

Here's an example to get a list of all products with an average review more than 4:

$.products[?(@.reviews.#avg() > 4)]

Runs in browsers, and Node.js

Documentation site: https://jqlite.vercel.app/

GitHub: https://github.com/Jay-Karia/jqlite

NPM Package: https://www.npmjs.com/package/jqlite-ts

Data source for the query: https://jqlite.vercel.app/demo.json

69
submitted 1 week ago* (last edited 1 week ago) by jay0072007 to c/programming
 

Created a simple query language for JSON data.

Features:

  • Basic query selection
  • Fallback Mechanism
  • Wildcard support
  • Array Slices
  • Multiple Key Selection
  • Key Omission
  • Single Key Omission
  • Functions
  • Comparison Operators
  • Conditions
  • Configurable

Here's an example to get the list of adult friends:

$.friends[?(@.age >= 18)]

Runs in browsers, and Node.js

Documentation site: https://jqlite.vercel.app/

GitHub: https://github.com/Jay-Karia/jqlite

NPM Package: https://www.npmjs.com/package/jqlite-ts

⭐ Leaving a star on GitHub is much appreciated!