CheckSchema() public méthode

This method checks whether the database uses latest schema and if it doesn't it will automatically initiate schema upgrade.
public CheckSchema ( SQLiteConnection connection ) : void
connection System.Data.SQLite.SQLiteConnection Connection to the SQLite database
Résultat void
        protected SQLiteConnection GetConnection()
        {
            try
            {
                var dir = Path.GetDirectoryName(Configuration.LibraryConfiguration.Instance.StoragePath);

                if (String.IsNullOrEmpty(dir))
                {
                    throw new InvalidOperationException("Invalid path to the database.");
                }

                if (!Directory.Exists(dir))
                {
                    Directory.CreateDirectory(dir);
                }

                var connection = new SQLiteConnection(ConnectionString);
                connection.Open();

                _schemaManager.CheckSchema(connection);

                return(connection);
            }
            catch (Exception ex)
            {
                _log.Error("Unable to establish proper connection to database.", ex);

                throw new StorageException("Unable to establish proper connection to database.", ex);
            }
        }