Skip to content

spanner: support embedded structs #692

@ghost

Description

Hello.

With the spanner package, it is currently impossible to write and retrieve structs that embedded other structs.

For example:

type (
    RecordData struct{
        ID string
        CreatedAt, UpdatedAt time.Time
    }
    User struct{
        RecordData
        FirstName, LastName, Email string
     }
)

Whenever attempting to use the toStruct method of spanner.Row, the spanner package is unable to locate fields from an embedded struct.

The go driver for Mongo DB, here, implemented this feature really well. Can something similar be developed for the spanner package?

Metadata

Metadata

Assignees

Labels

api: spannerIssues related to the Spanner API.help wantedWe'd love to have community involvement on this issue.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions