On Friday, May 24, 2019 at 10:39:48 AM UTC-7, xura wrote:
>
> Hi,
>
> Following is an :gin index for jsonb fields:
>
> CREATE INDEX index_name
> ON public.emails
> USING gin
> (send_cc, send_bcc, send_to, sender);
>
> So, in Sequel docs no :Gin mentioned. Is there a better way to do this
>
Hi,
Following is an :gin index for jsonb fields:
CREATE INDEX index_name
ON public.emails
USING gin
(send_cc, send_bcc, send_to, sender);
So, in Sequel docs no :Gin mentioned. Is there a better way to do this
without writing RAW SQL inside migrations?
--
You received this message
Thanks Jeremy. It works!
On Friday, May 24, 2019 at 5:28:28 PM UTC+3, Jeremy Evans wrote:
>
> On Friday, May 24, 2019 at 6:22:53 AM UTC-7, xura wrote:
>>
>> In fact, query is now like this:
>>
>> SELECT DISTINCT ON (jj->>'email') jj->>'email', jj->>'name' , count(*)
>> over(partition by
OK, thanks.
On Friday, May 24, 2019 at 5:46:30 PM UTC+3, Jeremy Evans wrote:
>
> On Monday, May 20, 2019 at 12:59:52 PM UTC-7, Jeremy Evans wrote:
>>
>> Not a bug in eager_graph, it is just that associations that use CTEs
>> cannot be graphed. We should probably raise an exception if you try to
On Monday, May 20, 2019 at 12:59:52 PM UTC-7, Jeremy Evans wrote:
>
> Not a bug in eager_graph, it is just that associations that use CTEs
> cannot be graphed. We should probably raise an exception if you try to use
> eager_graph, though. I'll try to make that change before the next release.
On Friday, May 24, 2019 at 6:22:53 AM UTC-7, xura wrote:
>
> In fact, query is now like this:
>
> SELECT DISTINCT ON (jj->>'email') jj->>'email', jj->>'name' , count(*)
> over(partition by jj->>'email' )
> from emails
> join lateral jsonb_array_elements(send_to) j(jj) on true
> ORDER BY
That's what I am doing. Thanks, I just wanted to be sure I did not miss
anything.
On Friday, May 24, 2019 at 10:21:06 AM UTC-4, Jeremy Evans wrote:
>
> On Friday, May 24, 2019 at 6:48:52 AM UTC-7, Allan Peda wrote:
>>
>> Hi,
>>
>> I am using Sequel mostly for the convenience of bind variables
On Friday, May 24, 2019 at 6:48:52 AM UTC-7, Allan Peda wrote:
>
> Hi,
>
> I am using Sequel mostly for the convenience of bind variables (with
> MSSQL/tiny_tds).
>
> I see positional binds are possible with a straight SQL call, as in:
>
> arr = [33, 26, 33]
> sth = dbh['insert into mytab(a, b,
Hi,
I am using Sequel mostly for the convenience of bind variables (with
MSSQL/tiny_tds).
I see positional binds are possible with a straight SQL call, as in:
arr = [33, 26, 33]
sth = dbh['insert into mytab(a, b, c) values (?, ?, ?)', *arr]
sth.call(:insert)
Is there any way to set the binds
In fact, query is now like this:
SELECT DISTINCT ON (jj->>'email') jj->>'email', jj->>'name' , count(*)
over(partition by jj->>'email' )
from emails
join lateral jsonb_array_elements(send_to) j(jj) on true
ORDER BY jj->>'email', id desc
On Friday, May 24, 2019 at 12:55:01 PM UTC+3, xura
I've achieved similar query by this:
.select(to.get_text('email').as(:email), to.get_text('name').as(:name))
.cross_join(Sequel.function(:jsonb_array_elements, :receiver).lateral)
.order(Sequel.desc(to.get_text('email')), Sequel.desc(:id))
.distinct(to.get_text('email'))
However, i couldn't
Hi,
Is it possible to write this query with Sequel?
SELECT DISTINCT ON (x.e->>'email')
x.e->>'email' as email,
x.e->>'name' as name
FROM messages sr
CROSS JOIN LATERAL jsonb_array_elements(sr.receiver) x (e)
ORDER BY x.e->>'email', id desc
Or I use
Hi,
Is it possible to write this query with Sequel?
SELECT DISTINCT ON (x.e->>'email')
x.e->>'email' as email,
x.e->>'name' as name
FROM messages sr
CROSS JOIN LATERAL jsonb_array_elements(sr.receiver) x (e)
ORDER BY x.e->>'email', id desc
Or I use
13 matches
Mail list logo