Closed melohagan closed 4 months ago
We actually discovered this only yesterday - we were writing tests that used UUIDs for both the column and the table name, which when combined means that all kinds of weird issues start to occur @adrinr looping in just for awareness.
We would need to make it so that the table name itself isn't directly used, but an alias of some kind, e.g. table TableWithAReallyLongNameThatWouldCauseProblems
would be aliased to just a
, then we could use a lookup map to work out what tables they were supposed to pertain to.
This would help with query length overall, improve readability and logging and overall be quite a nice improvement, as it would mean that the column name could be up to 61 characters long before issues would occur (only adding say a.
- a single alpha-numeric mapping would allow a few hundred tables mapped if we used all the characters in the ASCII range).
Fixed with SQL aliasing.
Checklist
Hosting
Describe the bug This may be related to an identifier limit on Postgres: https://stackoverflow.com/questions/27865770/how-long-can-postgresql-table-names-be
However that may be a coincidence, or be part of a more nuanced issue. (See additional context below)
To Reproduce Steps to reproduce the behavior:
Expected behavior Budibase should work with my existing data model and support the same limits and schema as Postgres and the rest of my tooling does
Additional context
BUDI-7485