Why there is readonly modifier on Table.table? #358
Closed
IlyaSemenov
started this conversation in
General
Replies: 1 comment 1 reply
-
|
Ah, I didn't know about Removing db.someTable.select('awawa.column')Of course, I wish |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The documentation says: "Note that the table property is marked as readonly, this is needed for TypeScript to check the usage of the table in queries."
Is this still relevant? Which code triggers errors without
readonly? I just tried to replace allreadonly tablewithtableon a smaller sized project (5 cross-related tables, but with deeply nested queries), and there were no typecheck errors on Typescript 5.2.2 / orchid-orm 1.18.0.Besides, in the latest Nuxt 3.12 / Typescript 5.5.4 / orchid-orm 1.34.5 project, I'm seeing this when running
nuxt typecheck(but no errors in the IDE for some reason):I had to add
override readonly table = "user"to fix that, but now I'm not sure ifreadonlyis actually needed?Beta Was this translation helpful? Give feedback.
All reactions