<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Database on Lloyd Rochester's Geek Blog</title><link>https://lloydroc.github.io/categories/database/</link><description>Recent content in Database 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/categories/database/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>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>