aquametalabs / aquameta

Web development platform built entirely in PostgreSQL
GNU General Public License v3.0
1.1k stars 52 forks source link

flat: bug with related_rows over meta identifiers #277

Closed erichanson closed 1 year ago

erichanson commented 1 year ago

This widgt code:

schema.related_rows('id','meta.table','schema_id').then(function(tables) {
    widget.sync(tables, w, function(table) {
        return widget('db_table', {
            table: table
        });
    });
})

generates this request:

/endpoint/0.3/relation/meta/table?meta_data=true&where=%7B%22name%22%3A%22schema_id%22%2C%22op%22%3A%22%3D%22%2C%22value%22%3A%7B%22name%22%3A%22meta%22%7D%7D

which blows up with this response:

{ "status_code": 500, "title": "Server Error", "message": {"state" : "42725", "message" : "operator is not unique: schema_id = unknown", "detail" : "", "context" : "PL/pgSQL function rows_select(relation_id,json) line 47 at EXECUTE\nSQL statement \"select 200, 'OK'::text, (select endpoint.rows_select(relation_id, query_args))::text, 'application/json'::text\"\nPL/pgSQL function endpoint.request(text,text,text,json,json) line 110 at RETURN QUERY", "sqlerr" : "operator is not unique: schema_id = unknown", "sqlstate" : "42725"}}
erichanson commented 1 year ago

Dropped jsonb addition in 0.4, which was causing chaos. Rewrite endpoint instead.