Live data from Hacker News

Show HN: NoSQL, but it's SQLite

gist.github.com

21–30 of 48 posts

Re: Show HN: NoSQL, but it's SQLite

#21
post #2

At work, we're using sql server, and i stored all json as base64 string though.

Not sure what your exact use case is, I'm curious actually, but storing JSON strings should work much better. JSON functions are supported since SQL Server 2016 [0]. This is how I do it atm. I store only indexible content in table columns and everything else goes into an `attributes` JSON column. MSSQL supports indexes even on JSON fields, but I have not tried that, yet.

0 - https://learn.microsoft.com/en-us/sql/relational-databases/j...

Re: Show HN: NoSQL, but it's SQLite

#22
post #7

[flagged]

I'd be a little less reflexively hostile if the prompting used to generate it was prominently included, so that it was at least possible to see which properties of the output were deliberately asked for.

When I read a piece of code I don't understand, ideally I'm able to assume that the author intended what was written, and learn something when I figure out why. With AI generated code, I can't do that: the original author is more or less destroyed once the context is gone; at best I can ask someone who was kinda-sorta around when the author wrote it (i.e. the person who prompted it). At worst I'm really just asking someone (or something) else to guess what was intended.

Even granting that the generated code is implementing a coherent design (and that's a big if!), what we're left with is a very quick way to generate legacy code who's author is no longer around to answer questions. Such legacy code, if it's been proven to work, I might just stick a “don't touch this” sign on it, but if it starts causing any problems, I'd end up doing a ground-up rewrite if only to (potentially) understand what problems and concerns influenced the design to make it what it is.

AI can certainly be useful for this later task, but it'd be far preferable to just start there, as a form of pair-programming. And at that point, I doubt it'd be so interesting to say “built with ‹whatever model is popular today›” in the title.

Re: Show HN: NoSQL, but it's SQLite

#24
post #6

Earlier quoted context omitted.

Submitted it to The Daily WTF yet?

Why ??

Others are being mean by not explaining the joke.

Firstly, SQL server has a built-in JSON type, which lets you query and manipulate the JSON directly: https://learn.microsoft.com/en-us/sql/relational-databases/j...

Secondly, JSON is already serialized, so it doesn't make sense to store as a base64 string. You're adding 30% data overhead to transform a string into a string. Base64 is useful for serializing opaque binary formats.

Lastly, some people might be getting a wry smile that you have the power of a relational database but are just trying to store "json" rather than an actual relational model.

Re: Show HN: NoSQL, but it's SQLite

#25
post #22
post #7

[flagged]

I'd be a little less reflexively hostile if the prompting used to generate it was prominently included, so that it was at least possible to see which properties of the output were deliberately asked for. When I read a piece of code I don't understand, ideally I'm able to assume that the author intended what was written, and learn something when I figure out why. With AI generated code, I can't do that: the original a…

[deleted]

Re: Show HN: NoSQL, but it's SQLite

#27
It's stored :memory:, there exists the same interface with:

    let x = {}
    x['foo'] = bar
This is a parody because the implementation is hidden, and I'm not convinced the implementation isn't just newing an object.

Re: Show HN: NoSQL, but it's SQLite

#30
post #19
post #10

Earlier quoted context omitted.

How do you query json with SQL server like let's say you have one data point like this { "id": 42, "quantity": 12, bla bla bla And you want rows where this column has quantity and quantity ≥ 20 How do you do it if you encode everything as base 64?

have col names id, quantity, json and greaterthan20

This is only a joke until a manager hears it. Then it’s part of the Q1 roadmap and we will refactor it in Q3.
Post reply on HN