akashpal-21 / org-roam-utilities

Some utilities to use alongside org-roam
GNU General Public License v3.0
1 stars 1 forks source link

join #3

Closed dmgerman closed 2 months ago

dmgerman commented 2 months ago

YOu can write this query:

 "select %s
          from nodes_view inner join files on nodes_view.file = files.file
           %s
           %s;"
         column-names

as

 "select %s
          from nodes_view join files using (file)
           %s
           %s;"
         column-names

I find this much more readable. but it is your choice.

akashpal-21 commented 2 months ago

It is indeed better to read - but I think is not it always better to specify the join type explicitly?

join is inner join unless any other adjective is provided. But it is always better to explicitly state the join type I think.

But your suggestion would in fact increase code readability -

One thing I have learn't is to never assume the environment - always force the environment to be what I intend it to be, this is a way I have found to reduce bugs in code overall.

I think users can change this to be more concise - there is no difference in execution plan either ways.