On Monday, February 29, 2016 at 6:37:17 AM UTC-8, Jonathan Greene wrote:
>
> Jeremy, 
>
> Can you explain the difference between the API we used and the one you 
> provided? We tried to look through the documentation to better understand 
> the API.
>

The difference between the two is that one uses parameters and one does 
not.  Sequel's default behavior is to escape input internally and provide a 
single SQL string to the database to execute.  The prepared statement/bound 
variable API supports real database parameters (or emulates them on 
adapters not supporting them).

The reason for this is that as originally designed, Sequel did not use 
parameters at all.  So to add support for them, I had to implement a new 
API. I actually implemented automatic parameterization as an extension to 
the postgres adapter, but it was slower in the vast majority of cases, and 
the extension was removed in Sequel 4.
 

> Also, How can we add eager loading to your example below
>
> TableName
>
>             .where(query)
>
>             .where("act_bgn_ts >= ?", begin_date)
>
>             .eager(TABLENAME_EAGER_LOADING)
>
>             .all
>
>
>
 TableName
  .where(query)
  .where("act_bgn_ts >= ?", :$begin_date)
  .eager(TABLENAME_EAGER_LOADING)
  .call(:all, :begin_date=>begin_date)

Thanks,
Jeremy

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to