Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scaffolding: computed column does not include HasComputedColumnSql. #9

Open
olavloite opened this issue Jan 29, 2021 · 0 comments
Open
Labels
known limitation type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@olavloite
Copy link
Collaborator

The current scaffolding generator ensures that a valid DbContext that can be used is generated. If we also include the computed SQL in the meta model, EF Core will not respect the ValueGeneratedOnAddOrUpdate part of the meta model, and will try to insert values into the computed column. Cloud Spanner does not allow that.

Query:
FullName STRING(400) NOT NULL AS (COALESCE(FirstName || ' ', '') || LastName) STORED,

Actual:

entity.Property(e => e.FullName)
    .IsRequired()
    .HasMaxLength(400)
    .ValueGeneratedOnAddOrUpdate();

Excepted:

entity.Property(e => e.FullName)
    .IsRequired()
    .HasMaxLength(400)
    .ValueGeneratedOnAddOrUpdate()
    .HasComputedColumnSql("(COALESCE(FirstName || ' ', '') || LastName) STORED");
@yoshi-automation yoshi-automation added 🚨 This issue needs some love. triage me I really want to be triaged. labels Nov 3, 2021
@olavloite olavloite added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. and removed 🚨 This issue needs some love. triage me I really want to be triaged. labels Nov 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
known limitation type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

2 participants