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

expose codecs for custom datatypes #1004

Open
juliusmarminge opened this issue May 6, 2024 · 1 comment
Open

expose codecs for custom datatypes #1004

juliusmarminge opened this issue May 6, 2024 · 1 comment

Comments

@juliusmarminge
Copy link

Describe the proposed feature

Drizzle has a killer feature with customTypes that allows you to use arbitrary datatypes: https://orm.drizzle.team/docs/custom-types. Here's an example of a date column that transforms a mysql date type that's used as a Temporal.PlainDate in JS land:

const temporalDateColumn = customType<{
  data: Temporal.PlainDate;
  driverData: string;
}>({
  dataType: () => "date",
  fromDriver: (value) => Temporal.PlainDate.from(value),
  toDriver: (value) => value.toString(),
});

It would be nice to expose a similar feature in edgedb-js. Brief discussion on Discord: https://discord.com/channels/841451783728529451/1236652945429233664/1236829507911024750

@emrosenf
Copy link

emrosenf commented May 6, 2024

This would be useful for encrypting/decrypting data that is encrypted at rest

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