Relation not working?

Hi the relations are on the screen the query output is
sql
SELECT
app.id,
app.name,
app.description,
app.created_at,
app.updated_at,
app.url,
app.creator_id,
app_creator.data AS creator
FROM
app
LEFT JOIN LATERAL (
SELECT
JSON_ARRAY(
user.id,
user.email,
user.role,
user.hashed_password,
user.firstname,
user.lastname,
user.created_at,
user.updated_at
) AS data
FROM
user
WHERE
user.id = app.creator_id
LIMIT 1
) app_creator ON true;
sql
SELECT
app.id,
app.name,
app.description,
app.created_at,
app.updated_at,
app.url,
app.creator_id,
app_creator.data AS creator
FROM
app
LEFT JOIN LATERAL (
SELECT
JSON_ARRAY(
user.id,
user.email,
user.role,
user.hashed_password,
user.firstname,
user.lastname,
user.created_at,
user.updated_at
) AS data
FROM
user
WHERE
user.id = app.creator_id
LIMIT 1
) app_creator ON true;
const result = await db.query.appSchema.findMany({ with: { creator: true } }).toSQL() this is how i query
No description
3 Replies
πŸ‡¨πŸ‡­ Marko Bolliger <cannap>
error: ' { "name": "Error", "message": "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '(select json_array(appSchema_creator.id, appSchema_creator.email, `ap...' at line 1" } ok i i think i know it on server it works but not with xampp damn why i think xampp foir quick and dirty setup is a good idea..
Angelelz
Angelelzβ€’4mo ago
I don’t think MariaDB is supported yet, there are subtle syntax differences with MySQL
πŸ‡¨πŸ‡­ Marko Bolliger <cannap>
they do but i had old version but i go now with 1:1 i have on server
Want results from more Discord servers?
Add your server