public override async Task <SandboxStatus> GetSandboxStatusAsync(string clientKey) { using (var conn = CreateConnection()) { var results = await conn.QueryAsync <SandboxStatus>( $"SELECT datname as Name, 0 as Code, 'ONLINE' Description FROM pg_database WHERE datname = \'{_databaseNameBuilder.SandboxNameForKey(clientKey)}\';", commandTimeout : CommandTimeout) .ConfigureAwait(false); return(results.SingleOrDefault() ?? SandboxStatus.ErrorStatus()); } }
public override async Task <SandboxStatus> GetSandboxStatusAsync(string clientKey) { using (var conn = CreateConnection()) { var results = await conn.QueryAsync <SandboxStatus>( $"SELECT name as Name, state as Code, state_desc as Description FROM sys.databases WHERE name = @DbName;", new { DbName = _databaseNameBuilder.SandboxNameForKey(clientKey) }, commandTimeout : CommandTimeout) .ConfigureAwait(false); return(results.SingleOrDefault() ?? SandboxStatus.ErrorStatus()); } }