Click here to Skip to main content
15,896,063 members
Articles / Desktop Programming / Windows Forms

SQLite Compare Utility

Rate me:
Please Sign up or sign in to vote.
4.89/5 (68 votes)
21 Feb 2015LGPL35 min read 285.4K   37.2K   131  
Utility for comparing two SQLite database files for both structure and data
using System;
using System.Collections.Generic;
using System.Text;

namespace SQLiteParser
{
    public class SQLiteDdlMain
    {
        public static SQLiteDdlStatement GetStatement()
        {
            if (CreateTable != null)
                return _createTable;
            if (CreateIndex != null)
                return _createIndex;
            if (CreateView != null)
                return _createView;
            if (CreateTrigger != null)
                return _createTrigger;
            throw new ApplicationException("no sql statement was found");
        }

        public static SQLiteCreateTableStatement CreateTable
        {
            get { return _createTable; }
            set
            {
                _createTable = value;
                _createView = null;
                _createTrigger = null;
                _createIndex = null;
            }
        }

        public static SQLiteCreateIndexStatement CreateIndex
        {
            get { return _createIndex; }
            set
            {
                _createIndex = value;
                _createView = null;
                _createTrigger = null; 
                _createTable = null;
            }
        }

        public static SQLiteCreateViewStatement CreateView
        {
            get { return _createView; }
            set
            {
                _createView = value;
                _createTable = null;
                _createTrigger = null; 
                _createIndex = null;
            }
        }

        public static SQLiteCreateTriggerStatement CreateTrigger
        {
            get { return _createTrigger; }
            set
            {
                _createTrigger = value;
                _createTable = null;
                _createIndex = null; 
                _createView = null;
            }
        }

        private static SQLiteCreateIndexStatement _createIndex;
        private static SQLiteCreateTableStatement _createTable;
        private static SQLiteCreateTriggerStatement _createTrigger;
        private static SQLiteCreateViewStatement _createView;
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The GNU Lesser General Public License (LGPLv3)


Written By
Software Developer
Israel Israel
My name is Liron Levi and I'm developing software for fun & profit for 15 years already.

Comments and Discussions