atviriduomenys / spinta

Spinta is a framework to describe, extract and publish data (a DEP Framework).
MIT License
10 stars 4 forks source link

Error in composite ref with literal in prepare #670

Open sirex opened 8 months ago

sirex commented 8 months ago
d | r | b | m | property | type    | ref                       | source       | prepare
example                  |         |                           |              |
  |   |   | Translation  |         | id                        | translations |
  |   |   |   | id       | integer |                           | id           |
  |   |   |   | lang     | string  |                           | lang         |
  |   |   |   | name     | string  |                           | name         |
  |   |   |   | city_id  | integer |                           | city_id      |
  |   |   |   |          |         |                           |              |
  |   |   | City         |         | id                        | cities       |
  |   |   |   | id       | integer |                           | id           |
  |   |   |   | en       | ref     | Translation[city_id,lang] |              | id, "en"
  |   |   |   | name_en  | string  |                           |              | en.name
  |   |   |   | lt       | ref     | Translation[city_id,lang] |              | id, "lt"
  |   |   |   | name_lt  | string  |                           |              | lt.name

This should generate following query:

SELECT
  cities.id
  translations.name
FROM cities
LEFT JOIN translations ON (
  translations.city_id = cities.id AND
  translations.lang = "en"
)

Related