using System;
namespace Umbraco.Core.Persistence
{
///
/// Creates and manages the "ambient" database.
///
public interface IUmbracoDatabaseFactory : IDisposable
{
///
/// Creates a new database.
///
///
/// The new database must be disposed after being used.
/// Creating a database causes the factory to initialize if it is not already initialized.
///
IUmbracoDatabase CreateDatabase();
///
/// Gets a value indicating whether the database factory is configured, i.e. whether
/// its connection string and provider name have been set. The factory may however not
/// be initialized (see ).
///
bool Configured { get; }
///
/// Gets a value indicating whether the database factory is initialized, i.e. whether
/// its internal state is ready and it has been possible to connect to the database.
///
bool Initialized { get; }
///
/// Gets the connection string.
///
/// May return null if the database factory is not configured.
string ConnectionString { get; }
///
/// Gets a value indicating whether the database factory is configured (see ),
/// and it is possible to connect to the database. The factory may however not be initialized (see
/// ).
///
bool CanConnect { get; }
///
/// Configures the database factory.
///
void Configure(string connectionString, string providerName);
///
/// Gets the Sql context.
///
///
/// Getting the Sql context causes the factory to initialize if it is not already initialized.
///
ISqlContext SqlContext { get; }
///
/// Configures the database factory for upgrades.
///
void ConfigureForUpgrade();
}
}