How to add external data in select
I want to add external data in select, but it only works with sql.
is that way has to do like
9 Replies
Hello, @Suleyman! Could you provide you schemas code and what
this.orgService.nestedUserJobs
is for? As I understand from your code, you want to get jobs by user.organizationId
, so probably you can use joins.Hello @solo , My question is is that way has to define data without sql or schema
like this
You can't do it without sql because it's like you're trying to select a column called true or being true? 🤷♂️
For what seems to be your objective, this is a workaround:
And this will translate into this query:
Which I believe should be valid sql depending on your dialect.
ok, how to solve this problem
full code
Is encode an SQL function?
In that case you need to do:
No, its and just javascript function
In that case, this is how you do it:
Thanks @Angelelz! I worked finally Thanks a lot!
@Angelelz I'm sorry, but i have a question again. sometimes i need to call async function for relations, but sql doesn't support async. is that have solution?
This could be a solution but prepared_by now holds a promise. You'll need to await just that key
Also the type casting should be
as unknown as Promise<string>
I think
I've never tried this, so I don't really know
I'm just guessing