public static function fromArray(string $id, string $dsn, array $properties): DatabaseConfiguration
    {
        $self = new self($id, $dsn);
        if (isset($properties['username'])) {
            $self->userName = $properties['username'];
            unset($properties['username']);
        }

        if (isset($properties['password'])) {
            $self->setPassword(Secret::create($properties['password']));
            unset($properties['password']);
        }

        if (isset($properties['initialQuery'])) {
            $self->initialQuery = $properties['initialQuery'];
            unset($properties['initialQuery']);
        }

        if (isset($properties['details'])) {
            $self->details = $properties['details'];
            unset($properties['details']);
        }

        $self->properties = $properties;
        return $self;
    }