Skip to content

Add a native way to mark columns as read-only. #1405

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

Open
igalklebanov opened this issue Mar 29, 2025 · 0 comments
Open

Add a native way to mark columns as read-only. #1405

igalklebanov opened this issue Mar 29, 2025 · 0 comments
Labels
enhancement New feature or request typescript Related to Typescript

Comments

@igalklebanov
Copy link
Member

igalklebanov commented Mar 29, 2025

Hey 👋

Proposal:

Similar to the proposal @ #1404, we could also use Readonly<T> to represent the equivalent of ColumnType<T, never, never> for column types, but in a TypeScript-native way that's much more readable and concise. Some tools and people use GeneratedAlways<T> as a shorthand for this use case, but it's semantically wrong.

Readonly<T> requires using primitive type constructors, e.g. String instead of string.

It supports nullable:

nullable: Readonly<String | null>
//  ^?  Readonly<String> | null

Cons:

Forcing usage of constructor types for primitives.
It's niche, and there's already a way to achieve the same thing.

@igalklebanov igalklebanov added enhancement New feature or request typescript Related to Typescript labels Mar 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request typescript Related to Typescript
Projects
None yet
Development

No branches or pull requests

2 participants
@igalklebanov and others