internal static void CreateTables(SQLiteConnection connection) { VariablesTable.CreateTable(connection); TypeModel.CreateTable(connection); CollectionsTable.CreateTable(connection); }
internal IsabelDb(SQLiteConnection connection, string fileName, IEnumerable <Type> supportedTypes, bool disposeConnection, bool isReadOnly) { _connection = connection; _fileName = fileName; _disposeConnection = disposeConnection; _variables = new VariablesTable(connection); _collections = new CollectionsTable(connection, supportedTypes.ToList(), isReadOnly); }
internal static void EnsureTableSchema(SQLiteConnection connection) { if (!VariablesTable.DoesTableExist(connection)) { throw new IncompatibleDatabaseSchemaException(string.Format("The database is missing the '{0}' table. It may have been created with an early vesion of IsabelDb or it may not even be an IsabelDb file. Are you sure the path is correct?", VariablesTable.TableName)); } if (!TypeModel.DoesTypeTableExist(connection)) { throw new IncompatibleDatabaseSchemaException(string.Format("The database is missing the '{0}' table. The table may have been deleted or this may not even be an IsabelDb file. Are you sure the path is correct?", TypeModel.TypeTableName)); } if (!CollectionsTable.DoesTableExist(connection)) { throw new IncompatibleDatabaseSchemaException(string.Format("The database is missing the '{0}' table. The table may have been deleted or this may not even be an IsabelDb file. Are you sure the path is correct?", CollectionsTable.TableName)); } }