-
Notifications
You must be signed in to change notification settings - Fork 306
Add lsn and op_position to typescript client, and fix type in api docs
#3734
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -43,7 +43,19 @@ export type NormalizedPgSnapshot = { | |||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| interface Header { | ||||||||||||||
| [key: Exclude<string, `operation` | `control` | `event`>]: Value | ||||||||||||||
| [ | ||||||||||||||
| key: Exclude< | ||||||||||||||
| string, | ||||||||||||||
| | `operation` | ||||||||||||||
| | `control` | ||||||||||||||
| | `event` | ||||||||||||||
| | `txids` | ||||||||||||||
| | `lsn` | ||||||||||||||
| | `op_position` | ||||||||||||||
| | `tags` | ||||||||||||||
| | `removed_tags` | ||||||||||||||
| > | ||||||||||||||
| ]: Value | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| export type Operation = `insert` | `update` | `delete` | ||||||||||||||
|
|
@@ -125,6 +137,8 @@ export type ChangeMessage<T extends Row<unknown> = Row> = { | |||||||||||||
| headers: Header & { | ||||||||||||||
| operation: Operation | ||||||||||||||
| txids?: number[] | ||||||||||||||
| lsn?: `${bigint}` | ||||||||||||||
| op_position?: number | ||||||||||||||
|
Comment on lines
139
to
+141
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Verify ✅ Suggested change if 64‑bit values are possible- op_position?: number
+ op_position?: `${bigint}`📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is a number in the api Does seem a bit strange to me how sometimes we have number and sometimes string There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
You're right that the mix is a bit unusual— The types look good as-is! 👍 🧠 Learnings used |
||||||||||||||
| /** Tags will always be present for changes if the shape has a subquery in its where clause, and are omitted otherwise.*/ | ||||||||||||||
| tags?: MoveTag[] | ||||||||||||||
| removed_tags?: MoveTag[] | ||||||||||||||
|
|
||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Went with
bigintgiven this is used forxip_listin thePostgresSnapshotBut then
txidsabove is a number so not sure which is better 🤷