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

Compartment indexing and TVP generator codegen #457

Merged
merged 14 commits into from
May 12, 2019

Conversation

johnstairs
Copy link
Member

@johnstairs johnstairs commented May 10, 2019

Description

Builds on #454, adding Compartment indexing and adds some structure around how we generate rows for table-valued parameters. Each TVP has a generator type that is added to the DI container and some codegen that creates a generator that produces a struct with properties for each TVP. Programming model looks like this:

private readonly V1.UpsertResourceTvpGenerator<ResourceWrapper> _upsertResourceTvpGenerator;

// ...

V1.UpsertResource.PopulateCommand(
    command,
    resourceTypeId: _model.GetResourceTypeId(resource.ResourceTypeName),
    resourceId: resource.ResourceId,
    eTag: weakETag == null ? null : (int?)etag,
    allowCreate: allowCreate,
    isDeleted: resource.IsDeleted,
    updatedDateTime: resource.LastModified,
    keepHistory: keepHistory,
    requestMethod: resource.Request.Method,
    rawResource: stream,
    tableValuedParameters: _upsertResourceTvpGenerator.Generate(resource));

Related issues

Part of AB#69044

@johnstairs johnstairs changed the base branch from personal/johnstairs/sql-indexing to master May 10, 2019 23:19
@johnstairs johnstairs merged commit 8583c70 into master May 12, 2019
@johnstairs johnstairs deleted the personal/johnstairs/compartment-index branch May 15, 2019 02:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants