Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
peterohler
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
9 ms
·
31.
▲
by
peterohler
5y ago
A mongo database can have multiple collection or tables. Data from multiple tables can be joined together and then just what the user asks for is returned. We also include fields that calculate values based on data from the database. The ca
32.
▲
by
peterohler
5y ago
It's worked out great for us. We use it as a flexible way to get exactly what is needed in a single request that ends up pulling data from a mongo database. It has not added any extra complexity. On the contrary it has simplified out b
33.
▲
by
peterohler
5y ago
Just tried [OjG]( https://github.com/ohler55/ojg ) and saw anywhere from zero to 20% faster on the various benchmarks. Nice improvement overall. Hats off to the golang maintainers.
34.
▲
by
peterohler
5y ago
It actually started with XML. At the time there were not any decent options so I wrote my own and then made it a C extension. JSON can next since XML worked out so well. Basically JSON parsers were slow and I thought I could do better. It s
35.
▲
Oj (Ruby) Just Got Faster
(github.com)
5 points
by
peterohler
5y ago
|
2 comments
36.
▲
by
peterohler
5y ago
The good old days. I remember getting one fo the first color machines and writing and dynamic orbital evaluator. What a great development environment.
37.
▲
by
peterohler
5y ago
One of the more discouraging aspects of being an OSS developer is that successful companies that use your software never consider contributing to the OSS developers. I suppose that is the nature of business though. Take what you can get.
38.
▲
by
peterohler
6y ago
Oj supports a config file as well. .oj-config.sen. -help-config will describe it in more detail.
39.
▲
by
peterohler
6y ago
Works fine. Give it a try.
40.
▲
by
peterohler
6y ago
All good. You were polite and friendly or at least I read it that way.
41.
▲
by
peterohler
6y ago
The title was meant to be fun. JSON format is a pretty light topic.
42.
▲
by
peterohler
6y ago
I think you will find the JSON object members are not ordered while JSON array members are ordered. Since the JSON object members are not ordered, changing the order for display purposes does not change the data in any material way.
43.
▲
by
peterohler
6y ago
Another post said something similar. An issue was added to add the feature. I think it is a good one to add.
44.
▲
by
peterohler
6y ago
I suppose that is possible to remove the colons but it is nice having the extra reminder that the left side of the colon is a key and the right a value. That could easily become lost if a new line is inserted after the key. SEN is new. Afte
45.
▲
by
peterohler
6y ago
Quite a variety of meanings. Some pretty funny.
46.
▲
by
peterohler
6y ago
Oj is actually pretty well known as a Ruby JSON parser. The OjG project is in the same family.
47.
▲
by
peterohler
6y ago
Pretty JSON is still just JSON. It should work with any JSON parser. Of course if it is being fed from one system to another there is no need to make the JSON anything other than compact one line JSON. Pretty is for human consumption.
48.
▲
by
peterohler
6y ago
I keep the `-p` (pretty) option as a single option. Not a convention at all. I toyed with 80x3 and 80:3 but ended up with 80.3. You are right though, it probably make sense to support two options as well to avoid the unusual convention. May
49.
▲
by
peterohler
6y ago
An issue has been added to the repo. It is on the list now. Great idea, thanks. https://github.com/ohler55/ojg/issues/35
50.
▲
by
peterohler
6y ago
SEN still uses quotes when necessary. For any sting that starts with a number, the sting is quoted. Note in the example the hex colors are in quotes since the `#` character is not valid unquoted token character.
51.
▲
by
peterohler
6y ago
jq is a nice tool. oj is similar in many ways but different in others. jq has it's own proprietary query language while oj uses JSON path. The output options are also different with some overlap. Maybe jq will get a pretty output optio
52.
▲
by
peterohler
6y ago
There are a lot of people who store JSON in NoSQL databases. After fetching a JSON records you generally view the JSON or you do as a developer. That is where the tool is handy as you get get something like a FHIR record on a single page in
53.
▲
by
peterohler
6y ago
Can you explain what you mean by "like named"? The sorting helps a lot but I'm always interested in additional features.
54.
▲
by
peterohler
6y ago
It is a stable sort since for almost every parser out there there can be no duplicate keys. It would be dangerous for an JSON parser to assume JSON object keys are in some specific order. It is certainly not something that can be counted on
55.
▲
by
peterohler
6y ago
Now that would be cool! :-)
56.
▲
by
peterohler
6y ago
Interesting idea. Solves the issue of trying to find data in JSON fairly well. I'm a bit biased but I like using the oj with a JSONPath extraction (-x option) to do something similar but with the power of JSONPath.
57.
▲
by
peterohler
6y ago
For even more flexibility in JSON format there is SEN. https://news.ycombinator.com/item?id=26237048 talks about making JSON look good and introduces SEN at the end with optional commas and quotes. It also allows comments a
58.
▲
The Pretty JSON Revolution
(ohler.com)
169 points
by
peterohler
6y ago
|
156 comments
59.
▲
by
peterohler
6y ago
GTT has been a very helpful in setting up repeatable regression tests with CI.
60.
▲
Building Solid Go GraphQL Applications Quickly
(github.com)
3 points
by
peterohler
6y ago
|
1 comments
More ›