Skip to content

No id returned on Insert #1

@jamespsterling

Description

@jamespsterling

Using the MSSQL driver, when inserting only the following is returned,

{"resource":[[]]}

Looks like the code here is not meeting the conditions to use the $builder->insertGetId(...) Laravel method in the vendor/dreamfactory/df-sqldb/src/Resources/Table.php file.

if (empty($id) && (1 === count($this->tableIdsInfo)) && $this->tableIdsInfo[0]->autoIncrement) {
    $idName = $this->tableIdsInfo[0]->name;
    $id[$idName] = $builder->insertGetId($parsed, $idName);
    $record[$idName] = $id[$idName];
} else {
    if (!$builder->insert($parsed)) {
        throw new InternalServerErrorException("Record insert failed.");
    }
}

Using dreamfactory version 2.1.2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions