3 ms·
Only if what you specifically want is to represent queries. If what you want to represent is roughly static data then SQL is an incredibly awkward language to u
by danpalmer 2y ago
Only if what you specifically want is to represent queries. If what you want to represent is roughly static data then SQL is an incredibly awkward language to use.
- bob1029 2y agoThis is valid SQL: SELECT 'Constant'
- danpalmer 2y agoSure, but try creating a list of maps with string keys and values that can be ints, strings, lists, or maps, or protos for that matter. I've recently been writing quite a lot of unit tests for SQL, and the biggest pain point is setting up the state of your data, because SQL is just not an ergonomic language in which to do that. Mostly I've just ended up writing YAML describing the rows I want in a database (and I use proto fields in DBs so some nesting there), and using a utility that converts that can load that YAML as a table.