using common table expressions (CTEs) with sqlite3-ruby

54 views
Skip to first unread message

Matt Work Coarr

unread,
Jul 30, 2014, 3:58:25 PM7/30/14
to sqlite...@googlegroups.com
I'm trying to run a sqlite query that includes a common table expression (see: http://sqlite.org/lang_with.html), but it's failing to parse the query right away on the "with" keyword.

They have been supported since sqlite 3.8.3.  I'm using sqlite 3.8.5 on my system.

I should say that I'm running this on a mac and I have two versions of sqlite.  The apple-provided version in /usr/bin/sqlite3, and the homebrew version in /usr/local/Cellar/sqlite/3.8.5/bin/sqlite3.

I've tried three ways of installing the sqlite3-ruby gem:

1. gem install sqlite3
2. from source cloned from github's master branch (ruby setup.rb config; ruby setup.rb setup; ruby setup.rb install)
3. gem install sqlite3 -- --with-sqlite3-include=/usr/local/Cellar/sqlite/3.8.5/include --with-sqlite3-lib=/usr/local/Cellar/sqlite/3.8.5/lib

All three fail on parsing the "with" clause.

Any ideas?

Thanks!
Matt

Aaron Patterson

unread,
Jul 30, 2014, 5:57:37 PM7/30/14
to sqlite...@googlegroups.com
On Wed, Jul 30, 2014 at 12:58 PM, Matt Work Coarr <mattcoa...@gmail.com> wrote:
I'm trying to run a sqlite query that includes a common table expression (see: http://sqlite.org/lang_with.html), but it's failing to parse the query right away on the "with" keyword.

Interesting.  Could you provide a sample query?  Also, does the query work if you're just using the `sqlite3` executable?

--
Aaron Patterson
http://tenderlovemaking.com/

Ronald Hart

unread,
Jul 16, 2015, 1:05:19 PM7/16/15
to sqlite...@googlegroups.com
I have the same issue.  Can you please let us know if you were able to fix it?
Reply all
Reply to author
Forward
0 new messages