Closed pawcoding closed 1 month ago
I've further investigated the issue and created
and updated
have a special behavior for view collections:
Date | undefined
for the fields.updated
(or created
). This will return the other dates as updated
, which is fine, since it's still a date. It can however break the incremental updates, since this functionality relies on the date being the timestamp of the last change to the entry, so I advice you to not do that.updated
, the column will simply be ignored in the collection. On one hand this is strange, since it's not how a vanilla SQL database behaves. On the other hand this is prefect for our use case, since we can guaranty that the type will always be Date
(or undefined
).
Requirements
Currently the loader assumes that the base fields of PocketBase are always present. However this is not the case for
view
collections. View collections only have:id
(always required)collectionId
(id of the view)collectionName
(name of the view)The other two base fields
created
andupdated
are not necessarily present. So in case of aview
these fields are optional and the loader cannot rely on them for build caching, sorting and in the type generation.