ncruces / go-sqlite3

Go bindings to SQLite using wazero
https://pkg.go.dev/github.com/ncruces/go-sqlite3
MIT License
402 stars 12 forks source link

Add and expand the JSON examples #127

Closed daenney closed 1 month ago

daenney commented 1 month ago

I've been toying a bit with the new JSONB format and was struggling a bit to find some complete working examples. So in this PR:

ncruces commented 1 month ago

This is probably a good idea. I actually tried to convince the SQLite folks to add something similar to their docs: https://sqlite.org/forum/forumpost/d0cec8d2b722af67

I'm not sure if dropping the "pure" JSON examples is a good idea, or if we should have both…

daenney commented 1 month ago

Then again, maybe twice the examples is just noise.

Mmm yeah, I was wondering about that. My thinking was mostly that JSONB should probably be what people (want to) use going forwards and it took me a second to realise I had to wrap them in jsonb() on insertion. It's a small difference but I thought as an example that might be nice to have.

What do you think about the comments though? On both examples, if you agree.

Sounds good, I'll make the changes.