Re: how to write this recursive query in Sequel

2018-10-12 Thread genc
Thank you so much, Jeremy. Have a great weekend!, Gencer. On Thursday, October 11, 2018 at 9:31:06 PM UTC+3, genc wrote: > > Hi, > > I'm sorry my previous email was mistakenly wrong. This is the correct one. > I mixed up the queries. > > > with recursive pattern(pattern) as ( > select

Re: how to write this recursive query in Sequel

2018-10-11 Thread Jeremy Evans
On Thursday, October 11, 2018 at 1:12:25 PM UTC-7, genc wrote: > > Hi Jeremy, > > Thank you for the help. I really appreciated it. > > Is it possible to return this query as a model? How can I reflect this to > a model? So it doesn't return just as hash. > At the top, change: DB[:full_paths]

Re: how to write this recursive query in Sequel

2018-10-11 Thread genc
Hi Jeremy, Thank you for the help. I really appreciated it. Is it possible to return this query as a model? How can I reflect this to a model? So it doesn't return just as hash. P.S.: Yes, only a single item will return in my query. Thanks, Gencer. On Thursday, October 11, 2018 at 9:31:06

Re: how to write this recursive query in Sequel

2018-10-11 Thread genc
Hi Jeremy, Thank you so much!!! However, Unfortunately given example produces an error and says: > ERROR: column pattern.base_folder_id does not exist LINE 1: ...n" INNER JOIN "full_paths" AS "y" ON (("y"."id" = "pattern"

Re: how to write this recursive query in Sequel

2018-10-11 Thread Jeremy Evans
On Thursday, October 11, 2018 at 11:31:06 AM UTC-7, genc wrote: > > Hi, > > I'm sorry my previous email was mistakenly wrong. This is the correct one. > I mixed up the queries. > > > with recursive pattern(pattern) as ( > select string_to_array('folder_2/SUB iso', '/') -- input > ), > full_paths