typeid-sql
typeid-sql copied to clipboard
Supabase db diff fails
When adding the equality operator in a supabase migration:
CREATE OR REPLACE FUNCTION compare_type_id_equality(lhs_id typeid, rhs_id VARCHAR)
RETURNS BOOLEAN AS $$
SELECT lhs_id = typeid_parse(rhs_id);
$$ LANGUAGE SQL IMMUTABLE;
Applying migration as db reset is successful. However, all subsequent supabase db diff fails with the following error:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 1770, in _execute_context
self.dialect.do_execute(
File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/default.py", line 717, in do_execute
cursor.execute(statement, parameters)
psycopg2.errors.UndefinedFunction: operator is only a shell: character varying = typeid
LINE 188: case when p.data_type = 'USER-DEFINED' then
^
Should we compare the uuid part and the prefix part separately as strings?
Also running into this. Any updates/workarounds?
Sorry, I haven't had the time to look into this, but will take a look towards the end of this week.
PR out: https://github.com/jetpack-io/opensource/pull/203
Thank you so much! Works for me now at least 👍