<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Sqlite on traviscj/blog</title>
    <link>https://traviscj.com/blog/tags/sqlite/</link>
    <description>Recent content in Sqlite on traviscj/blog</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Fri, 12 Jan 2018 08:43:17 +0000</lastBuildDate>
    <atom:link href="https://traviscj.com/blog/tags/sqlite/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>osquery</title>
      <link>https://traviscj.com/blog/post/2018-01-12-osquery/</link>
      <pubDate>Fri, 12 Jan 2018 08:43:17 +0000</pubDate>
      <guid>https://traviscj.com/blog/post/2018-01-12-osquery/</guid>
      <description>&lt;p&gt;I&amp;rsquo;ve known about [osquery][] for a while, but recently spent some time digging around in it.&#xA;[osquery]: &lt;a href=&#34;https://osquery.io&#34;&gt;https://osquery.io&lt;/a&gt;&#xA;The basic idea is to provide a consistent SQL interface to a bunch of system data, instead of learning idiosyncrasies of individual commands (which themselves vary across operating systems).&#xA;My hacker buddy Sharvil has worked on osquery a fair bit and explained to me a couple years ago that it actually uses [sqlite][]&amp;rsquo;s [virtual table functionality][vtab] to provide the interface &amp;ndash; it&amp;rsquo;s a fascinating and brilliant project!&#xA;[sqlite]: &lt;a href=&#34;https://sqlite.org/&#34;&gt;https://sqlite.org/&lt;/a&gt;&#xA;[vtab]: &lt;a href=&#34;https://sqlite.org/vtab.html&#34;&gt;https://sqlite.org/vtab.html&lt;/a&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>relational java explorations with sqlite3 vtab</title>
      <link>https://traviscj.com/blog/post/2017-05-05-relational-java-explorations-with-sqlite3-vtab/</link>
      <pubDate>Fri, 05 May 2017 20:10:28 +0000</pubDate>
      <guid>https://traviscj.com/blog/post/2017-05-05-relational-java-explorations-with-sqlite3-vtab/</guid>
      <description>&lt;p&gt;One idea i have been mulling over lately is exposing a java codebase relationally, with queries like:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-sql&#34; data-lang=&#34;sql&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;SELECT&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;*&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;FROM&lt;/span&gt; classes &lt;span style=&#34;color:#66d9ef&#34;&gt;c&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;JOIN&lt;/span&gt; annotations a&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#66d9ef&#34;&gt;ON&lt;/span&gt; a.class_id &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;c&lt;/span&gt;.id&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;WHERE&lt;/span&gt; a.name &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;MyAnnotationClass&amp;#39;&lt;/span&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;p&gt;The idea here is that you could search a codebase by pretending that you had tables for a whole bunch of things like:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;classes&lt;/li&gt;&#xA;&lt;li&gt;annotations&lt;/li&gt;&#xA;&lt;li&gt;variables&lt;/li&gt;&#xA;&lt;li&gt;literals&lt;/li&gt;&#xA;&lt;li&gt;methods&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;This would be a useful thing because instead of relying on an IDE like IntelliJ to do &amp;ldquo;find usages&amp;rdquo; operations, you could actually script those interactions.&#xA;Admittedly, of course, Java has some pretty sophisticated reflection APIs to find this sort of stuff too, but it seems like exploring the structure could be much easier writing Java code to traverse those trees.&lt;/p&gt;</description>
    </item>
    <item>
      <title>.sqliterc</title>
      <link>https://traviscj.com/blog/post/2017-03-31-sqliterc/</link>
      <pubDate>Fri, 31 Mar 2017 00:00:00 +0000</pubDate>
      <guid>https://traviscj.com/blog/post/2017-03-31-sqliterc/</guid>
      <description>&lt;p&gt;I came across &lt;a href=&#34;https://blog.chmouel.com/2009/07/16/better-output-from-sqlite3-command-line/&#34;&gt;Better output from sqlite3 command line&lt;/a&gt;.&#xA;His &lt;code&gt;.sqliterc&lt;/code&gt; file did not work for me, but the simpler&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;.mode &amp;quot;column&amp;quot;&#xA;.headers on&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;did work nicely.&lt;/p&gt;&#xA;&lt;p&gt;I also found out that &lt;code&gt;brew install sqlite3&lt;/code&gt; does not install the &lt;code&gt;sqlite3&lt;/code&gt; binary to &lt;code&gt;$PATH&lt;/code&gt;, which stinks.&lt;/p&gt;&#xA;&lt;p&gt;The &lt;code&gt;sqlite3&lt;/code&gt; environment is still much less pleasant than the &lt;code&gt;mysql&lt;/code&gt; cli.&#xA;A few things on my wishlist:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;tab completion of tables, fields, keywords, and functions.&lt;/li&gt;&#xA;&lt;li&gt;nicer &lt;code&gt;.schema&lt;/code&gt; output &amp;ndash; I&amp;rsquo;ve just gotten really used to reading them in mysql output&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;It sounds like maybe &lt;a href=&#34;https://github.com/rogerbinns/apsw&#34;&gt;apsw&lt;/a&gt; can be something useful?&#xA;Or maybe Navicat? (but that&amp;rsquo;s expensive)&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
