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

Add all XataFile attributes to summarize response #1520

Open
mkurczewski opened this issue Jun 30, 2024 · 0 comments
Open

Add all XataFile attributes to summarize response #1520

mkurczewski opened this issue Jun 30, 2024 · 0 comments

Comments

@mkurczewski
Copy link

mkurczewski commented Jun 30, 2024

Is your feature request related to a problem? Please describe.

When calling summarize on a given table (e.g. table) and there is a nested (linked) record (e.g. nested) containing XataFile column type (e.g. image), only basic metadata of it are returned.

const xata = getXataClient()

// Example request
const values = await xata.db.table.summarize({
    filter: {
		nested: {
			id: { $any:  ["rec_abc", "rec_def", "rec_ghi"] },
		}
    },
    columns: ["nested"],
    summaries: {
		recordsCount: { count: "*" },
    },
})

// Example response
{
"summaries": [
	{
		"recordsCount": 3,
		"nested": {
			"id": "rec_abc",
			"image": {
				"name": "image.png",
				"mediaType": "image/jpeg",
				"enablePublicUrl": true,
				"signedUrlTimeout": 600,
				"uploadUrlTimeout": 86400,
				"size": 171092,
				"version": 3,
				"attributes": {
					"height": 800,
					"width": 1200
				}
			},
			"xata": {
				// ...
			}
		}
	}
]
}

Describe the solution you'd like

I'd like to see the rest of fields from XataFile column type, like: url, base64Content etc.

Describe alternatives you've considered

The only alternative I can think of is to add another call like

await xata.db.table.filter(...).select(["image"]).getAll()

and then map the response result with the summarize response.

Additional context

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant