Skip to content

Comments

[TS] Fix useTable casing issues#3853

Merged
coolreader18 merged 2 commits intomasterfrom
noa/fix-ts-case-issues
Dec 17, 2025
Merged

[TS] Fix useTable casing issues#3853
coolreader18 merged 2 commits intomasterfrom
noa/fix-ts-case-issues

Conversation

@coolreader18
Copy link
Collaborator

@coolreader18 coolreader18 commented Dec 8, 2025

Description of Changes

Fixes #3807. Not sure what the best way to model this in the API is (another argument to t.row()?), but it does work.

Expected complexity level and risk

1

Testing

@coolreader18 coolreader18 force-pushed the noa/fix-ts-case-issues branch 2 times, most recently from e790ba4 to cefb6ee Compare December 8, 2025 23:58
@cloutiertyler
Copy link
Contributor

@coolreader18 I think this is the way we should model it:

export default new __t.row(
  {
    id: __t.u32().primaryKey(),
    userId: __t.identity("user_id"),
    name: __t.string(),
    get location() {
      return Point;
    },
  },
);

or

export default new __t.row(
  {
    id: __t.u32().primaryKey(),
    userId: __t.identity.name("user_id"),
    name: __t.string(),
    get location() {
      return Point;
    },
  },
);

perhaps. That is similar to what DrizzleORM does: https://orm.drizzle.team/docs/sql-schema-declaration#shape-your-data-schema.

If you think you can swing that quickly, I'd like to make that change. I'd rather do something like that because it will be how we will implement a more general "column alias" feature, but if we need to rush this we could do what you're doing.

I'm a little hesitant to expose RowBuilder though since we're not even sure that that should exist, to your point.

@coolreader18
Copy link
Collaborator Author

Having it just on ColumnBuilder for now is reasonable, I guess. The issue is that we'd also want to support having alternate names for product type fields as well.

@coolreader18 coolreader18 force-pushed the noa/fix-ts-case-issues branch 4 times, most recently from 97371c4 to 689f0d7 Compare December 11, 2025 18:45
@coolreader18 coolreader18 force-pushed the noa/fix-ts-case-issues branch from 689f0d7 to 9b043d1 Compare December 11, 2025 21:09
@cloutiertyler
Copy link
Contributor

Having it just on ColumnBuilder for now is reasonable, I guess. The issue is that we'd also want to support having alternate names for product type fields as well.

Agreed, although we're moving in that direction and I think this would be easy enough to extend to that as well.

@coolreader18
Copy link
Collaborator Author

Mmm, I don't know if easy is the right word - it would involve making a new category of TypeBuilders (like, NamedU8Builder etc) that can be used as product fields but not in an array or option

@bfops bfops added release-any To be landed in any release window bugfix Fixes something that was expected to work differently labels Dec 15, 2025
Copy link
Contributor

@cloutiertyler cloutiertyler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This now LGTM!

@coolreader18 coolreader18 added this pull request to the merge queue Dec 16, 2025
Merged via the queue into master with commit 4d23fe3 Dec 17, 2025
29 checks passed
@coolreader18 coolreader18 deleted the noa/fix-ts-case-issues branch December 17, 2025 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Fixes something that was expected to work differently release-any To be landed in any release window

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Casing issue in where clause for useTable

3 participants