baserecord, update, and const improvements #1

Open
opened 2026-03-25 15:10:06 +11:00 by Ghost · 0 comments
Ghost commented 2026-03-25 15:10:06 +11:00 (Migrated from codeberg.org)
  • need to remove create and update from baserecord, inaccurate.
  • if a field is autodate, make readonly.
  • make an 'Upsert' utility like pocketbase-typegen instead of updatepayload for each (it omits baserecord keys and partial the rest for now).
  • instead of having a 'create' payload (handled with upsert for now), we get 'required' in consts, and use it for form validation (also min, max, minselect, maxselect). so we can't send invalid payload to backend.
  • also, remove the 'base' type, and replace with just the one type (which is combined with base record)
  • also for const, remove ?, in fieldschema, replace with omit<,"collectionName"|"collectionId">, replace typed as FieldSchema with satisfies FieldSchema for narrower typing.
  • need to exclude baserecord fields from update payload
- need to remove create and update from baserecord, inaccurate. - if a field is autodate, make readonly. - make an 'Upsert<T>' utility like pocketbase-typegen instead of updatepayload for each (it omits baserecord keys and partial the rest for now). - instead of having a 'create' payload (handled with upsert for now), we get 'required' in consts, and use it for form validation (also min, max, minselect, maxselect). so we can't send invalid payload to backend. - also, remove the 'base' type, and replace with just the one type (which is combined with base record) - also for const, remove ?, in fieldschema, replace with omit<,"collectionName"|"collectionId">, replace typed as FieldSchema with satisfies FieldSchema for narrower typing. - need to exclude baserecord fields from update payload
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
davenh99/pb-typescript#1
No description provided.