protected function fetchSchema() {
        $columns = $this->getDb()->fetchColumnDefs($this->name);
        if ($columns === null) {
            throw new \InvalidArgumentException("Cannot fetch schema foor {$this->name}.");
        }

        $schema = [
            'type' => 'object',
            'dbtype' => 'table',
            'properties' => $columns
        ];

        $required = $this->requiredFields($columns);
        if (!empty($required)) {
            $schema['required'] = $required;
        }

        return new Schema($schema);
    }