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

Support Raw Default Strings #27

Open
jpulec opened this issue Jan 26, 2021 · 1 comment
Open

Support Raw Default Strings #27

jpulec opened this issue Jan 26, 2021 · 1 comment

Comments

@jpulec
Copy link
Contributor

jpulec commented Jan 26, 2021

I've run into a couple scenarios where allowing the use of a raw string to be used as a default would be useful. For example to call an unsupported function, like generate_uuid_v4() or to specify a default for a specific type, i.e. '{}'::jsonb as a default for a JSONB column.

Would it make sense to support passing a 'raw' string that wouldn't be escaped when generating the default expression?

@David-Wobrock
Copy link
Contributor

Hi @jpulec,
Interesting suggestion, I like it. It would definitely be useful to have this kind of support somehow.

For the '{}'::jsonb case, a cool solution would be to introspect the models, and determine how to interpret AddDefaultValue.value depending on the Field class that is used for the targeted field :)

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