<?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 Ash Tewari</title><link>https://www.tewari.info/category/database/</link><description>Recent content in Database on Ash Tewari</description><generator>Hugo -- gohugo.io</generator><language>en-US</language><lastBuildDate>Mon, 28 Sep 2009 07:13:02 +0000</lastBuildDate><atom:link href="https://www.tewari.info/category/database/feed.xml" rel="self" type="application/rss+xml"/><item><title>Using DbUpdater with MySql</title><link>https://www.tewari.info/2009/09/28/using-dbupdater-with-mysql/</link><pubDate>Mon, 28 Sep 2009 07:13:02 +0000</pubDate><guid>https://www.tewari.info/2009/09/28/using-dbupdater-with-mysql/</guid><description>&lt;p&gt;&lt;a class="link" href="https://www.tewari.info/dbupdater/" title="DbUpdater Page"&#10; &gt;DbUpdater&lt;/a&gt; can be used with &lt;a class="link" href="http://www.mysql.com/" title="mysql.com"&#10; target="_blank" rel="noopener"&#10; &gt;mysql&lt;/a&gt;.&lt;/p&gt;&#10;&lt;p&gt;Here are the files you need to jumpstart the integration - &lt;a class="link" href="https://www.tewari.info/downloads/DbUpdater-MySql.zip" title="DbUpdater-MySql.zip"&#10; &gt;DbUpdater-MySql.zip&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;1. You might need to change the path to mysql.exe in mysql-exec.bat.&lt;/p&gt;&#10;&lt;p&gt;2. Modify values in mysql-sample-command-line.bat.&lt;/p&gt;&#10;&lt;p&gt;Make sure mysql.data.dll is placed in GAC or in the same directory as DbUpdater.exe. Connector binaries can be downloaded from here -&#10;&lt;a class="link" href="http://dev.mysql.com/downloads/connector/net/6.1.html" title="MySql .NET Connector Download"&#10; target="_blank" rel="noopener"&#10; &gt;http://dev.mysql.com/downloads/connector/net/6.1.html&lt;/a&gt;&lt;/p&gt;&#10;</description></item><item><title>Using NHibernate With SQLite in DbUpdater</title><link>https://www.tewari.info/2008/09/09/using-nhibernate-with-sqlite-in-dbupdater/</link><pubDate>Wed, 10 Sep 2008 04:46:39 +0000</pubDate><guid>https://www.tewari.info/2008/09/09/using-nhibernate-with-sqlite-in-dbupdater/</guid><description>&lt;p&gt;&lt;a class="link" href="https://www.tewari.info/dbupdater/" &gt;DbUpdater&lt;/a&gt; (&lt;a class="link" href="http://sourceforge.net/projects/dbupdater/" target="_blank" rel="noopener"&#10; &gt;version 1.3&lt;/a&gt; onwards) can be used with &lt;a class="link" href="http://www.sqlite.org/" target="_blank" rel="noopener"&#10; &gt;sqlite3&lt;/a&gt;.&lt;/p&gt;&#10;&lt;p&gt;Review the files included in &lt;a class="link" href="https://www.tewari.info/downloads/DbUpdater-sqlite3.zip" &gt;DbUpdater-sqlite3.zip&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;1. DbUpdater.exe.config must be modified. Note changes to the following keys - exe-file, exe-args, dialect, driver_class, connetion_string.&#10;2. SchemaVersion.hbm.xml must be modified. The &amp;lsquo;class&amp;rsquo; attributes value for the &amp;lsquo;generator&amp;rsquo; of &amp;lsquo;id&amp;rsquo; must be changed to &amp;lsquo;identity&amp;rsquo;. No other changes are needed here.&#10;3. \SqlScripts\schema-version-table.sql is modified. Note that the datatypes of all columns are changed to TEXT, except for SchemaChangeId, which is changed to integer primary key. integer primary key is used for auto-incremented columns in sqlite.&#10;4. \SqlScripts\baseline.sql is modified. Note the use of current_timestamp function. The actual sql syntax in this file must conform to sqlite dialect.&#10;5. All other .sql scripts in \SqlScripts directory are also modified to conform to sqlite dialect.&lt;/p&gt;&#10;&lt;p&gt;The following files are expected to be in DbUpdater.exe directory (as configured in the DbUpdater.exe.config file) -&lt;/p&gt;&#10;&lt;p&gt;1. sqlite3.exe : &lt;a class="link" href="http://www.sqlite.org/download.html" target="_blank" rel="noopener"&#10; &gt;download&lt;/a&gt;.&#10;2. System.Data.SQLite.dll : &lt;a class="link" href="http://sqlite.phxsoftware.com/" target="_blank" rel="noopener"&#10; &gt;download&lt;/a&gt;.&#10;3. createdb.bat file : This file is included. This batch script will call sqlite3.exe to execute sql queries.&lt;/p&gt;&#10;&lt;p&gt;Another very useful tool for working with sqlite database files is &lt;a class="link" href="http://sqlitebrowser.sourceforge.net/" target="_blank" rel="noopener"&#10; &gt;SQLite Database Browzer&lt;/a&gt;. &lt;a class="link" href="https://www.tewari.info/wp-content/sqlite-support.html" title="sqlite-support.html"&#10; &gt;sqlite-support.html&lt;/a&gt;&lt;/p&gt;&#10;</description></item><item><title>DbUpdater on SourceForge</title><link>https://www.tewari.info/2008/07/27/dbupdater-on-sourceforge/</link><pubDate>Sun, 27 Jul 2008 07:36:35 +0000</pubDate><guid>https://www.tewari.info/2008/07/27/dbupdater-on-sourceforge/</guid><description>&lt;p&gt;By popular demand, &lt;a class="link" href="https://www.tewari.info/dbupdater/" title="DbUpdater : Database Schema Version Control"&#10; &gt;DbUpdater&lt;/a&gt; is now up on the &lt;a class="link" href="https://sourceforge.net/projects/dbupdater" title="DbUpdater-on-SourceForge"&#10; target="_blank" rel="noopener"&#10; &gt;sourceforge&lt;/a&gt;. Latest download (v1.2) is now available from &lt;a class="link" href="https://sourceforge.net/project/showfiles.php?group_id=232631" title="DbUpdater-Download"&#10; target="_blank" rel="noopener"&#10; &gt;there&lt;/a&gt;.&lt;/p&gt;&#10;</description></item><item><title>WPF - LINQ to SQL Sample</title><link>https://www.tewari.info/2008/03/07/wpf-linq-to-sql-sample/</link><pubDate>Fri, 07 Mar 2008 07:15:35 +0000</pubDate><guid>https://www.tewari.info/2008/03/07/wpf-linq-to-sql-sample/</guid><description>&lt;p&gt;This exercise in binding a WPF ListView control with LINQ to SQL was a lot of fun ! The following image shows data from &lt;a class="link" href="http://www.codeplex.com/MSFTDBProdSamples" title="MSSQL Sample Databases"&#10; target="_blank" rel="noopener"&#10; &gt;AdventureWorks&lt;/a&gt; sample database displayed in the ListView control. The end result is very admirable, even in this very basic demo. Feeling a complete sense of freedom is unavoidable when working with WPF.&lt;/p&gt;&#10;&lt;p&gt;&lt;img alt="Linq2SqlSample1.Png" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://www.tewari.info/images/Linq2SqlSample1.Png"&gt;&lt;/p&gt;&#10;&lt;p&gt;This sample demonstrates :&lt;/p&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;LINQ to SQL mapping.&lt;/li&gt;&#10;&lt;li&gt;WPF ListView Control DataBinding.&lt;/li&gt;&#10;&lt;li&gt;Displaying images stored in database as varbinary in WPF control.&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;p&gt;The sample code can be downloaded here : &lt;a class="link" href="https://www.tewari.info/downloads/Linq2SqlSample.zip" title="Linq2SqlSample.zip"&#10; &gt;WPF-LINQ to SQL Sample&lt;/a&gt;&#10;License : &lt;a class="link" href="http://creativecommons.org/licenses/by-nc-sa/3.0/us/" target="_blank" rel="noopener"&#10; &gt;Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.&lt;/a&gt; &lt;a class="link" href="http://creativecommons.org/licenses/by-nc-sa/3.0/us/" target="_blank" rel="noopener"&#10; &gt;&lt;img alt="Creative Commons License" class="gallery-image" data-flex-basis="681px" data-flex-grow="283" height="31" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="http://i.creativecommons.org/l/by-nc-sa/3.0/us/88x31.png" width="88"&gt;&lt;/a&gt;&lt;/p&gt;&#10;</description></item><item><title>Database Schema Version Control Tool</title><link>https://www.tewari.info/2008/02/18/dbupdater-database-schema-version-control/</link><pubDate>Tue, 19 Feb 2008 03:05:52 +0000</pubDate><guid>https://www.tewari.info/2008/02/18/dbupdater-database-schema-version-control/</guid><description>&lt;p&gt;It is essential to treat database schema as source code and apply all the norms and best practices applicable to it. From what I hear and read, database schema version control is non-existent in too many projects.&lt;/p&gt;&#10;&lt;p&gt;Various techniques to accomplish version control of database schemas have been discussed and published. Martin Fowler and Pramod Sadagale has written a comprehensive article on &lt;a class="link" href="http://martinfowler.com/articles/evodb.html" target="_blank" rel="noopener"&#10; &gt;Evolutionary Database Design&lt;/a&gt;. It is a must-read for everyone involved with database development.&lt;/p&gt;&#10;&lt;p&gt;K. Scott Allen writes in detail about an excellent system here - &lt;a class="link" href="http://odetocode.com/Blogs/scott/archive/2008/02/02/11721.aspx" title="Versioning Databases - Change Scripts"&#10; target="_blank" rel="noopener"&#10; &gt;Versioning Databases - Change Scripts&lt;/a&gt;. This approach is sufficiently light-weight (for my taste) and provides complete control over the whole process.&lt;/p&gt;&#10;&lt;p&gt;I am providing a free tool here that you can use to implement this system. It will even create the SchemaVersionsLog table for your database, if it doesn&amp;rsquo;t exist. If you are using this tool with MSSQL Server, you can get started with very little effort. If you are using a different DBMS, you can still use this tool. It uses NHibernate to access the SchemaVersionsLog table. So, any DBMS supported by NHibernate is acceptable, as long as it comes with a command line tool to execute the sql scripts.&lt;/p&gt;&#10;&lt;p&gt;Download &lt;a class="link" href="https://www.tewari.info/dbupdater/" title="DbUpdater : Database Schema Version Control"&#10; &gt;DbUpdater here&lt;/a&gt;.&lt;/p&gt;&#10;</description></item></channel></rss>