On Feb 21, 2020, at 5:20 AM, Wout Mertens <wout.mert...@gmail.com> wrote:
> 
> In JavaScript, objects are key-value collections with unique keys, where
> the order of the keys is important.

ECMAScript §13.7.5.15 (2019 edition) says, "The mechanics and order of 
enumerating the properties is not specified but must conform to the rules 
specified below.”

You can read the rules if you like, but it doesn’t say that every JavaScript 
give the same ordering:

    
https://www.ecma-international.org/ecma-262/10.0/index.html#sec-enumerate-object-properties

The JSON spec then says, “The JSON syntax...does not assign any significance to 
the ordering of name/value pairs."

    http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf

> Most JSVMs

I’m going to take a wild guess that “Most” here means “a whole bunch of 
different browsers and server-side JS stacks all using V8.”

> Queries can go faster, because a query like `where json_extract(json,
> '$.foo') = 'bar'` can first check the layouts to see which ones apply,

SQLite’s JSON1 extension is a storage and query mechanism, not a run-time 
object system. I se that things like json_remove() exist, but my assumption is 
that 99.manynines% of the time, objects are stored, retrieved, and queried 
without being modified at the SQLite level, if at all.

Therefore, 99.manynines% of the time, there is only one “layout.”

To the extent that that is true, I don’t see how the rest of your proposal 
matters.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to