Thanks for the reply, still the same issue, instead of printing the literal 
value of the bind I get's a parametrized query but the bind values are not 
inline as expected after passing the compile_kwargs={'literal_binds': True} 
to compile().

Here is what I get when I use the print_query from your gist:
[q.compile <class 'sqlalchemy.sql.dml.Insert'>]
INSERT INTO proddw_base.tms_contracts (salesforce_id, name, 
channel_account_name, apttus_agreement_number, apttus_term_mo, 
apttus_auto_renew_term_mo, apttus_status_category, apttus_status, 
effective_date, end_date, current_term_end_date, 
apttus_contract_start_date, apttus_term_date, yt_deal_type, rev_share_rate, 
rev_share_excess_rate, threshold_rev_share_rate, cpm_rate, 
cpm_cap_threshold, yt_live_streaming_deal_type, live_stream_rev_share_rate, 
other_platform_deal_type, other_platform_rev_share_rate)
VALUES (%(salesforce_id)s,
        %(name)s,
        %(channel_account_name)s,
...
        %(live_stream_rev_share_rate)s,
        %(other_platform_deal_type)s,
        %(other_platform_rev_share_rate)s)
None

I have verified that the params list is populated with my dictionary.  I 
could easily do my own  <string>.format(**params) to merge in the dict but 
then that wouldn't take care of string quoting, casting dates, etc.  

I guess this leaves me with my original question, what does "literal_binds" 
get you when comiled_kwargs is filled?  Per the documentation I would 
expect it to at minimum merge in the parameter values into the string 
inline.  Possibly it's not working as intended right now?  Or possibly it 
doesn't work for DML statements?



On Friday, October 24, 2014 4:50:50 PM UTC-7, Jonathan Vanasco wrote:
>
> I believe you have to specify a dialect in order to get the binds 
> presented in the right format.
>
> This is the utility function i use for debugging.  you could easily adapt 
> it to return a sqlite statement.  
>
> https://gist.github.com/jvanasco/69daa58aeb0e921cdbbe
>
> that being said -- I don't think you will be able to (reliablly) do what 
> you want in the current release.  
>
> The values for LIMIT/OFFSET will not appear inline when you compile a 
> statement (through at least 0.9.8).  i think there are some issues with 
> certain CTEs as well.  To my knowledge, both issues are addressed in the 
> 1.0 release.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" 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 http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to