Skip to content

ui: Allow createPerfettoTable() to take a list of rows as records#6261

Open
stevegolton wants to merge 1 commit into
mainfrom
dev/sg/rowsToSelectStatement
Open

ui: Allow createPerfettoTable() to take a list of rows as records#6261
stevegolton wants to merge 1 commit into
mainfrom
dev/sg/rowsToSelectStatement

Conversation

@stevegolton

@stevegolton stevegolton commented Jun 16, 2026

Copy link
Copy Markdown
Member

Allow the as param in createPerfettoTable() to be an array of records in order to pre-populate the table with a type-safe list of types.

I.e.

as: string | readonly Record<string, SqlValue>[];

So we can use the function like this to initialise a table without having to hand craft the SQL.

await createPerfettoTable({
  engine,
  name: 'myTable',
  as: [
    {id: 1, ts: 100n, dur: 10, name: 'foo'},
    {id: 2, ts: 200n, dur: 50, name: 'bar'},
    {id: 3, ts: 300n, dur: 5, name: 'foo'},
  ],
});

This is simply a convenience feature to make it easier to create pre-filled tables, mainly for testing.

@stevegolton stevegolton requested a review from LalitMaganti June 16, 2026 10:55
@stevegolton stevegolton requested a review from a team as a code owner June 16, 2026 10:55
@stevegolton stevegolton marked this pull request as draft June 16, 2026 10:56
@github-actions

github-actions Bot commented Jun 16, 2026

Copy link
Copy Markdown

@stevegolton stevegolton force-pushed the dev/sg/rowsToSelectStatement branch from e0b9087 to 5008b63 Compare June 16, 2026 11:18
@stevegolton stevegolton marked this pull request as ready for review June 16, 2026 11:18
@stevegolton stevegolton changed the title ui: Allow createPerfettoTable() to take a list of records as well as just strings ui: Allow createPerfettoTable() to take a list of records Jun 16, 2026
@stevegolton stevegolton changed the title ui: Allow createPerfettoTable() to take a list of records ui: Allow createPerfettoTable() to take a list of rows as records Jun 16, 2026
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.

1 participant