<?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 Lloyd Rochester's Geek Blog</title><link>https://lloydroc.github.io/tags/sqlite/</link><description>Recent content in Sqlite on Lloyd Rochester's Geek Blog</description><generator>Hugo</generator><language>en</language><copyright>Copyright © 2025, Lloyd Rochester.</copyright><lastBuildDate>Tue, 09 Jul 2019 06:43:41 +0000</lastBuildDate><atom:link href="https://lloydroc.github.io/tags/sqlite/index.xml" rel="self" type="application/rss+xml"/><item><title>SQLite Transactions Part 1</title><link>https://lloydroc.github.io/post/c/sqlite-transactions-part-1/</link><pubDate>Tue, 09 Jul 2019 06:43:41 +0000</pubDate><guid>https://lloydroc.github.io/post/c/sqlite-transactions-part-1/</guid><description>&lt;p>In the world of software these days it is expected that applications do multiple things at once. With that said it&amp;rsquo;s pretty typical that multiple processes or threads have read and write access to a database. In this post we will go over transactions in SQLite which prohibits changes made to the database unless they are inside a transaction.&lt;/p>
&lt;h2 id="defining-a-database-transaction">Defining a Database Transaction&lt;/h2>
&lt;p>Let&amp;rsquo;s first define a database transaction which is essentially to carry out or conduct to a conclusion. In the context of a database a transaction is a grouping of SQL commands. We can consider this transaction to be atomic in the sense that all the commands will execute successfully or it will fail.&lt;/p></description></item><item><title>Adding SQLite to a C Project</title><link>https://lloydroc.github.io/post/c/add-sqlite-project/</link><pubDate>Sat, 06 Jul 2019 10:43:41 +0000</pubDate><guid>https://lloydroc.github.io/post/c/add-sqlite-project/</guid><description>&lt;h1 id="hahahugoshortcode13s0hbhb">Adding SQLite to a C Project&lt;/h1>
&lt;p>Let&amp;rsquo;s add SQLite to your C project. It&amp;rsquo;s easy and straightforward. We&amp;rsquo;ll use the SQLite.org recommended way by adding the so-called &amp;ldquo;amalgamation&amp;rdquo; to our C project and compile from source. In the words of &lt;a href="https://sqlite.org/howtocompile.html">SQLite.org&lt;/a> &amp;ldquo;the use of the amalgamation is recommended for all applications.&amp;rdquo; In this blog post we&amp;rsquo;ll download, compile and use SQLite in our C project.&lt;/p>
&lt;h2 id="step-1---download-the-sqlite-amalgamation">Step 1 - Download the SQLite Amalgamation&lt;/h2>
&lt;p>In Step 1 we&amp;rsquo;ll download the amalgamation and look at the contents of the files. This is done by doing to the &lt;a href="https://www.sqlite.org/download.html">SQLite downloads&lt;/a> and downloading the zip file in the &amp;ldquo;C Source Code as an amalgamation&amp;rdquo; section. Let&amp;rsquo;s download the zip file and see what is inside it:&lt;/p></description></item><item><title>Simple SQLite C API Example</title><link>https://lloydroc.github.io/post/c/sqlite-api/</link><pubDate>Sat, 02 Feb 2019 16:45:00 +0000</pubDate><guid>https://lloydroc.github.io/post/c/sqlite-api/</guid><description>&lt;p>When getting started on the SQLite C API they recommend 2 basic ways: &lt;code>sqlite3_exec()&lt;/code> and &lt;code>sqlite3_get_table()&lt;/code> both are convenience wrappers around the core API Calls. They give good examples for the &lt;code>sqlite3_exec()&lt;/code> call, and the &lt;code>sqlite3_get_table()&lt;/code> is deprecated in the documentation. Using &lt;code>sqlite3_exec()&lt;/code> employs a callback function which gives the advantage of speed and low memory usage - due to being able to process each row at a time. It however, does not allow for knowing when all the rows are returned, as well as, being synchronous.&lt;/p></description></item></channel></rss>