<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Backups &#8211; Xojo Programming Blog</title>
	<atom:link href="https://blog.xojo.com/tag/backups/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.xojo.com</link>
	<description>Blog about the Xojo programming language and IDE</description>
	<lastBuildDate>Tue, 09 Mar 2021 16:54:18 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>Backwards SQLite Backups</title>
		<link>https://blog.xojo.com/2021/03/09/backwards-sqlite-backups/</link>
		
		<dc:creator><![CDATA[Greg O'Lone]]></dc:creator>
		<pubDate>Tue, 09 Mar 2021 16:54:16 +0000</pubDate>
				<category><![CDATA[Cross-Platform]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Backups]]></category>
		<category><![CDATA[SQLite]]></category>
		<guid isPermaLink="false">https://blog.xojo.com/?p=8121</guid>

					<description><![CDATA[If you use SQLite databases in your apps you may or may not be aware of the Backup method which allows you to quickly and asynchronously create a backup of an existing connected database. This is especially great if you have an in-memory database and you want to store that data on disk for later reference. ]]></description>
										<content:encoded><![CDATA[
<p>If you use SQLite databases in your apps you may or may not be aware of the Backup method which allows you to quickly and asynchronously create a backup of an existing connected database. This is especially great if you have an in-memory database and you want to store that data on disk for later reference. I am using the simpler synchronous calls for this example:</p>



<p><code>memoryDB.Backup(fileDB, Nil, -1)&nbsp;</code></p>



<p>Something that&#8217;s often overlooked is that you can use the Backup method to go the other way&#8230; that is, it can be used to load a disk-based database <em>back into memory</em> by simply swapping the parameters:</p>



<pre class="wp-block-preformatted">// Connect to the database file on disk
Var fileDB as New SQLiteDatabase
fileDB.DatabaseFile = SpecialFolder.Resources.Child("template.db")
fileDB.Connect

// Create the database in memory
Var memoryDB as New SQLiteDatabase
memoryDB.Connect

// "Backup" the file database into memory
fileDB.Backup(memoryDB, Nil, -1)

// Close the file database
fileDB.Close</pre>



<p>And voila! You&#8217;ve restored the database back into memory!</p>



<p>For more information about this command, please see <a rel="noreferrer noopener" href="https://documentation.xojo.com/api/databases/sqlitedatabase.html#sqlitedatabase-backup" target="_blank">SQLiteDatabase.Backup on https://documentation.xojo.com</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
