/// <summary> /// Checks if the <see cref="CurrentDatabase"/> exists. /// </summary> /// <param name="cancellationToken">a cancelation token (if any)</param> /// <returns>True if the database exists.</returns> public override async Task <bool> DatabaseExistsAsync(CancellationToken cancellationToken) { if (CurrentDatabase.IsNullOrWhitespace()) { throw new InvalidOperationException(Properties.Resources.CurrentDatabaseNullException); } using (var conn = await OpenConnectionAsync(true).ConfigureAwait(false)) { var table = await ExecuteCommandIntAsync <LightDataTable>(conn, string.Format("SHOW DATABASES LIKE '{0}';", CurrentDatabase.Trim()), null, cancellationToken).ConfigureAwait(false); return(table.Rows.Count > 0); } }