feat(schema_cache): column type + query#163
feat(schema_cache): column type + query#163psteinroe merged 6 commits intosupabase-community:mainfrom
column type + query#163Conversation
column type + query
| unnest (ix.indkey) as attnum, | ||
| ix.indisprimary as is_primary, |
There was a problem hiding this comment.
Note that if we're using compound indexes, e.g. (user_id, tax_number), we'd have is_primary == true for tax_number.
This might be problematic for index suggestions etc. – wdyt?
psteinroe
left a comment
There was a problem hiding this comment.
I appreciate the effort to write a custom query, but what didn't you like from this one? :D
https://github.com/supabase/postgres-meta/blob/master/src/lib/sql/columns.sql
|
@psteinroe Ah, I wasn't aware of the We can use the But it does lack some info that seemed to me like we might need it in the future:
Of course I'm not sure whether we'll need that data and whether the query fetches it 100% correctly. :) Would you like me to use my query, the untouched |
|
let's use yours and we keep it in mind when issues come up that it might be worth to go to postgrest-meta for it |
Introduces an all-new, immediately-usable, delivered-straight-to-your-door data type in the
SchemaCache: theColumn.The next step is to use that data type in the
pg_completionscrate – so we can suggest columns in a select clause, based on the queried table.I wrote the query myself, with a little bit of help from ChatGPT and the postgres docs, so please make sure it follows best practices. 🙌🏻
Also wrote and renamed a test, and added full features for tokio on workspace level.