-
Notifications
You must be signed in to change notification settings - Fork 73
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
More information in /schema
about column types.
#385
Comments
@divyenduz The enum specific issue has been fixed by #443 |
for the first item in the list, which is:
Looks like we already have a I thought maybe this was requested before we had One other thing: In case we still want to add constraints at column level, should we remove it from table level? |
I think keeping Looking at the 'other considerations' section, it seems as though we don't currently report the array dimensions as part of the schema: {
"name": "01_create_table",
"operations": [
{
"create_table": {
"name": "items",
"columns": [
{
"name": "id",
"type": "serial",
"pk": true
},
{
"name": "names",
"type": "text[3]",
}
]
}
}
]
} resulting schema
Postgres doesn't enforce array sizes but I think we should not lose that information, so perhaps we could do that next. |
I have pushed changes to add check constraints on column level: #584 |
To better support enums in the frontend, we need some more information in the
/schema
API, here is an example, this column (Field.usage
) is an enum but we have no way of telling it from, say, a custom domain type or custom types from extensions. Eventually, we want to make all types editable from the UI. So, we need the/schema
API to return that this is an enum and its possible values for enum's case. This will allow us to build features like dropdown select for enum and/or client side validation for enum value.Current output:
Potential future output
Other considerations (very hand-wavey)
{"checkConstraint": {"length(xata_id) < 256"}}
. The frontend can then potentially parse this into a TypeScript validation rule.pgroll
should be the source of truth for this information.postgresType
can be 'enum' | 'array' | 'range' | 'composite' | 'domain' | 'custom-type'For the purpose of this ticket,
enum
is enough.Related #376
The text was updated successfully, but these errors were encountered: