nalgeon / sqlean

The ultimate set of SQLite extensions
MIT License
3.67k stars 117 forks source link

Please add JSON1 extension #8

Closed djrobby closed 3 years ago

djrobby commented 3 years ago

Kindly requesting as it does come in handy when developing PoCs with Grafana or many other technologies. Thank you in advance!

warmwaffles commented 3 years ago

The json1 extension comes with the amalgamation file already.

warmwaffles commented 3 years ago

When compiling with make or what ever your choice is pass -DSQLITE_ENABLE_JSON1=1

djrobby commented 3 years ago

I was under the impression that since your version was already a precompiled binary, folks wouldn't have to go thru with compiling from the source with various combinations of flags. I personally have not had much luck in successfully compiling their latest stable version locally. I’ve also looked over their docs multiple times only to give up in frustration and go with sudo apt install (which from what I can tell) does not come with JSON1 support.

nalgeon commented 3 years ago

Robby, Mathew @warmwaffles is not the maintainer, so don't blame him, blame me ツ Just as a clarification: how do you use SQLite binary? Are you using some language-specific wrapper, calling it from C or using a shell?

warmwaffles commented 3 years ago

@djrobby alsa check the pragma compile options because it comes standard with ubuntu 16.04 https://stackoverflow.com/questions/49043084/sqlite-on-ubuntu-16-04-with-json1

PRAGMA compile_options;

@nalgeon I don't know how feasible it is to actually pull that part of sqlite3 out and compile it as a standalone module.

djrobby commented 3 years ago

Thanks guys, sorry for the trouble. @nalgeon I was not trying to put the blame on anyone. It was merely a request based on my personal experience trying to compile SQLite locally. For now, I’ll explore other viable options and close this issue. Thanks again!

nalgeon commented 3 years ago

No problem at all! I'm not against adding JSON1 extension, I just don't understand your use case. Will be glad to help if you answer my previous questions.

djrobby commented 3 years ago

Hi @nalgeon, for my specific use case, I've created a small API endpoint using Crystal lang's sqlite3 lib @ https://github.com/crystal-lang/crystal-sqlite3 that accepts data from various servers broadcasting app specific metrics via https://github.com/timberio/vector. As of right now, the volume is approx. 250k records/day and I was looking to convert the data stream over JSON to be able to store into SQLite. Our specific workflow with SQLite is essentially: ingest, summarize, export, compress and backup on daily basis. We start every day with a fresh SQLite db named yyyy_mm_dd_svr_xxx.db. I hope this helps answer your question.

nalgeon commented 3 years ago

Thanks! I'll see what I can do.

nalgeon commented 3 years ago

Here you go: json1

djrobby commented 3 years ago

Amazing! Thank you so much @nalgeon :pray: