Hi All,

Apologies if this gets posted twice... I've been running into some strange 
issues when trying to execute raw SQL queries via an adapter. For example, 
with this query:

DataMapper.repository(:default).adapter.execute('insert into dom_nodes 
(page_id, tag_name, parent_id, dom_id) values (1, "DIV", 2, 3)')

I get the following error (although the query is valid and runs 
successfully via the MySQL console). 

Unknown column 'DIV' in 'field list' (code: 1054, sql state: 42S22, query: 
insert into dom_nodes (page_id, tag_name, parent_id, dom_id) values (1, 
"DIV", 2, 3)

Changing the double quotes around DIV to single quotes cause it to execute 
successfully via DataMapper. However, for more complex queries where I 
escape single quotes, I get an "SQL syntax" error (but again, the query 
that's part of the error message is valid and runs successfully in the 
MySQL console). Here's an example of such a 
query: http://pastiebin.com/?page=p&id=4fc2c7e7e8ecc

Any ideas on what could be causing this? Are there things DataMapper is 
doing in the background for adapter query executions?

Thanks!

-Arvind

-- 
You received this message because you are subscribed to the Google Groups 
"DataMapper" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/datamapper/-/zrtVU10H73UJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/datamapper?hl=en.

Reply via email to