pootler
2020-1-22 09:46:26

@pootler has joined the channel


chris613
2020-1-22 15:28:30

so i just changed (limit num) to (limit ,num) and things went from not working, to working, but ive no idea why ….


chris613
2020-1-22 15:30:15

it unquotes ?


mark.warren
2020-1-22 15:30:23

Yep


chris613
2020-1-22 15:30:38

(define (random-recipe num) (in-entities conn (~> (from recipe #:as u) (order-by ([(random)])) (limit ,num))))


chris613
2020-1-22 15:30:54

but i hadnt quoted anything ???


mark.warren
2020-1-22 15:31:04

Mysterious


chris613
2020-1-22 15:31:08

ohhhh


chris613
2020-1-22 15:31:15

->is a seperate thread .


chris613
2020-1-22 15:31:39

is it something to do with realising the value of the variable before throwing the code to another thread maybe ?


mark.warren
2020-1-22 15:32:19

Sorry you’ve reached the limit of my knowledge. :grin:


soegaard2
2020-1-22 15:36:11

@chris613 Since limit is a macro it can use , as it wants:


chris613
2020-1-22 15:36:32

yeah i was just comming to that conclusion/guess


chris613
2020-1-22 15:37:00

and the section of deta docs that explains it :slightly_smiling_face:


chris613
2020-1-22 15:37:10

Any time the query combinators encounter an unquote, that value gets replaced with a placeholder node in the query AST and, when the query is eventually executed, the value is bound to its prepared statement. This makes it safe and easy to parameterize your queries without having to worry about SQL injection attacks.


chris613
2020-1-22 15:37:19

for anyone else’s future refernece :slightly_smiling_face:


shawsumma060
2020-1-22 17:17:30

@shawsumma060 has joined the channel