On Tuesday, January 14, 2020 at 10:21:28 AM UTC-8, Rebecca Paz wrote:
>
> Hello,
>
> We are interested in using Sequel to interface with Snowflake 
> <https://www.snowflake.com/>, which is ODBC-compliant and can be 
> connected to as such:
>
> require 'odbc'
> require 'sequel'
> db = Sequel.odbc('SnowflakeDsnGoesHere')
>
> db.run('select 1;')
>
> db.disconnect
>
>
> We have a need to issue queries to Snowflake without waiting for the query 
> to complete, and therefore we have no need of the immediate results. This 
> is because we're depending on some Snowflake commands that allow us to 
> store the results of a query as a CSV in an S3 bucket, which run the query 
> asynchronously of the caller/requester. For this purpose, Snowflake's 
> SnowSQL <https://docs.snowflake.net/manuals/user-guide/snowsql.html> 
> client provides a `results=False` option when issuing a query, allowing the 
> system call to immediately return once the query has been submitted to the 
> database. I'm hoping to find a similar option as we try using Sequel for 
> our purposes.
>
> I took a look through the Sequel documentation and I don't believe I see 
> any options to make queries submitted to an ODBC database asynchronous, or 
> at least not try to wait for the query to complete before returning. Is 
> this something Sequel can do, via ODBC or otherwise? I can provide more 
> information if necessary.
>

Sequel's API was designed for synchronous behavior.  So if you want 
asynchronous behavior, you need to a separate thread or process. If the 
ruby ODBC driver supports asynchronous behavior, you can drop down to the 
connection level using `db.synchronize` and use the ruby ODBC driver API to 
perform asynchronous queries.  You do lose a lot of Sequel's benefits with 
that approach, though.

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 view this discussion on the web visit 
https://groups.google.com/d/msgid/sequel-talk/3556f39d-5226-4b7a-b270-0d1057025d5c%40googlegroups.com.

Reply via email to