Skip to content
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

Custom naming strategy #975

Open
hnordt opened this issue Apr 23, 2024 · 4 comments
Open

Custom naming strategy #975

hnordt opened this issue Apr 23, 2024 · 4 comments

Comments

@hnordt
Copy link

hnordt commented Apr 23, 2024

The whole JS ecosystem has the camel case convention for property names.

It would be nice if this JS client supports the same naming strategy feature from the DotNet client https://docs.edgedb.com/libraries/dotnet/customtypes#using-a-naming-strategy, so the property names in query results could be camel case enforced.

@CarsonF
Copy link
Collaborator

CarsonF commented Apr 23, 2024

Why not name your schema in camel case? that's what I do.

@hnordt
Copy link
Author

hnordt commented Apr 23, 2024

Why not name your schema in camel case? that's what I do.

It feels a bit inconsistent, because both the SDL and EdgeQL use snake case for everything.

@CarsonF
Copy link
Collaborator

CarsonF commented Apr 23, 2024

IMO that's the lesser evil, than trying to have naming translation for a specific client.
In practice we have very little snake case; pretty much just the builtin functions.

@hnordt
Copy link
Author

hnordt commented Apr 23, 2024

I agree that a naming translation is bad, but it would be nice if we can do like Drizzle where you can "alias" the property name:

{ myAge: integer('my_age') }

The SDL could support something like:

type Movie {
  required title: str;
  release_year as releaseYear: int64;
}

That way I can follow the naming conventions of EdgeQL and match the naming conventions of TypeScript.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants