{"by":"Puchaczov","descendants":15,"id":42453650,"kids":[42457675,42458745,42457765,42458972,42468548,42456612],"score":56,"text":"Hey, For those of you who don&#x27;t know my little tool Musoq, I wanted to introduce it as a small tool that allows you to query with SQL-like syntax without any database.<p>It allows you to query various things from niche ones like CAN DBC files, weird ones like C# code, interesting ones with Git querying to regular stuff like CSV, TSV and various others.<p>I am quite a bit experimenting with various things so I&#x27;m hybridizing the engine with LLMs or doing other weird stuff that are more or less practical :-)<p>I wanted also to share some recent developments in this little project as I hope it might be interesting to some of you.<p>New Experimental Plugins:\n* <i>Git Plugin (Beta)</i>: I&#x27;ve been working on Git repository querying - managed to test it on the EF Core repo (16k commits) and it seems to work okay\n* <i>Roslyn Plugin (Beta)</i>: Added basic C# code analysis capabilities<p>For the very first time:\nI&#x27;ve extended CROSS APPLY to use computed results as arguments! Now the operator can use values from the current row as inputs. Here&#x27;s an example:<p><pre><code>  SELECT\n    f.DirectoryName,\n    f.FileName\n  FROM #os.directories(&#x27;&#x2F;some&#x2F;path&#x27;, false) d\n  CROSS APPLY #os.files(d.FullName, true) f\n  WHERE d.Name IN (&#x27;Folder1&#x27;, &#x27;Folder2&#x27;)\n</code></pre>\nAfter another pack of fixes I&#x27;m finally able to query multiple git repositories AT ONCE!<p><pre><code>  with ProjectsToAnalyze as (\n    select\n        dir2.FullName as FullName\n    from #os.directories(&#x27;D:\\repos&#x27;, false) dir1\n    cross apply #os.directories(dir1.FullName, false) dir2\n    where\n        dir2.Name = &#x27;.git&#x27;\n  )\n  select\n    c.Message,\n    c.Author,\n    c.CommittedWhen\n  from ProjectsToAnalyze p cross apply #git.repository(p.FullName) r \n  cross apply r.Commits c\n  where c.AuthorEmail = &#x27;my-email@email.ok&#x27;\n  order by c.CommittedWhen desc\n</code></pre>\nUnder the Hood:\n- Added a <i>Buckets</i> feature for memory management (currently just testing it with the Roslyn plugin)<p>- Moved to <i>.NET 8</i><p>- Added <i>CROSS&#x2F;OUTER APPLY</i> operators<p>- Made some improvements to error messages and runtime behavior<p>New piping features:\nI&#x27;ve been experimenting with piping capabilities:\n* <i>Image Analysis with LLMs</i>:<p><pre><code>  .&#x2F;Musoq.exe image encode &quot;image.jpg&quot; | .&#x2F;Musoq.exe run query &quot;select s.Shop, s.ProductName, s.Price from ...&quot;\n</code></pre>\n* <i>Text Data Extraction</i>:<p><pre><code>  Get-Content &quot;ticket.txt&quot; | .&#x2F;Musoq.exe run query &quot;select t.TicketNumber, t.CustomerName ... from #stdin.text(&#x27;Ollama&#x27;, &#x27;llama3.1&#x27;) t&quot;\n</code></pre>\n* <i>Data Source Combination</i>:<p><pre><code>  { docker image ls; .&#x2F;Musoq.exe separator; docker container ls } | .&#x2F;Musoq.exe run query &quot;...&quot;\n</code></pre>\nI&#x27;m working on comprehensive documentation:\nI encourage you especially to look at section &quot;Practical Examples and Applications&quot; and &quot;Data Sources&quot; where you can look at all the tables the tool currently provides. &lt;<a href=\"https:&#x2F;&#x2F;puchaczov.github.io&#x2F;Musoq&#x2F;\" rel=\"nofollow\">https:&#x2F;&#x2F;puchaczov.github.io&#x2F;Musoq&#x2F;</a>&gt;<p>Other Changes:<p>- Made some improvements to OS and Archive data sources (OS can now query metadata like EXIF)<p>- Added a few fields to CAN DBC plugin<p>- Command outputs can now be used as inputs for queries<p>I&#x27;m hoping to:<p>- Improve stability and add more tests<p>- Flesh out the documentation<p>- Work on package distribution (Scoop, Ubuntu packages)<p>- Share some examples of source code querying with Roslyn<p>Ideas for later:<p>- WHERE robust analysis and optimizations<p>- DISTINCT operator implementation<p>- PROTOBUF schema support<p>- Performance improvements<p>- Query parallelization<p>- Recursive CTEs<p>- Subqueries<p>I&#x27;d really appreciate any thoughts or feedback!<p>The documentation section where I write a short analysis of EF Core with git plugin: &lt;<a href=\"https:&#x2F;&#x2F;puchaczov.github.io&#x2F;Musoq&#x2F;practical-examples-and-applications&#x2F;analysis-of-the-efcore-repository.html\" rel=\"nofollow\">https:&#x2F;&#x2F;puchaczov.github.io&#x2F;Musoq&#x2F;practical-examples-and-app...</a>&gt;","time":1734548576,"title":"Show HN: Musoq – Query Anything with SQL Syntax (Git, C#, CSV, Can DBC)","type":"story","url":"https://github.com/Puchaczov/Musoq"}