When inserting new rows into tables with PK integer columns, it defaults to 0/"numeric" for the column in the editor UI. To me it seems to make the most sense to use the "default" value on PK columns when inserting new records. Currently the "default" is only used when a default is set in the schema, but a PK should typically use the auto value for new records.
Implementation: in useEditorStore, the insert section could probably just add something like:
dataTypes: tableInfo.map(({ type, notnull, dflt_value, pk }): EditorDataType => {
if (pk) {
return "default"
}
...
}
When inserting new rows into tables with PK integer columns, it defaults to
0/"numeric" for the column in the editor UI. To me it seems to make the most sense to use the "default" value on PK columns when inserting new records. Currently the "default" is only used when a default is set in the schema, but a PK should typically use the auto value for new records.Implementation: in
useEditorStore, the insert section could probably just add something like: