Skip to content

Ash.bulk_create/4 returns empty list records when using integer primary keys #637

@nallwhy

Description

@nallwhy

Code of Conduct

  • I agree to follow this project's Code of Conduct

AI Policy

  • I agree to follow this project's AI Policy, or I agree that AI was not used while creating this issue.

Versions

elixir 1.18.3
erlang 27.3
ash 3.6.2
ash_postgres 2.6.22

Operating system

mac

Current Behavior

Starting from ash_postgres 2.6.22, calling Ash.bulk_create/4 returns empty list records even when the insert actually succeeds in the database.

This regression seems related to the following commit:
af0903f

From the code changes, it appears that the new identity-based result matching logic introduced in this commit fails when the primary key is integer-based (auto-increment), since the key is not present in the input changesets.

Reproduction

No response

Expected Behavior

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions