On Thursday, August 15, 2013 6:37:31 AM UTC-7, GregD wrote:
>
> Anyone-
>
> Trying to get Sybase SqlAnywhere to work for Sequel using the native 
> sqlanywhere driver: https://github.com/sqlanywhere/sqlanywhere and having 
> a few issues with the integration tests.  I just started this in my spare 
> time, so I haven't gotten very far yet.  One thing that has me stuck are 
> these 2 failing tests and need a solution is:
>
> rspec ./spec/integration/dataset_test.rb:67 # Simple Dataset operations 
> should graph correctly
> rspec ./spec/integration/dataset_test.rb:71 # Simple Dataset operations 
> should graph correctly with a subselect
>
>
> The SQL generated is correct and works in the Sybase Client software:
>
> "SELECT * FROM \"ITEMS\" LEFT OUTER JOIN \"ITEMS\" AS \"B\" ON 
> (\"B\".\"ID\" = \"ITEMS\".\"ID\")"
>


That's not the correct SQL.  A graph should always have explicitly 
qualified selections.  For example, on SQLite:

SELECT `items`.`id`, `items`.`number`, `b`.`id` AS 'b_id', `b`.`number` AS 
'b_number' FROM `items` LEFT OUTER JOIN `items` AS 'b' ON (`b`.`id` = 
`items`.`id`)
 
So the first thing you should do is find out why it isn't generating the 
correct SQL.

Here is the code gist of the Database and Dataset Modules.
>
>
> https://gist.github.com/gditrick/6240781
>

This appears to be based off a very old version of the mssql adapter.  Much 
has changed in the meantime.  I can't see what is causing it to give 
incorrect SQL for the graph call, though.

 

> I could not get much to work until I added the commit in the 
> Databaset#execute method on line 99 
> https://gist.github.com/gditrick/6240781#file-sqlanywhere-rb-L99.  I did 
> not see this in other adapters in Sequel.  I'm sure this is wrong and 
> probably need allow Sequel to issue the commit someplace.  I've seen 
> definitions for a "COMMIT", but define it like it was in other adapters did 
> not work.  Looking at AR's SqlAnywhere adapter, it seems they are doing it 
> with this:
>

You probably should turn on auto_commit on the connection if it supports 
it.  That is what the other Sequel adapters do. 

Sorry I can't be more help.

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 http://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to